|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: g, U1 s \; e/ _
5 @: s7 y& K+ F1 T# T8 ?- h' r' u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( {, C1 k9 o0 n
5 z/ p, L ]1 `7 C% C, ebegin P_read arriving
X( F/ U# J- a! z+ x8 @ while 1=1 do begin9 \) ^- f7 V( x2 Y6 e8 a
read A_tote from "data.txt" with delimiter "\n"
, v/ C+ A8 S$ n- d$ K read A_time from "data.txt" with delimiter "\n"
+ I& _: ~' g; }& D1 Q read A_leave from "data.txt" with delimiter "\n"% ~0 e) l! v* C0 u. N! f* t( }# `
read A_picks from "data.txt" with delimiter "\n"
" D; _: E+ Z' U2 W set load type to A_tote
/ w/ q8 k7 c4 T: ~ if A_tote="tote 1" then set A_induct to 1
, g2 U9 P& z0 O$ H) t. E( I else if A_tote="tote 2" then set A_induct to 2
% h3 c; h9 H( A( f1 Q else set A_induct to 3 : W$ P" `7 m+ | Y5 E! Z0 W9 Y
set A_i to 01 X5 e0 S7 X( _# a9 [6 U% O& x
clone 1 load to P_induction
6 H3 H6 n8 p* s5 @ wait for A_time sec
( o% o7 e' i" F& Z end
7 b2 ?+ b$ X5 u, @3 Z% g$ D+ R2 {3 ]" Pend
0 S) p$ C7 \* J5 E! w0 O/ n; r2 c4 X$ ~8 m' j% i$ k& Y& d z0 K( e) x
begin P_induction arriving
$ o: S6 _% N, G* L/ U4 y# j if A_induct=1 then clone 1 load to P_pick1/ Z' ?' [3 ~, ]5 p& m; C7 X& H1 G
else if A_induct=2 then clone 1 load to P_pick2
& K; L6 ?2 _) u' d else clone 1 load to P_pick3
6 @5 a9 i4 A L8 j% J! E7 [end
, k/ A- ^$ C; o9 p* Q5 v. j3 U
( g# h. s# O v. V' U5 m6 {2 }begin P_pick1 arriving8 I" P) r* Q5 y X$ [8 Z
set A_i to 11 g* H* Q$ @# n# J# g$ v# a
move into Q_induct1
T. I( Q9 Z4 T move into pickaisle.induct1
- s& B$ A1 l1 [$ K5 U while A_i<=30 do begin) J2 M0 X' D& X+ K# ]
travel to pickaisle.con(A_i)0 F5 b9 i$ F8 ?, F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* V; j5 _" n7 B else wait for 10 sec
. @. Z* l6 w( _1 q3 k$ ?5 R J/ U if A_i=A_leave then send to die
' m2 E# X% Y6 R7 F3 j1 s: P else inc A_i by 1
& j* Y; U/ S5 d+ g2 V$ E end
& q2 { T* ]0 c0 [end
3 y8 w2 Q+ M1 T6 v q8 k7 \0 w6 b/ u& t6 `% Y' m' I" w$ Q
begin P_pick2 arriving" [( Z/ a. W* u* {
set A_i to 117 ~/ G+ y; U% k3 r: o
move into Q_induct2- R0 z/ o, `# D
move into pickaisle.induct2+ I) ^" U z* l
while A_i<=30 do begin
* F7 a. u% O0 T' |0 i: q) s- H6 s travel to pickaisle.con(A_i)4 X3 z9 c! P3 r- j1 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 y% |; l t! M$ f3 ~7 K- @ else wait for 10 sec
) {$ K: J' l( s; R5 F; | if A_i=A_leave then send to die
( C% j$ p3 _$ D- ~' P; f: l# A$ b else inc A_i by 1" u6 J3 G! y9 g; C8 }/ \# W1 {7 v
end
% v+ e$ q) c- c3 R: B- \# I6 ~end. @5 S4 A5 O( T- M
3 O9 e X. p+ x, M* R4 _
begin P_pick3 arriving
' ~! N. [% N; o7 e- W/ n set A_i to 21$ q6 G" H3 s4 r
move into Q_induct3
1 \ g* U7 w2 _% T N2 o) ~' j move into pickaisle.induct3
: H- s3 S, L7 j) K; P while A_i<=30 do begin$ u7 f% \2 ~0 S6 a
travel to pickaisle.con(A_i) b/ [% V9 t' u7 f" U. N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 h* H5 i: ]6 ^) o6 H( g6 a) A
else wait for 10 sec
7 m) f4 H8 J/ e$ g2 H3 [ if A_i=A_leave then send to die
7 i% e; B, D# W1 V( R' K J else inc A_i by 12 o8 R E& r3 X" |
end
% M2 V/ D x0 fend |
最佳答案
查看完整内容
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,其它按你的 ...
|