|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 X2 [5 G& q, g" ~4 |$ ]+ F, b# k/ C3 @! l" r! y: s3 E( 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中的数值,不知道会不会有什么不妥。
2 G0 s* G* b6 u8 K$ Z
9 D6 \/ h+ y# J- ubegin P_read arriving% g) u2 N- C+ A( m
while 1=1 do begin
" h( I- z8 s$ u2 g" v read A_tote from "data.txt" with delimiter "\n" ~. Z0 D! \9 J4 a
read A_time from "data.txt" with delimiter "\n"7 E5 R! V' q& D% m& v
read A_leave from "data.txt" with delimiter "\n"8 y& I, Z1 _6 U7 }: G
read A_picks from "data.txt" with delimiter "\n"$ s% u1 X) T; P2 [
set load type to A_tote
' K& w/ _# J* n' s if A_tote="tote 1" then set A_induct to 1
+ W5 A9 @6 _: \/ \5 [# G7 { else if A_tote="tote 2" then set A_induct to 2
1 O+ R" b) Q! i# b& V else set A_induct to 3 " R4 @/ F1 k( B0 x+ Z T
set A_i to 0
% S( ? \5 U F8 W; Q% }4 { clone 1 load to P_induction
+ w: c1 {2 L- K% J% Z wait for A_time sec, v' r$ X) A5 I7 B3 B" s4 [" w
end
0 L# M! o7 @, a7 p/ lend
, @6 {) J a% U; W% j" Z! D
* n5 ?5 Z4 Q$ P6 {) Hbegin P_induction arriving6 D t" L; |: K& U
if A_induct=1 then clone 1 load to P_pick1! V7 Z% |% _1 c8 `1 @
else if A_induct=2 then clone 1 load to P_pick20 I# s1 j8 q1 T, X, N
else clone 1 load to P_pick3. D3 |1 B$ H3 a
end; {: [; \% _. b: ~5 O# X
6 n; t" w# k4 R; |2 }; ~. m4 X5 Obegin P_pick1 arriving3 [8 N5 o/ H. h- O8 s8 b
set A_i to 1& |8 B/ J! D2 l. }1 E
move into Q_induct10 ^$ C# f0 y0 D7 ?/ E
move into pickaisle.induct18 B' i5 M8 x- P2 X( |9 \2 ]- ]
while A_i<=30 do begin1 v; q- h A# h% ^5 b
travel to pickaisle.con(A_i)5 X+ u2 @9 @# h7 H3 L- a% x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 v1 u3 B& {+ I2 y. `7 z3 b3 g3 E
else wait for 10 sec
6 l% Q! P& u$ ^2 P) O if A_i=A_leave then send to die
+ u7 y: j- B5 Z y% u else inc A_i by 1/ s2 b0 l$ h5 K
end: H4 s: p1 m" t3 l4 D
end
- H9 E% G$ G& V; t+ J3 F
0 @7 B5 Q ]& O: N4 M4 `+ zbegin P_pick2 arriving3 f3 L+ c. P% @! \
set A_i to 11& J, A! q. {, p- D) x
move into Q_induct2
' G# `: Q; J) n/ { move into pickaisle.induct20 x1 j0 \4 u/ r5 m4 m
while A_i<=30 do begin
. \' M/ G. ]- \, Y travel to pickaisle.con(A_i)
6 m4 V& o& G* a a$ m' H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ]) T. U. V+ r5 f1 o/ G
else wait for 10 sec
! m% |+ _- q; D( U# P5 t if A_i=A_leave then send to die
- R! s+ @. m2 S. u( \. g: c else inc A_i by 1
3 z- P( f- S, Z# ]4 N end7 [7 K7 \* S6 S2 \& i
end
, d8 H6 c H/ j; H' \1 [8 f4 d6 h& O$ e0 x7 ?: E
begin P_pick3 arriving& W* b( }: ]/ c/ B) M! C
set A_i to 21
) H) Y/ [4 M4 }( \( R0 @ move into Q_induct3+ Z- }7 O8 {# E. _
move into pickaisle.induct3* M- F f1 r- i7 b7 @
while A_i<=30 do begin% q2 S( u. `: N, I4 _& e! S
travel to pickaisle.con(A_i)
$ R) k) A5 s2 M# ~' D; C- E8 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 R% a! u9 l3 _& ? P+ _3 \$ v
else wait for 10 sec
/ ?, ^$ T6 D5 f4 \1 N! W if A_i=A_leave then send to die
- S% m7 i: R; g else inc A_i by 1: ?2 x! k% q. z+ L6 p+ a- U" E
end! B3 j1 q( G" P* ~
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,其它按你的 ...
|