|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 g( l) f) U2 t' Y9 }! A( E' e, |. B* l% |1 r+ k5 x u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 W2 ]% r8 `7 C' F' T: B: @" ~' J
5 V6 f- c6 {2 Z! O. Z
begin P_read arriving
5 r1 y4 a0 ?2 F6 B. C+ x while 1=1 do begin
^# O9 J& s% n( Y& s* M( B read A_tote from "data.txt" with delimiter "\n"
6 z! B/ q7 O. S0 ]8 k$ w; o2 F3 q read A_time from "data.txt" with delimiter "\n"
- k. B- n3 F U1 k% k read A_leave from "data.txt" with delimiter "\n"
4 C' D$ g7 ]; f. t read A_picks from "data.txt" with delimiter "\n"
' F/ h i) f. I, k6 \/ y( }" h set load type to A_tote
0 M! g& N7 R; b% F f( E6 u. y; t if A_tote="tote 1" then set A_induct to 1
( B* R, S$ F ], D else if A_tote="tote 2" then set A_induct to 2
! ?% X4 t& c6 l% C# N: r, [2 | else set A_induct to 3 ?+ ^4 V! P, V. z' g: l
set A_i to 0, k7 r3 A0 D* ]# a
clone 1 load to P_induction
% D( M" H' A! d5 r wait for A_time sec- x0 I% z; S* Z' J
end
( l" t, S; u: Z" Z; B* \end, i8 Z8 p: P: K. Q4 B
5 @- b3 y/ R' V" e
begin P_induction arriving
$ Z) c; G- C) a; L6 n if A_induct=1 then clone 1 load to P_pick1
; h8 K4 \+ @( o! c U* K4 f O" C else if A_induct=2 then clone 1 load to P_pick25 M. q- H0 H( | ` r& h2 O
else clone 1 load to P_pick35 }& N/ H3 Z6 A8 K) c6 i A' `
end) K+ n$ |% `9 G1 w
k" p, R9 k Qbegin P_pick1 arriving& _% u2 l+ |0 t3 i' v2 _" S4 t
set A_i to 10 ?4 D% t8 ~' m" F- l. `# s
move into Q_induct1
$ p. s M- b) j1 R6 ` move into pickaisle.induct18 |; U6 b9 [& M: U$ B$ G
while A_i<=30 do begin
, Y$ c2 I; A/ }( m* w) z travel to pickaisle.con(A_i)
; f4 p; l$ R& V- |( |2 p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 X" N. K4 t9 k4 w else wait for 10 sec. ?( T) L9 Q. N" J' i8 q% D; ^2 e
if A_i=A_leave then send to die8 b0 s( J, t% a2 N
else inc A_i by 1! [# _+ P( P' h6 v/ v+ L; n1 V! x
end
b: | }0 g {" v+ C7 t; p rend4 b1 `, f* O Y3 r; I
1 v7 N0 A4 d, q2 bbegin P_pick2 arriving& M1 R" Z7 u m6 v' B. }
set A_i to 117 w- ~) u: c* J' q5 k
move into Q_induct2
- z; s6 C+ _- A move into pickaisle.induct2/ S! W3 F% q2 _, B/ ?: p; O& ^
while A_i<=30 do begin
6 V0 x0 J x+ u% s6 W travel to pickaisle.con(A_i)
; s1 f( t- v6 B! R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ b% t' D9 k4 U! S8 S0 O8 c! d else wait for 10 sec
% H1 r; K3 c2 U0 N0 ~ if A_i=A_leave then send to die* Y. ^1 t* c5 o% a+ w
else inc A_i by 1
6 c5 b9 c3 {# Q% e1 p" D) Q- g end" Q" o; t8 N4 i7 x
end
( J. q8 P- @: V7 R/ [, K5 O c$ Y/ z! V* `5 j d1 x5 I
begin P_pick3 arriving
6 `3 [+ F/ W/ m; u set A_i to 213 y3 L, p, ], G3 j) N
move into Q_induct3
8 M; j+ I. d+ J+ ?& G move into pickaisle.induct3. v- Q; W0 l; g0 o, `
while A_i<=30 do begin3 X! O% Z/ x! |: U) o3 ?% b
travel to pickaisle.con(A_i)' s% W/ G. S5 B7 t1 L3 s6 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 B, R8 t4 H2 I else wait for 10 sec
- [( c" M Y6 S+ d if A_i=A_leave then send to die, ]4 J1 e7 C, V8 M& W
else inc A_i by 1$ }' N1 z2 x1 |- W
end
- t# B \/ 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,其它按你的 ...
|