|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ c8 p7 U, Q( q: a$ O
, J- L) m9 x5 m! ?& 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中的数值,不知道会不会有什么不妥。+ y3 @5 j9 e; ]. r3 `
! i( x( J' d( E2 Z4 C& l- h4 Y1 x3 ebegin P_read arriving2 v! _- ~+ Q& i6 ^# Q
while 1=1 do begin
7 i3 T% ~6 m( M% v( r. u" I read A_tote from "data.txt" with delimiter "\n"& C1 i5 n% P7 j8 ]& N
read A_time from "data.txt" with delimiter "\n"7 ^% T- z" a! @
read A_leave from "data.txt" with delimiter "\n"4 G9 d4 T7 K) ]: D3 q
read A_picks from "data.txt" with delimiter "\n"7 k5 {, d2 r9 \ J8 m2 E0 g) s
set load type to A_tote
! B; _1 m$ v: ^! h& i if A_tote="tote 1" then set A_induct to 16 K# t2 V5 a' B1 ~: A; A
else if A_tote="tote 2" then set A_induct to 2
; D" E; X+ a1 S7 F+ H% W9 S else set A_induct to 3
1 I; G/ {9 J5 p& b3 ~ set A_i to 0- }( A7 q# h- V, x% g- N4 A
clone 1 load to P_induction0 ?1 ~' L4 r' n- z3 b% x
wait for A_time sec
5 E9 f9 c% ~% X- x5 ~ end9 I( J d& R$ i9 v9 w
end' i* |3 @. ]" g: c% H% r
' Q& G( |. r& O' C& E3 P! abegin P_induction arriving I8 [) V2 S3 o+ y; l
if A_induct=1 then clone 1 load to P_pick1
8 g5 X% k n9 l else if A_induct=2 then clone 1 load to P_pick2
! ?5 D+ \ P0 C; } else clone 1 load to P_pick3! R. N( i6 T7 g( o+ |- z6 E( F3 K
end
! ]3 j: x g8 s* x9 R3 R8 [% P! }2 C' }( M
begin P_pick1 arriving) K0 A# W& z) z/ s5 O" J) z
set A_i to 1
% G T- i, K* ^) K- k% ? move into Q_induct1% I2 {7 Z: A( Z+ m" D) d% V
move into pickaisle.induct1
% o6 q2 I6 q0 o/ M while A_i<=30 do begin/ a. k( M5 q6 E# Z* u$ q! |
travel to pickaisle.con(A_i)8 c) A- K; C( s; M+ r2 B6 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! i% i. r3 H% w2 x* u! _8 o6 E" h
else wait for 10 sec* c p2 W- K% t5 N9 A1 X, Y
if A_i=A_leave then send to die
; s0 {- s4 p. J4 g$ t. }$ _ else inc A_i by 1
& m7 z& n1 l' s! v0 y9 U9 C: | end2 Q! E! t5 T- l% `8 f1 Q8 m8 u6 t* X
end
/ ?( n- Q7 @" r$ s/ F' P) S6 M2 U/ `5 w! J" V7 v+ V2 }
begin P_pick2 arriving
- N# `8 z0 ]8 z1 j set A_i to 116 M1 L$ Y3 j" H8 |) d( Y
move into Q_induct2. Z' E* V6 i3 z; ?$ F2 v
move into pickaisle.induct2( E) u2 p% `; f! ?
while A_i<=30 do begin
" K" J- a% d3 f# q! o travel to pickaisle.con(A_i)# `0 z* N' z# Q: ~7 ^; s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 w! e5 e& ^: v# d
else wait for 10 sec7 O6 ^: I7 E+ r* n6 Y( S- h
if A_i=A_leave then send to die
- P9 D4 ~" E8 S( X+ h& G1 a3 a else inc A_i by 1% g# e. H5 w$ h8 k
end
9 x( N( i# q; S% uend
3 R# K/ g- q4 }- b7 E+ l0 U! M- B- ~" o- }0 {
begin P_pick3 arriving
' B- z- C" m* L" K, s set A_i to 21
1 j h0 n9 w- K* d move into Q_induct3! a' X, B2 F% R$ O: F2 L
move into pickaisle.induct3
# T: U: b4 ~7 r6 \. r while A_i<=30 do begin
, v& c( x+ D# r) m2 r' w travel to pickaisle.con(A_i)
. a* f1 }4 `: }: | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 g8 l, y+ ? S' I
else wait for 10 sec+ O [, w( Z, q: J" `- z9 C
if A_i=A_leave then send to die6 P+ ?! j2 T( _& {, |
else inc A_i by 1
8 x' ]) _/ T% G B8 u end( A6 n# X! ]/ K) a
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,其它按你的 ...
|