|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- L5 v7 V4 l# u3 o5 f% D/ u
& b1 V/ f# P r# v/ h0 p/ S- G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; A. L: J& h9 ^& S0 ^ T9 H8 A# }/ u. b2 x
begin P_read arriving9 D4 i e+ z) z% A: U0 R7 ^" l
while 1=1 do begin
/ k7 U& \7 S- P( B; J+ {; H9 n4 k read A_tote from "data.txt" with delimiter "\n"
/ v; M; t i( p) S/ Z9 \8 n read A_time from "data.txt" with delimiter "\n"& S% D4 d( O3 M. t1 M2 T
read A_leave from "data.txt" with delimiter "\n"3 Q) S) t% D, g T5 B; v7 A* @
read A_picks from "data.txt" with delimiter "\n"3 n, B; v/ R7 y' ]* @& p6 P
set load type to A_tote
7 @: C. w: h( w L6 v+ J if A_tote="tote 1" then set A_induct to 16 D! T% _" J( a( Y* M. [: w
else if A_tote="tote 2" then set A_induct to 2
3 S8 C3 i! e4 T2 T else set A_induct to 3 6 h% K9 B- b! M, Z
set A_i to 01 O: l+ z+ o! D
clone 1 load to P_induction* ]( F+ r( }7 O1 p& J+ F
wait for A_time sec) ~% s: b2 q6 a& X
end6 K4 x' t( m4 [$ Y m3 U, W
end
( T. M: @# z3 Q. S$ a& d ?
- R6 g' S( _5 u8 q G, `* S4 wbegin P_induction arriving
5 e) }3 g0 q; M6 w) ~. s0 U9 W if A_induct=1 then clone 1 load to P_pick1
5 i* G4 C9 c1 r& u3 z) ?! z else if A_induct=2 then clone 1 load to P_pick2
3 {8 W# F0 r* i+ R/ x else clone 1 load to P_pick3* a; a9 z% N, P* E
end; u/ g& W N3 O3 q; x
& M# d" }! w4 |( | nbegin P_pick1 arriving
1 T8 X8 v# Q2 E( C set A_i to 1
* C" S3 i' a2 L# q4 w& H move into Q_induct1% C; e( {8 r7 d* x7 F2 i/ b2 ^
move into pickaisle.induct18 Q; b) k: a5 Q5 T F$ ~
while A_i<=30 do begin
/ @2 v, J3 r' r/ q& H travel to pickaisle.con(A_i)
( y5 O; x5 u6 a/ P6 F* M; @0 S- R* ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: P0 g1 e2 Z7 b3 L- S n
else wait for 10 sec2 ]) {1 x4 l/ d
if A_i=A_leave then send to die' o. h$ J$ x$ ?2 Z
else inc A_i by 1+ m7 B5 } r8 w8 I& L" q* `
end
: L- H5 m! y& U2 d; @! G$ q kend; s1 V! D4 D. f; B, U9 H( R
0 |! O# Q: u# N1 b- S
begin P_pick2 arriving
4 c$ [8 [ x! h9 v2 V: }3 ?5 \ set A_i to 11
" I3 E8 n3 I2 ~1 v+ L" X3 I move into Q_induct2- q' g7 A7 c! d( l
move into pickaisle.induct2$ z9 d' y. |" Q
while A_i<=30 do begin7 ^8 @6 M; w, h6 z/ @
travel to pickaisle.con(A_i)
V& ?) c$ M9 u* V+ X: ?8 Q7 ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) M- R- _' d. X6 x, S else wait for 10 sec
8 ?! M7 }, z8 w8 x& d if A_i=A_leave then send to die
4 e4 m) g# {1 X else inc A_i by 12 i! R" p2 N$ Y9 V* y8 C1 \3 D
end
- L" M1 W7 z" C" Q0 d) send
/ o: e- t. f0 D- D* I. C$ p
2 y3 Q* i. w1 F. u" m U! Ubegin P_pick3 arriving3 G/ K' P8 ~. @+ q% |1 K5 v
set A_i to 21% E( s) B! k5 T/ Q N2 r. J# \
move into Q_induct3
9 H1 Y( `: U, B0 x8 T G. Q |5 v move into pickaisle.induct3 c8 G, I8 J) \4 U1 i8 V
while A_i<=30 do begin" ]( y) ^6 t' U+ ^
travel to pickaisle.con(A_i)5 X) a3 S5 b% p) _3 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 V, ` F! q/ l2 H- } i1 v6 G
else wait for 10 sec
$ u. ]" k& ^5 A6 E, `* a2 Z5 M if A_i=A_leave then send to die
0 C1 V9 v" R; @- w+ H5 \4 Z# F else inc A_i by 1
( U& d- u w" |( _$ x% l; b E/ _ end* Q O, d2 e* Y' |& b, Y: |4 E5 e
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,其它按你的 ...
|