|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" g1 x' D# j9 T! J: H1 J- |% L4 X
$ N+ T. l) k/ E, V! U+ n: @我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 C5 A j2 X7 I9 g
( p8 S. Z9 J& x2 M' `+ D7 i, v
begin P_read arriving
' L$ h& ]8 b% ? ?6 j5 t( q while 1=1 do begin6 `" v; q% t% Q3 ]
read A_tote from "data.txt" with delimiter "\n"
5 F" r8 M( W4 `0 j% V( O read A_time from "data.txt" with delimiter "\n"6 f/ b& W. |# Q' [6 h) `
read A_leave from "data.txt" with delimiter "\n"
* {& `& o3 g0 K read A_picks from "data.txt" with delimiter "\n"$ }3 I' s, @- Z) K0 w
set load type to A_tote0 P" |2 E! t0 Q. t7 B2 b
if A_tote="tote 1" then set A_induct to 1. B1 N/ V" E% C0 l8 _
else if A_tote="tote 2" then set A_induct to 23 l( N; i. _. A+ {+ \9 U
else set A_induct to 3 ! e4 |1 v6 r. ^! d
set A_i to 0
6 Z; o5 f* u' G! G3 s clone 1 load to P_induction
& t2 u$ n) Z' S% k+ b wait for A_time sec1 S7 G9 }/ X) ^) V3 E! I
end0 S9 ], n, v* \! k9 G" b
end
# ~( L. a H: B2 R' D/ M5 I5 U: I5 Q8 j7 U z. a# L$ V
begin P_induction arriving
! z/ F- W. M: D* T4 K2 K% F if A_induct=1 then clone 1 load to P_pick1
) M! L; y5 R7 ~ else if A_induct=2 then clone 1 load to P_pick25 x7 R2 K% m9 ~" r% U+ ~+ b
else clone 1 load to P_pick3& ~' q1 O7 e M8 {: n0 D- Z
end
' j( h0 \8 H) j' k& C
6 _' s- g8 L# c" D; F( b4 s; pbegin P_pick1 arriving: @; z, D, y: m, d7 a# P- Y
set A_i to 1
2 d2 ]5 p' I, c5 V move into Q_induct1
" e+ l7 n/ H& R) q move into pickaisle.induct18 h& |0 @) ]% _: l8 p
while A_i<=30 do begin
1 R9 v6 d! O) d- N5 O, a' R travel to pickaisle.con(A_i) O( O& Z5 U2 R$ |% h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 s$ y$ ]6 h! z5 t o) r) `8 W' Z
else wait for 10 sec
+ ?& k9 L' D' [3 P4 I# g% r if A_i=A_leave then send to die
! X! K( n( w' T) t% {& v! ? else inc A_i by 1
: f( z4 Y: F7 Y6 _6 {, D end
1 G8 r( o V9 bend7 ~* }, V$ ]1 M. V" n5 J/ x
* O$ u) Q" \$ s, ~
begin P_pick2 arriving/ m2 p0 j/ ^/ C) u6 H0 f" u
set A_i to 11% @0 ~9 T, ~9 S# i
move into Q_induct2
" M; Q. z: f: |" c4 N) B, N& \9 b move into pickaisle.induct2+ ^- G. _2 D) O7 D' k
while A_i<=30 do begin% c# C- b/ ?8 c$ n
travel to pickaisle.con(A_i)
( k' `* y5 W P ^: u7 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" [/ w7 i# W1 c# ?1 O- v# W! R
else wait for 10 sec
* |& P! f1 g8 p: y0 N+ x if A_i=A_leave then send to die9 \; F [# I/ d4 y
else inc A_i by 1
+ j9 g5 W' V2 T5 l end
! n9 L' K% K) gend
8 ?: H1 z" o$ \+ n7 J+ D @; t9 X5 t. M8 k5 e1 M: N$ \
begin P_pick3 arriving' y7 \; v. H- \8 `
set A_i to 21( H: p! k$ L2 @9 d& F) ]( s, k9 s4 M
move into Q_induct3
8 C+ o3 C4 n" b" i( b4 R u) Q, D move into pickaisle.induct3
# d' f9 v# T1 K; U while A_i<=30 do begin
. H3 @+ A8 L1 C- q, U9 P+ i- w travel to pickaisle.con(A_i)
( s* N! t9 ` i4 J1 Q- q0 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; y3 l: f3 W3 J0 @) l+ F
else wait for 10 sec
5 N( L0 `" F) I2 p. t! D) X' s if A_i=A_leave then send to die
A/ y2 ?& ^9 q9 J4 q* W2 ] else inc A_i by 15 { l1 W1 a( W7 n$ w _+ y) N) \! E
end B8 f' w( P( U$ b) [, r' d" p
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,其它按你的 ...
|