|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 a8 R6 P M m' D+ ?" k! D# A2 }0 k! i u7 c- H' l' ?( V' p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 m# ^5 O! B) N2 s1 ]+ l& n6 l( R3 k; J7 Z2 `! c1 z9 G
begin P_read arriving
$ l4 h" f! E0 h( l while 1=1 do begin+ d% C7 u! t/ c1 N
read A_tote from "data.txt" with delimiter "\n" q+ p: l7 V, B
read A_time from "data.txt" with delimiter "\n"
2 M! g' L9 A6 d$ A read A_leave from "data.txt" with delimiter "\n" X; p( ]! A; o( \: c1 G$ I2 b
read A_picks from "data.txt" with delimiter "\n"
' j2 ?' [: r3 m. |( Z: I set load type to A_tote' p* w- \$ ~8 }: b+ N
if A_tote="tote 1" then set A_induct to 1& n' E3 S( B6 g% }( ]
else if A_tote="tote 2" then set A_induct to 2, |1 @, r* {( _/ ~. D8 E
else set A_induct to 3 ) y- T# n7 |0 }6 @0 Y$ X) {: M" m
set A_i to 0
: Y3 f% m& o4 x- p2 `1 Y3 O clone 1 load to P_induction
3 Y; g) ?2 U6 n wait for A_time sec2 I9 q6 h# x: S, ?2 l
end
2 z% A6 j* b8 m5 d* ]( M( N. Cend
% t3 `2 h& ~ s- g- x& d1 v8 l' K% t0 A9 j$ a( d0 j' k
begin P_induction arriving
7 g3 k1 k/ g- E+ s: d6 z g0 r if A_induct=1 then clone 1 load to P_pick1
5 \! u$ f3 n+ {# u3 l/ [! U else if A_induct=2 then clone 1 load to P_pick2
% H" M7 E" P* P+ M6 _8 u else clone 1 load to P_pick3
+ a# F; ^% m% G( Xend. z' ~$ H5 P3 _; n6 k# ~3 u
5 `( G/ p4 g6 ubegin P_pick1 arriving* u$ p2 ~. Y: o
set A_i to 1" B7 y" u. w0 N v" F$ e( I( a
move into Q_induct1
. L4 v2 f6 d' a- a% S move into pickaisle.induct1
% t! W5 ?- R2 X! n5 ]. U. D while A_i<=30 do begin h) M; Q0 X4 t y! o! _
travel to pickaisle.con(A_i)
8 z- D2 |5 L% o0 }- k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 g; h4 m# V! `- G
else wait for 10 sec
$ C1 v! h9 H+ Q if A_i=A_leave then send to die
+ G4 g9 p" }$ E3 ~$ V3 o/ z else inc A_i by 1
7 k- s9 h+ U/ q" a* @. _# o end. m, @$ q* E6 m2 |
end$ X1 u7 ^: L- F5 h& f% I' |
6 k0 i! q# W6 d& z [4 f4 lbegin P_pick2 arriving
) [' l3 m: K3 E# q$ a7 v set A_i to 11
$ T5 A$ X$ f b8 S2 m9 t' b3 l2 \; r7 M move into Q_induct2, }; ~$ j7 L1 o7 i9 b
move into pickaisle.induct2! R+ S7 R N' i2 S
while A_i<=30 do begin
& t+ z( f: P/ W0 K4 P$ P6 n- q) k travel to pickaisle.con(A_i)
$ z5 l& ~8 r1 ?7 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! R7 O+ r% k, B" `9 x else wait for 10 sec
. u0 n& @( z0 @; E: _ if A_i=A_leave then send to die
2 Q3 ]: i/ W. M: U1 Q' }; y& v( \ else inc A_i by 1
8 j. C8 q' @' F% Q0 y% r. P4 b end# _9 E2 o6 H+ K' I1 f2 S4 J
end
) E2 f: e: R! G6 i% m! z0 d, p% A, B2 c: w5 v1 t$ o9 {: p( ^
begin P_pick3 arriving: v; G' F9 G4 a5 T7 l- i; i' m1 x
set A_i to 21. o( R2 |1 } x. a2 W5 R; Z
move into Q_induct3
: U+ M; W9 N! V; ^+ d9 g move into pickaisle.induct3
4 t/ ?9 A0 `3 h while A_i<=30 do begin6 _2 W4 O# ?* y; K# m% Q2 e6 i
travel to pickaisle.con(A_i)
& ~ a- p' |% f' C+ n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ A9 C% X0 o4 M; S5 v else wait for 10 sec
( @ m# D" N% h6 p, I' _3 ~, _% u2 f if A_i=A_leave then send to die7 P( \6 Q7 C3 {5 K0 D# f
else inc A_i by 13 k' Z) k2 ?7 J) F- W9 }
end: ]' ]( z( j$ f$ k/ B
end |
最佳答案
查看完整内容
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,其它按你的 ...
|