|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ W! w1 K2 l% L8 h
$ l' z% d( ]0 [5 |我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" ~& T! ~2 i- ?! T) g2 I* d9 g9 Y' V6 l6 C+ J# o. L# G' B" t9 k
begin P_read arriving
( W/ c% D" A- j0 G5 W while 1=1 do begin0 i- k* c4 k4 `# F z$ M
read A_tote from "data.txt" with delimiter "\n"* L! o3 }) r& T" e+ _2 k' S
read A_time from "data.txt" with delimiter "\n"* t! {* |" b1 P
read A_leave from "data.txt" with delimiter "\n"
7 J& v/ u2 _( Z+ m( K" |- m; m read A_picks from "data.txt" with delimiter "\n"9 O; R) ]' b" L% e: X7 r& h
set load type to A_tote
/ }) \- k! P, V3 A |) u if A_tote="tote 1" then set A_induct to 1
- \2 { d: Q ?8 |" U else if A_tote="tote 2" then set A_induct to 2
, p4 H. \8 u; _# e- }& g" K else set A_induct to 3
( q! q7 a( K1 @4 L" L" L" g: g set A_i to 0
q' e8 n" r' R p; B6 n& W/ c& Q: q clone 1 load to P_induction
# D9 I0 N) h8 k% Q7 r. v wait for A_time sec' e9 J- J; l7 D. U
end
) W: C: u9 @+ ]- M$ `, hend
6 A/ z( o' p X" _+ ^' U7 \6 }
% y% l; i* d5 v5 P& N; G* }begin P_induction arriving2 h, W5 @* c/ L9 ]5 v; \6 B
if A_induct=1 then clone 1 load to P_pick1
/ |2 O' g% z8 q8 z else if A_induct=2 then clone 1 load to P_pick2
/ O" Y! @# f# q) q- r else clone 1 load to P_pick3
K' L: G* m2 Q2 h+ {0 z/ C) t% t0 uend9 m4 j' {/ s9 i" Y- p, n, w3 L
0 Q: \3 i$ u( y. _$ k4 r7 b
begin P_pick1 arriving
& D9 \5 H* v' X( u8 h set A_i to 1
* Q* i, k2 T* m) D; {0 ? move into Q_induct1
% f) q5 ]+ G5 q3 p. f) r4 m1 [ move into pickaisle.induct1
) f, \$ n; b. o( F4 }- o while A_i<=30 do begin9 {' }% D2 H; o$ A) k% g2 d* W
travel to pickaisle.con(A_i)
1 o1 M4 L6 J$ o! c6 Z, ~- v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* j Q( V; C! V& h. N3 K+ Z else wait for 10 sec
# j% j% A" e* ?" v' |+ _3 L5 `, M if A_i=A_leave then send to die
?4 o8 @2 m8 l1 o9 n7 @' J3 c* B else inc A_i by 1
! L+ U4 H9 U8 w4 ~& _+ O2 d end
' c" N8 W" _# P% _end
3 R+ n3 K* w1 o L: r
* G! o$ t' o: \" J- |2 [- [begin P_pick2 arriving
% z( W1 h9 ^2 i+ f set A_i to 11
# W( A/ p: _# C% R0 i move into Q_induct2
5 W+ E2 z, [/ a7 S5 n, A move into pickaisle.induct2
( ~ @" R, x' w* U while A_i<=30 do begin! n; A9 [3 f# Y/ G9 v8 X, g
travel to pickaisle.con(A_i)
6 J" l7 z; D! u2 x3 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ y, R& m) ^) S* t" Y
else wait for 10 sec
" r: u) e/ m1 e2 D- j- I if A_i=A_leave then send to die
3 a! c( z! D2 L5 X: { else inc A_i by 1; |! E# k" Q9 ^/ E& M; i' Q3 Z
end
: q. C; `/ g9 p% J4 C9 p+ Kend
3 @( W/ C. X& ^* S8 x ]& i2 { q% f( M* {/ a( H
begin P_pick3 arriving! X2 Z( ~7 E" G3 B4 b! `
set A_i to 21
' _5 z, e9 U# X, h3 c R. Z8 \ move into Q_induct34 j' c6 X1 E: G+ Y! u z+ t! o
move into pickaisle.induct3
: Y, s+ K$ ^8 h+ L( @ E while A_i<=30 do begin/ r8 n( B4 n y+ b1 @) N
travel to pickaisle.con(A_i)
) I& ?: V- J- R [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q8 a9 o6 |% Y X0 x7 U' c& p else wait for 10 sec X! X4 _ x0 }/ J* P" y: Q
if A_i=A_leave then send to die4 H. r+ s, R& i* D
else inc A_i by 1
0 Y# b4 U* _ {- L end' _. Q( Q! a' ~; u, |: t& 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,其它按你的 ...
|