|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, R5 T9 l8 c( R( t- t. ?' N
6 X. O/ R2 ~% w$ o
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。& R5 h5 @6 ^* X7 k/ o$ A- m/ R! R0 Y
. @" Y# E. h! V0 r+ Nbegin P_read arriving3 a* ?# L/ Y, R2 \4 K& ]6 G4 I5 H# [- A
while 1=1 do begin
) v. b! a& E& u {! _. T8 x read A_tote from "data.txt" with delimiter "\n"
2 c0 N2 }7 `7 N4 f) o5 A read A_time from "data.txt" with delimiter "\n"$ X3 @! w3 m0 e' |
read A_leave from "data.txt" with delimiter "\n") J6 X2 q, \+ }$ ^4 H& i4 s
read A_picks from "data.txt" with delimiter "\n"
, R. E' `. c) P& t5 z/ y# [ set load type to A_tote( v9 d, i" p/ }- c' y
if A_tote="tote 1" then set A_induct to 1
$ x9 P/ s9 N1 s# { else if A_tote="tote 2" then set A_induct to 2
' p8 `' _$ t5 B2 H) f. D& i else set A_induct to 3
Y6 Y# I: U2 {" @* A; y4 Y set A_i to 0
/ k* o: D; ?" P* s' k! Y0 z clone 1 load to P_induction( d$ w4 q3 |- [9 X6 w' _/ e' p
wait for A_time sec
7 b, V7 k7 f8 a: H5 I end* f% M" Y8 q' M7 F, B p* k3 E2 U
end
% B+ w% V* {" g3 C0 B* {5 E! _- p' @
begin P_induction arriving
* N; ?+ a+ U0 x5 N2 U2 v2 N if A_induct=1 then clone 1 load to P_pick1
* _! o9 T) h Y9 [: `, [ else if A_induct=2 then clone 1 load to P_pick2
3 s B3 ^' j0 J( y+ G7 | else clone 1 load to P_pick3
5 s1 [7 z' P+ nend# M; F1 h: c: l. y8 ?& E
" c8 t; }; R9 O
begin P_pick1 arriving( c& t+ A6 G) g: ~$ Y7 Z% X
set A_i to 1
! B8 X1 {& u6 z, h9 _" b move into Q_induct1
2 \% u% Z( u3 I9 g1 {) ^' c8 P" h( {/ N move into pickaisle.induct1: O! ~7 W0 b) Q$ k& u+ M
while A_i<=30 do begin- G o& v6 Q3 Q9 i, i% p/ z1 @
travel to pickaisle.con(A_i)- ~# X. ~. i( ]* _8 `4 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) l$ O/ S/ U0 e" R else wait for 10 sec
/ u. B* _8 L4 K- U3 S% \ if A_i=A_leave then send to die
% k# \, Y1 s8 }( p- | else inc A_i by 1
, g3 x! i9 b3 |6 i7 e) @% j1 [ end
3 m( U3 t P' P# o2 H1 \end* c6 ]8 X$ a2 X$ V
# ` \6 @ k! i$ i1 O) d7 d& e2 `
begin P_pick2 arriving- B4 V; {- m: p& m; v t
set A_i to 11+ ]& h1 M2 h7 E# u- M
move into Q_induct2! q: A+ y" P' X+ h
move into pickaisle.induct2
% v5 }8 |9 z8 a; W0 p8 e while A_i<=30 do begin
2 s6 M- _* o% T2 B: E- Q travel to pickaisle.con(A_i)! \# {- Y% r' }) P* P8 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 P! r7 F4 Q n. R' ~( n
else wait for 10 sec
/ E, A1 |7 h( \( C* k0 B if A_i=A_leave then send to die
$ o* M9 W' a w- N- c else inc A_i by 1
9 ]2 V+ n; l2 e: S) @1 K! R- _+ s end( M! N0 E! u2 o7 p! j+ u/ E
end
/ K& w+ V3 I! c' S
+ C. H9 y# f: Q+ S9 vbegin P_pick3 arriving
" c- a+ s* ]4 T* Y" v$ p set A_i to 211 h$ v. h J: W/ P1 g, \7 J! ^; y
move into Q_induct3; N7 [4 \% \2 [4 R$ G
move into pickaisle.induct3' Z2 a: Q y: s8 M# D
while A_i<=30 do begin
& F( L& ~3 w9 Z- w% I. y% g travel to pickaisle.con(A_i)" h. O4 ?, C8 r1 ^7 b# k% ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ?/ `- ~- f1 x+ g7 X( w, Z: G
else wait for 10 sec
& T5 V2 w7 n# J- K if A_i=A_leave then send to die- f5 \/ f' ]7 f
else inc A_i by 1, ?3 N; \0 D' Y: \" y$ ]/ `7 t
end
* c' ?' A$ G5 send |
最佳答案
查看完整内容
pickaisle.induct1/2/3是个什么东东?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
|