|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. V+ e6 ]; S4 _
3 f9 e/ J3 J% ?; A% W我的问题是,在每个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中的数值,不知道会不会有什么不妥。; d6 S0 E6 c/ l; d0 x9 K: w" o
8 h) r( G: W& J: \5 W) jbegin P_read arriving! u" l) S+ m4 a
while 1=1 do begin
# n& |3 P0 P6 M( `: E8 y read A_tote from "data.txt" with delimiter "\n"
" n, _+ \8 P' @! Z/ i read A_time from "data.txt" with delimiter "\n"
6 g/ j0 ^ U! o! ?0 s1 _# I( J% J" ` read A_leave from "data.txt" with delimiter "\n"
0 L9 _. s, A5 E read A_picks from "data.txt" with delimiter "\n"
7 D) P; w# P5 ^9 g1 U set load type to A_tote+ S* z( T! |7 _. I5 P
if A_tote="tote 1" then set A_induct to 1
+ o9 i/ s6 r! h0 R else if A_tote="tote 2" then set A_induct to 2
" l( `4 |* W: t9 O* u' G( m else set A_induct to 3
1 p5 S9 i3 P( N- r% C; G& j: s set A_i to 0
; q* z3 ~" Q) e6 H2 O/ x% \& \ clone 1 load to P_induction
7 W8 o5 d) Y7 B9 X wait for A_time sec+ H* B" v% [$ x8 M
end9 J; b$ t' ^4 B2 y
end! i0 M2 a$ c1 q
) g6 {; i/ ?4 b- @( \& S9 B) d; X# n
begin P_induction arriving& i' j4 }" N9 d3 W6 z1 t& I
if A_induct=1 then clone 1 load to P_pick1
7 _: c2 l" }& Q. O6 P. i4 C else if A_induct=2 then clone 1 load to P_pick2
& e; X9 L4 T0 `* A5 d& O$ J else clone 1 load to P_pick3/ G1 u" b% ]( Z& J' L% p) U$ o
end4 X* \1 u) ^" {: b
1 W% V+ D3 B0 c. `1 I6 t `begin P_pick1 arriving6 }! m! p& Q, D
set A_i to 1' Q( R! [1 N! c
move into Q_induct1
9 c, @- g' q5 L move into pickaisle.induct1) I2 e q7 Q+ y" i+ H
while A_i<=30 do begin' R! E8 `# s. R7 a3 k# U
travel to pickaisle.con(A_i)
! u9 q% K6 T/ z ^. N2 k' f9 C* G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ q2 {7 w, e) R
else wait for 10 sec ?4 A) k7 t* b" W {+ a+ Z9 N
if A_i=A_leave then send to die' B b% I% d# ?; I% Y3 c$ W
else inc A_i by 18 x9 L/ `5 a$ \3 U8 x
end* t, n3 I! U) z1 z0 X4 `2 l) C
end
* P* r! U$ z1 I+ }9 n* z) N$ {( I3 W0 f* q5 F
begin P_pick2 arriving3 D7 |$ n8 {/ c _' y/ o
set A_i to 11
' O6 D' p. D: A) t. g move into Q_induct2
, K8 S' \' E' { move into pickaisle.induct2$ s1 p8 p$ A( a; W; E; L
while A_i<=30 do begin- S6 `1 E) x* ?* p+ N: E% C
travel to pickaisle.con(A_i)
) N0 H h2 f9 S% i- |/ M) q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% [* X b/ [4 V
else wait for 10 sec
/ y' p6 Z% K2 |& [# J1 u if A_i=A_leave then send to die
" d( Z5 e/ X3 d" @ else inc A_i by 1+ ]6 k H4 t1 r3 G) n; q
end
% Y D9 M$ p' @' c7 fend
0 V3 l2 X) \4 C; e" d: b8 P" t7 `: h9 Z/ R( a& a* y! d6 _+ x8 P
begin P_pick3 arriving
/ c, l' |2 |( C; h- e4 U( O. z3 L set A_i to 21
B9 u* _8 K, a4 w, ?* F n) Y move into Q_induct3+ |2 T/ J8 E+ m1 a$ F' f2 D
move into pickaisle.induct3
4 F: b/ W2 h' O) o, v1 A$ _5 g while A_i<=30 do begin& o& @" F" \& X/ I0 j0 y, Y& p
travel to pickaisle.con(A_i)* Y; M% Z7 p- \4 \+ F' X& i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ x/ v r+ D1 a9 F0 E else wait for 10 sec. U" | y1 e1 ?; z! J: I
if A_i=A_leave then send to die
1 [ w* W; C6 o6 J$ }8 l else inc A_i by 1
; B" Y( K1 \2 t: [3 E end# q' `( i5 l* U( p6 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,其它按你的 ...
|