|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& K- G* V6 H! b; d
0 J& C) b" D- _
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 G2 E6 u, M1 k9 ]' w, {4 H* Z& F4 W% e( S0 y
begin P_read arriving9 Z6 Q; P6 j* o9 j' w' C1 D, F
while 1=1 do begin# h; J6 C3 D7 z3 S' i0 d1 v7 B1 G# G% f
read A_tote from "data.txt" with delimiter "\n"0 G, o$ P$ X i# q+ A9 K
read A_time from "data.txt" with delimiter "\n"
; t0 }2 _7 y8 R( v) M9 N; I ]( i read A_leave from "data.txt" with delimiter "\n"& U2 w7 o; D; O/ P, t1 b$ v
read A_picks from "data.txt" with delimiter "\n"
, ]- V6 ^+ t: g& m6 F. z3 g2 _ set load type to A_tote
' z! Z6 _5 T) N7 V) P if A_tote="tote 1" then set A_induct to 1" b4 w/ g1 c/ h# E7 e, x; {) `0 z
else if A_tote="tote 2" then set A_induct to 2" k5 Z) q7 N7 j, U7 g& ^3 ^/ X
else set A_induct to 3
! Y7 W* g D+ E& M9 ~ set A_i to 0$ r# G9 k, t0 |
clone 1 load to P_induction
# M' V, s' }5 p. O6 I/ M" ?& H* ^ wait for A_time sec2 e1 I! ], Z$ N1 r, s
end
' `$ r9 V% y c' b' _end. q/ t2 y3 g1 j' f
/ A6 A) z. `* N# {begin P_induction arriving
, G ^; T- `7 B5 J2 K if A_induct=1 then clone 1 load to P_pick1
* z; z5 E" [. {. i3 t2 F else if A_induct=2 then clone 1 load to P_pick2
+ f& D8 f; w! e4 s else clone 1 load to P_pick3
: j, h: m4 p9 S1 b/ s! Yend- X& Y) l9 e& @1 R# G7 o
# b4 ?& f) B" f4 L5 h
begin P_pick1 arriving
3 Y9 n% u3 p! F$ P. q$ v" k set A_i to 1) ?- K9 t# F8 l3 p- r
move into Q_induct1
6 P3 L5 E" V- D) m6 C( r move into pickaisle.induct1
5 B! M5 A8 K1 [* f, y1 ~" T while A_i<=30 do begin8 T0 g( D2 U' m8 e- [% Q# L
travel to pickaisle.con(A_i)
& O- [$ O* e( T' j7 g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) S5 B2 P" \4 q5 |0 l else wait for 10 sec+ w5 [" Q8 C9 n: M* e
if A_i=A_leave then send to die9 o$ p8 q2 F' n% ?, w
else inc A_i by 12 D+ Z+ V7 F: k" R! V9 W
end
2 L% w6 a. m) H$ ]4 Z2 c0 Yend
+ M1 |- p8 `4 C0 c
: F) A4 `! h, N- i S: R& }begin P_pick2 arriving
; ?3 ~" |% g( W, F5 k set A_i to 11
0 l3 v4 H& |5 _3 X6 U move into Q_induct2
/ Y, f! P% B ^7 w( O move into pickaisle.induct2
3 p( M k. ~7 X( X# ?7 L$ _ while A_i<=30 do begin$ \, K, M6 W }8 t4 ~. U
travel to pickaisle.con(A_i)
: b$ q4 A( h5 ?) I; i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 N& q4 B$ c- U# w9 S4 \; R4 w) s, { else wait for 10 sec: K2 O# u! ?& {. ?3 `: i8 s
if A_i=A_leave then send to die5 h y d' p3 N
else inc A_i by 1
_3 |% n( t6 N; D. k7 Q( x7 \# B end6 a9 f" D, o1 Z; I
end- y U. N+ \5 i) Y; E
% o$ |( k' ~9 u
begin P_pick3 arriving9 v7 C" ?) }8 s) k/ k" ]9 v
set A_i to 21 j- L6 e x; Q. K: l
move into Q_induct34 f0 k; n% T5 o
move into pickaisle.induct3
# W2 E8 N8 p$ H( m" d while A_i<=30 do begin
" \+ p/ _8 D$ l6 j travel to pickaisle.con(A_i)! q8 I/ o( I2 t- Y4 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D3 l. y) ~' h0 r2 q, {# V
else wait for 10 sec9 K7 f* u6 c# h* s+ j6 y; N4 T
if A_i=A_leave then send to die
( c9 X `: W7 Z5 j else inc A_i by 1$ f$ E3 H0 d( J2 `7 {
end: U, g- j. L- ?" m+ u1 K4 n2 \; E
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,其它按你的 ...
|