|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 M0 }$ A+ g x
2 c6 h3 V8 y, M; 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中的数值,不知道会不会有什么不妥。
0 h9 a( r5 e' ]& u9 h0 K6 A- X8 a; F
begin P_read arriving5 u% U' y2 _. S
while 1=1 do begin
2 c E2 y$ Y7 [% z! U read A_tote from "data.txt" with delimiter "\n"
0 `8 z, n7 V; F; h/ n# l, N read A_time from "data.txt" with delimiter "\n"0 ?; o1 S* c! \2 q: ?. e
read A_leave from "data.txt" with delimiter "\n"$ p7 C; s$ l* g4 @& |
read A_picks from "data.txt" with delimiter "\n". @9 x4 H; {5 G6 [9 y. i* D6 W5 N& z# A
set load type to A_tote9 a8 U+ i, M! w6 O
if A_tote="tote 1" then set A_induct to 1
4 s: _- @2 U* J8 A$ L else if A_tote="tote 2" then set A_induct to 2
( _- S( K0 g; A Q4 A else set A_induct to 3 " X% M( W( i- z) w( ?$ a
set A_i to 0. [& y3 V2 g& V# Q' k
clone 1 load to P_induction
, q# ` J b& k0 f* c# S+ p$ { wait for A_time sec
8 |; N; x! K( r: e/ S( N end
% Y) V& p) V! m, U6 m) i7 d6 u& Wend* s* k% D# h1 i6 L, U' p. @' Z
X0 Z& r! D4 o/ ^begin P_induction arriving
- \7 U; _$ m( k& z2 }' Z( ~" ]" v$ \) J if A_induct=1 then clone 1 load to P_pick1
* S' f, V, {% g+ Q, P7 \ else if A_induct=2 then clone 1 load to P_pick24 g6 `. x. D: ~! H S# U' B
else clone 1 load to P_pick3
9 T4 ?* X% \5 ]% Wend
1 d) g- b b% O" W5 H! B* g. Q* `/ X" m
begin P_pick1 arriving
; g9 m: F$ u5 i set A_i to 1- s& Z2 F% P. w; _9 @* W
move into Q_induct1
" z# G3 [$ }4 ?: Z move into pickaisle.induct1
: {! Q h# B5 h0 l" ?7 ^ while A_i<=30 do begin
: D& ]3 K# t# \3 b% e% \2 G travel to pickaisle.con(A_i)
/ i% U& N9 M) ]& Y( J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( U6 i" W! ?- F3 p6 S+ t else wait for 10 sec( I ]* x k5 d+ h0 |7 P* @
if A_i=A_leave then send to die
3 N3 ^3 {. C; T! b. i: j5 K( F else inc A_i by 1- G& j' F9 P+ S* k0 `
end) D+ F* D8 Y2 U ]* }
end
* L8 c7 A7 l* f/ M! @# h( u. z/ c, m( [2 G
begin P_pick2 arriving0 R( N6 E; x6 G5 m
set A_i to 11
1 e3 H6 h% P/ h: U! I9 E ?$ I move into Q_induct2
- W1 t- H* o- z4 J m, `7 ] move into pickaisle.induct2$ H% y2 D; m8 D
while A_i<=30 do begin
% G- ]5 W$ {* Z9 Q! m travel to pickaisle.con(A_i)
$ |5 K/ g8 s+ t- G' ~3 u0 f' n4 ^# f7 E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& g2 y$ f. v/ V6 [: j @0 s
else wait for 10 sec4 j$ Z) w( m6 t& E; C1 ]. f7 x
if A_i=A_leave then send to die6 F6 w% N; ^% |3 ~: I; Z& Q
else inc A_i by 1
1 `: M( q/ \: i; f$ ` end) a$ W' T+ E/ J: V. w$ a8 I
end# m; r+ B& d1 C4 S+ J# i, ^
1 Y8 u* I$ p- b; W: i _) N: X6 a5 I
begin P_pick3 arriving
9 V1 F& I8 L0 Y( a& W set A_i to 21" \7 X% ^$ D% I: ` K; I" U; q
move into Q_induct3
: p7 b; ~& k; j# ~1 _ G move into pickaisle.induct3- Z E* l+ f* \0 g. B1 u
while A_i<=30 do begin4 x* u$ u0 a# f9 ^$ L: Y! z( L9 \
travel to pickaisle.con(A_i). B5 u4 O+ P# b" Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ?& H! F3 [% }! k4 Y# Q5 B else wait for 10 sec
5 J5 t6 g; s( Y8 W7 l+ J1 N if A_i=A_leave then send to die2 J, K( H, B( J, C
else inc A_i by 1
, A9 V! }, }& l) B5 y+ x' ] end2 @$ k# B# q2 Q
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,其它按你的 ...
|