|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% k7 X) H' g5 C
( ^) l5 ~. V% H我的问题是,在每个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" b9 A0 t; F" J+ A
+ z+ h3 b" I- z, ]1 e) l0 Wbegin P_read arriving* g1 |& Y v0 G6 B- p
while 1=1 do begin; E' t% q5 ~* I6 O* `0 B
read A_tote from "data.txt" with delimiter "\n"% [# S. C ~3 a
read A_time from "data.txt" with delimiter "\n"
R' O: w* d5 Q: O. d4 D2 h read A_leave from "data.txt" with delimiter "\n"- L& V/ U4 R9 t7 k( v
read A_picks from "data.txt" with delimiter "\n"
H6 d9 _. |% w set load type to A_tote g* J4 j' Y) N" I% F
if A_tote="tote 1" then set A_induct to 1 {* C }4 K7 A/ S- z( c9 V6 a% B
else if A_tote="tote 2" then set A_induct to 26 R4 `) C/ a. A5 ^5 |9 U) w
else set A_induct to 3
- a* M( P r$ T2 x# c0 S set A_i to 0
5 \1 T/ K8 ?3 ?# }6 F7 F0 J clone 1 load to P_induction* G o* {/ [. Y; H# T+ \
wait for A_time sec. Q5 n8 P7 u1 p: M5 x% O
end
& U: V5 r ?2 qend
! O: h5 w: K' U' a# V; N! v0 W: M1 X9 R: v A" x
begin P_induction arriving. M# e- \/ s* C9 z( |' \/ p2 X
if A_induct=1 then clone 1 load to P_pick1
% g, i x6 |8 w% H8 ? else if A_induct=2 then clone 1 load to P_pick2
- ]0 c! K/ h$ T5 M3 C# D6 G else clone 1 load to P_pick3# y9 b3 T$ M1 P- L: }
end
! D* h! q* ]+ a5 n9 h) t9 i; h! o. i6 [& ]4 ~5 S2 V: H6 g" v
begin P_pick1 arriving+ [. g' g b' A# \& \+ u
set A_i to 1& K* v. d' d) K! G- {2 l3 P0 _
move into Q_induct1$ O2 m% N7 c; @( [7 S+ y& k
move into pickaisle.induct1# L* v( V. F% ]6 F' p
while A_i<=30 do begin
$ k% S7 Q! o2 H0 D5 _& { travel to pickaisle.con(A_i)' Z; ?% V7 C- J3 e6 n$ [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 L- F1 k% B; F) Z' J7 m3 l else wait for 10 sec
! ]" R* ~# w; q/ _ if A_i=A_leave then send to die
3 O; n5 k$ [$ f else inc A_i by 1
/ Y) Y8 q: @( g' w! _5 R } end7 T8 x2 v( l1 P) I s# ^$ P' ^. V
end
" ~; B* q; t" R, Z8 j7 x4 @0 p l% y1 a d3 `1 K* @
begin P_pick2 arriving
/ o( c# k$ C: t( [+ b set A_i to 111 L. ?: d- [- d, K0 x8 }
move into Q_induct2( \& t% Z$ y* D& n6 O& _+ z
move into pickaisle.induct2
$ w" i2 Z& O. i& S; w while A_i<=30 do begin* K) x2 f/ F6 `4 t- n6 z
travel to pickaisle.con(A_i)
% Y2 ]! B' H' k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ M3 L) p, O0 D& P1 b B else wait for 10 sec0 S8 b3 J: \! i8 P2 K
if A_i=A_leave then send to die9 y* F% V* X& E
else inc A_i by 1
1 |/ u' i% n7 k4 h, h3 H: ?4 `$ i; L end
4 |0 Y' }9 J9 t+ t6 }' H+ l! iend
[' f/ s* i& K0 K0 v9 F. P( C
, x9 q2 b/ ?8 w" ebegin P_pick3 arriving
6 D! b3 O2 K# \, H% W0 e* ^3 | set A_i to 21) @2 ^% Q9 b5 N; H# b" e! |7 H
move into Q_induct3. W$ W/ V' o4 p4 m7 i" y' O; T, C
move into pickaisle.induct3+ M5 B2 w8 F/ d
while A_i<=30 do begin
4 L5 {. r8 m5 }. ]0 I. x# H! M: w1 I travel to pickaisle.con(A_i)
: C$ K8 t) a. e& ]+ E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ~! q! j, O) W( a* G else wait for 10 sec6 x3 a( T& q! {6 ^- ^: [' o4 r3 ^
if A_i=A_leave then send to die9 B* x. I g0 ?. ^4 V, {# U* k6 v; t
else inc A_i by 1
- [5 X7 P9 v: v. ~ end* m1 h; ]+ ?% f
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,其它按你的 ...
|