|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" i! L6 `3 U8 f @* p& G: @1 T; Q i
5 a( c0 k5 R/ V; i我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ N; I. K- X" f; L6 P7 h4 R U- E
5 V$ c) D2 {6 w0 }
begin P_read arriving; b* q I& h$ H/ F) W: ]
while 1=1 do begin
0 a- i7 |4 \1 w2 s: B# L read A_tote from "data.txt" with delimiter "\n"0 X7 g; O! L, I2 W
read A_time from "data.txt" with delimiter "\n"
6 b* @* N& a6 W% n' o. m read A_leave from "data.txt" with delimiter "\n"
/ ^1 t, J! I4 h$ U0 R& x read A_picks from "data.txt" with delimiter "\n"
6 t$ ~. ?: A; |' B' \4 y6 O) h set load type to A_tote
% F' H6 b% m, T9 ]. E if A_tote="tote 1" then set A_induct to 10 L9 o/ a2 [7 c: A( D2 n8 x! r3 k* s+ F
else if A_tote="tote 2" then set A_induct to 2
' j% o% X! q$ o/ ?9 ~/ q7 q' E else set A_induct to 3 : T5 R; y9 }) N i
set A_i to 0
& z5 u: }- A2 y7 V- j T clone 1 load to P_induction* U m* @# B: X& t
wait for A_time sec! t9 f c0 @- a; @4 ^
end
1 ^; O# L" W0 m d4 p, C- S% Fend" u3 M: E9 ?8 M1 b0 v, y" [
C: s# O6 f3 B$ W7 {begin P_induction arriving
- q( h9 L6 S0 P, j- R$ I, ~4 V- I" O" n if A_induct=1 then clone 1 load to P_pick1
" m& G6 m# Q V2 k7 `0 o# ]1 A0 o else if A_induct=2 then clone 1 load to P_pick25 I7 S# X/ u7 D' H6 ]( R8 J
else clone 1 load to P_pick3
+ r' M6 G9 o7 \1 h2 a, \3 ?; J* |6 Rend
, ~9 N; u2 e2 z8 j: f
8 N0 v2 d3 B3 Q; ~begin P_pick1 arriving
! z/ b$ l+ E G# B set A_i to 1
3 Z7 y9 v+ ?9 s" P. K! M- L move into Q_induct1, f4 S& ]2 L. O; i
move into pickaisle.induct1
4 C k0 \- x% ^ while A_i<=30 do begin0 K" ~7 D. y6 L
travel to pickaisle.con(A_i)
8 D D4 V4 W: x& @* m: X* D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; l. x2 V2 V6 {' h2 d1 l
else wait for 10 sec; `4 [3 V. O3 }* s2 C$ B$ n
if A_i=A_leave then send to die/ r! C0 i1 X) d; C- u
else inc A_i by 1
5 z$ k# c% G9 l end) d: j. }1 v9 h! o: S) O5 m
end4 \- D% p, u3 L4 x
^+ M8 G# ~! Q
begin P_pick2 arriving N2 K5 t2 K- a/ c2 |3 F3 M% y
set A_i to 11
4 B7 w2 f+ `2 J7 k move into Q_induct2
' ~" a! x' ~7 S. ^ move into pickaisle.induct2+ Y8 u/ `" A, I- ~( e
while A_i<=30 do begin
& v# Z, a# I' h% N travel to pickaisle.con(A_i)
! h) Y6 t7 P( f# k. s/ R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, T6 x/ [# X+ x3 B2 I* \ else wait for 10 sec9 t& H- }$ {% c* n6 M7 d
if A_i=A_leave then send to die
, s- d5 t5 c& l# k& B. D. R else inc A_i by 1& y" |; `- }' V. i) n5 P
end9 `) b; L4 C1 U9 ^5 t
end( j% J0 P, y$ M; w
7 j- r. w, U" G2 Y
begin P_pick3 arriving
1 s; B3 P& r2 J( d1 d set A_i to 21
' H q0 n3 L H2 ?* R" z" |2 } move into Q_induct3& `2 }6 H! g% @. T ?
move into pickaisle.induct3
8 U3 Q& y' }" m; w2 k3 A4 u while A_i<=30 do begin n h/ w( N7 M
travel to pickaisle.con(A_i)* [7 ~) r2 ~& Y- d7 f, u- E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* s- G( O1 _3 S* c; D. q' n else wait for 10 sec2 y- B2 B3 X W5 m/ E* x G
if A_i=A_leave then send to die. Q8 T& D; E6 S* G
else inc A_i by 1
3 A4 ?9 E2 V. ^1 Q3 r% ] end: N; l ~) |6 ]4 \" ?
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,其它按你的 ...
|