|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! {- O8 y' W: ]! Y* C) p y
( o3 g: h. i3 b- R9 l: M) }& Y3 Q9 V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, J: l* B$ d" U- y3 c3 P
- e2 r/ @- S( r" F A% f) ?+ `2 U
begin P_read arriving
2 H$ Y! h/ q; m& W while 1=1 do begin
9 G- K+ Y! ]6 h" b) E read A_tote from "data.txt" with delimiter "\n". N- I: d( I8 n0 _) @
read A_time from "data.txt" with delimiter "\n": i5 E1 d$ G8 s2 Y0 O, j
read A_leave from "data.txt" with delimiter "\n"
1 Z. n; t. `8 j4 e read A_picks from "data.txt" with delimiter "\n"
9 z4 t, q( P" j' u3 [$ H set load type to A_tote
4 k; h7 V& _9 n5 X+ o$ ^. ^ if A_tote="tote 1" then set A_induct to 1; x$ Z& ^: c; J4 N9 K
else if A_tote="tote 2" then set A_induct to 26 ^% W& c; t1 g1 W6 J9 N; N0 N$ ]
else set A_induct to 3 1 l0 l5 H( G5 F) B w: `
set A_i to 0
2 B5 Q o: [) l- \! X& Q clone 1 load to P_induction
2 e* r6 n4 Y+ t1 r9 N2 ]! I wait for A_time sec; k% c" u9 n' q8 d+ c
end( P' W, E9 g# e6 f f1 p. c
end3 L1 q. k" [8 |3 h6 N9 ^! X- g" t
8 f4 w, r; Y# }, W% z Y
begin P_induction arriving
7 _! x& ` v& f- K; Y& B& I# s if A_induct=1 then clone 1 load to P_pick1
7 V3 f3 Z+ @" D! W6 T3 i- Y else if A_induct=2 then clone 1 load to P_pick2
9 Z+ ~; x9 j2 Y else clone 1 load to P_pick3
Y* b. W- G H5 S5 ^end
' d! y2 x1 k K j% {( V6 Y3 w# ]$ a( F8 |
begin P_pick1 arriving3 T; a) U7 f1 O' i* m+ v3 [) N/ G6 O
set A_i to 1
( S0 b6 ^7 m- ^' m- p move into Q_induct1
1 R6 T7 ?( V+ f* ~+ @ move into pickaisle.induct1
& R! B5 |+ {- x/ w5 Z" w while A_i<=30 do begin
7 _# J# X4 \, C1 e6 V5 t8 F; l travel to pickaisle.con(A_i)* h3 L4 F1 f, A7 e: U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
x5 ^5 A' Z$ c4 j1 x2 X2 @ else wait for 10 sec
# U( o) H; Q }! h. y) M, Q# R7 U* \ if A_i=A_leave then send to die( W4 R) d8 Z0 @( T, u
else inc A_i by 1
/ Y0 A" b% W5 L- ` Z end3 d0 R0 L% r9 n0 V' Q* k
end' o0 Y7 J8 l* K7 t+ t3 U4 ^/ m1 [/ ~
1 [( `2 P% F8 Z8 z
begin P_pick2 arriving" v E! X! H& B Z) b) h8 }
set A_i to 11+ Z$ {4 z* i. Q
move into Q_induct27 O8 p' ?" [0 }7 `6 a# I* P
move into pickaisle.induct2
* U% C: _9 |3 M while A_i<=30 do begin
/ P. i) O0 ^% ~% u/ ]3 F; T travel to pickaisle.con(A_i)" s! L% Q/ k( N9 N# y9 j2 ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' B& @& @9 k# c& h" B
else wait for 10 sec4 g2 g& `4 n7 p4 I {3 J5 @
if A_i=A_leave then send to die0 {, I( x& h3 C8 g& ]) T7 k
else inc A_i by 1
! c- x) I" W# q; y* p8 U& X" H end
) C% u; m6 `3 K! F/ l$ send- U% H. D8 x; e8 g
1 j# _1 O6 J7 y
begin P_pick3 arriving0 B; _+ t+ ^ w0 ]$ s
set A_i to 21$ M0 x6 x8 K) ]0 S* T, {; U
move into Q_induct3; A2 R6 v+ ~* F* F3 \4 v& e/ y
move into pickaisle.induct3
* b6 b- J8 q9 a! t4 T+ o# M2 O while A_i<=30 do begin
: A ^- w; }) B( i/ Y travel to pickaisle.con(A_i)
% ^* v, C, L1 c2 ^% l `. \! H4 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, |" ^- X% K7 }# u, [4 F
else wait for 10 sec' G- A% z0 M5 K$ r4 i
if A_i=A_leave then send to die
; z2 E0 E! U) Y* k* U3 ]# V5 v else inc A_i by 1# |# e3 R3 U; ^; W2 Q
end
+ B7 S1 I' r, ^0 tend |
最佳答案
查看完整内容
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,其它按你的 ...
|