|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 v: e s6 {1 D$ s' x7 Z0 W8 Y' n6 I5 M# {5 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# f8 y! W5 Z/ r; P/ v' \& j5 n+ x
& D6 h/ E0 `! h7 vbegin P_read arriving/ U# f3 P9 d% W6 j: s( `
while 1=1 do begin
7 d0 H5 ]4 ?- I+ g7 G) V7 k1 ? read A_tote from "data.txt" with delimiter "\n"' S1 J! i1 }9 Q/ ~
read A_time from "data.txt" with delimiter "\n"
' C" t4 _9 F& f" _4 a: o9 a read A_leave from "data.txt" with delimiter "\n"
; m3 R; t# L9 M3 d0 ?- `9 M. g read A_picks from "data.txt" with delimiter "\n": `# A2 Q9 O9 ?7 [( M3 W$ C
set load type to A_tote$ x d" {/ {2 l6 q2 e+ d& d2 }
if A_tote="tote 1" then set A_induct to 1' i4 [. m# r6 l B
else if A_tote="tote 2" then set A_induct to 2
( s( f0 G5 D0 H5 E1 S7 \# K else set A_induct to 3 6 u1 {1 `4 F1 p- Y; @4 c6 J3 M
set A_i to 0) Q* b. n9 N8 z% O, n
clone 1 load to P_induction
# L! P1 U$ O1 ~5 c+ ~ wait for A_time sec
) i. X: p1 x- a& y6 i end
4 D/ m6 S3 C" d: ]end8 X' L" r& d; B3 d, d
1 ^4 H2 ~% K( `& `begin P_induction arriving4 c, r3 [& F& ?3 Q; f& v1 }( i
if A_induct=1 then clone 1 load to P_pick15 k3 t0 M" V5 c. N! Q2 z& B
else if A_induct=2 then clone 1 load to P_pick2( |0 b6 ] @- [1 E N
else clone 1 load to P_pick3
" _7 E5 _( i9 P; I2 w: i: Rend' {( M+ _1 P3 ?5 X+ Y+ P% d( e
, k& ], B( h4 @# u& t8 S" y7 _* abegin P_pick1 arriving# `# ~3 O6 B1 ^
set A_i to 1
. M7 d- E2 l0 g1 P. b% z" N move into Q_induct1# s& @7 W" m0 }$ F/ ]1 c0 H
move into pickaisle.induct1
& C+ `+ d) t$ j- Z+ Z& Q while A_i<=30 do begin5 L" r3 `' c1 T5 \+ h, S
travel to pickaisle.con(A_i) ]( B. b$ P: L/ A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& W" B, ?# z' S9 C+ w v
else wait for 10 sec
" ~( }! _1 z. N0 }; Y+ y if A_i=A_leave then send to die8 ? j' }% O" z* _$ D8 b
else inc A_i by 1
% E; A0 x5 |$ {/ N- n9 @ end
4 n# Y [5 {: s9 O p' F1 M3 `end2 j) i9 A5 \8 u
. k3 j5 {/ ^ [" s2 Zbegin P_pick2 arriving
8 q$ V; w; g* ~ set A_i to 11% v( R( f% T+ s5 A" U% N+ M
move into Q_induct2
- S" M# M) d$ e+ G6 _/ j move into pickaisle.induct28 P7 X" ?9 S1 ?" N
while A_i<=30 do begin
/ [; f4 W( w/ t+ o) I0 ~ travel to pickaisle.con(A_i)
( [4 L1 R( B7 z! ?% G( D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ~( {7 i" b6 s% m6 H8 Y8 C9 ?
else wait for 10 sec
9 @+ |. G# |* t0 ~/ b7 C1 _' ? if A_i=A_leave then send to die) a s, t B* @. s3 ~4 z
else inc A_i by 1
! o* |4 \& Y3 K4 d& b4 u end
! m! D( G! m1 Y3 e0 I/ s( m7 _- w7 Aend
! V+ I) i$ N* j7 i: i- f
3 X" x( E. D+ Fbegin P_pick3 arriving$ A) R3 |: [. u8 h7 l: o
set A_i to 21
' j. D( e; X# a0 } move into Q_induct3
" S- b8 X9 T7 s+ l d9 | move into pickaisle.induct3
; q9 |% j! t9 o8 k+ z- [8 N) k while A_i<=30 do begin5 \: }: w% y Z, Z! Z9 P
travel to pickaisle.con(A_i)) ~. I2 b, a1 `' C% }* e3 Z. Q' b) J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 T: m1 J2 D5 W, o8 B+ m* m else wait for 10 sec7 e$ z$ u2 ]) f D* _
if A_i=A_leave then send to die
6 A7 G" G& Y& |& W1 H else inc A_i by 1
! U5 w t( j, B8 d end4 w9 z8 N% [. c j' h) I# X, T
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,其它按你的 ...
|