|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ W+ u2 ^! s- }7 G* n- K
9 e8 n7 H( I0 z+ n/ M+ V& F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% v& M6 z, R5 f$ c b0 a
- |7 K ?0 \* \! L3 Ubegin P_read arriving1 T* X% r# ^. v
while 1=1 do begin
3 _; ]/ \" _& S! _. s! h read A_tote from "data.txt" with delimiter "\n"
9 m7 o5 `- l/ o$ W read A_time from "data.txt" with delimiter "\n"# Y$ k* d+ s1 X5 ~/ ~2 U& ^
read A_leave from "data.txt" with delimiter "\n"* K( _9 i6 f6 l% _3 b$ L* n! _
read A_picks from "data.txt" with delimiter "\n"
$ `( k3 B* y! | set load type to A_tote3 Y: Y2 K% ]$ d7 {
if A_tote="tote 1" then set A_induct to 1. C5 G( Y' m) |' r( ~
else if A_tote="tote 2" then set A_induct to 2 t% U& M& Z, L6 x3 _* s' R
else set A_induct to 3
& Z' _) r# D; A9 ~' l* W set A_i to 0' s% D# @3 ]# b+ t1 F& e/ ?' O& j
clone 1 load to P_induction X9 ^: ~% G g1 T3 @1 r
wait for A_time sec4 }- K& Z" y" t# C) Q
end
: l* S9 H, G7 [$ k, n2 b% z- u9 mend
# C( U" n7 w- W" C7 d U2 d) C9 o& j0 {2 x
begin P_induction arriving! l8 Z$ x* {6 x
if A_induct=1 then clone 1 load to P_pick10 _4 J9 W3 g, u( b! ^8 q& _2 k
else if A_induct=2 then clone 1 load to P_pick27 h Y: h9 Z2 D3 ^2 j1 d% Q, P
else clone 1 load to P_pick3
/ y, ]) T, `) [; Q" p6 {end
$ m; @3 H& P% R _
6 L9 ]# H" @0 s; sbegin P_pick1 arriving
4 Q) D, r# ]& G( F$ \5 w set A_i to 1% U! X3 A8 Y1 W% r5 L
move into Q_induct1$ U- ~5 Z" L- e; }" f; H }
move into pickaisle.induct1( \. @) h7 I" Q% u
while A_i<=30 do begin3 J1 j) _- T, K$ \! B/ J+ Z' l
travel to pickaisle.con(A_i)
* Y6 @5 C4 n3 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 |0 S1 t6 L" \: |5 @7 g else wait for 10 sec+ u6 K( c2 A' v$ j, y
if A_i=A_leave then send to die4 ~ V9 d" x+ h+ {0 N6 u$ Q
else inc A_i by 1' i9 l- F& f4 g" z( F( A
end7 l$ k' P, R* v$ I" L) l
end! H" h$ b( m; K( @, R i: E
7 K$ h1 |, J, F! Q# S# S
begin P_pick2 arriving
( P5 i5 n# v2 E set A_i to 115 K' H/ K1 m: Z' [; E X5 I4 f
move into Q_induct2
0 `2 ], b" D+ O move into pickaisle.induct2
: l0 x# G3 ?" ^+ v while A_i<=30 do begin0 [" C8 T* j6 |4 E, b6 r& y5 ]. f
travel to pickaisle.con(A_i)7 i' F5 T% s) m S/ ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 r. |7 F: x" T* r! m
else wait for 10 sec
! d8 l4 c9 ^4 A0 V( w2 U- F2 i if A_i=A_leave then send to die
! ^/ f" l7 r% U+ L- a* l+ c else inc A_i by 1
1 K4 \- ]* c' U$ v; J$ ~! { end/ a k: K1 G I
end9 g* c2 E- P8 X: m( ^1 L; u
$ B2 |' }5 p& d0 j2 P7 k2 ?" h
begin P_pick3 arriving
* Q, p# G8 Z6 b" Y# ~/ o8 x+ w set A_i to 21
+ Q0 F" V. o: o2 e move into Q_induct3
# k1 N1 `0 E5 j* D; m$ u# D; c! [ move into pickaisle.induct3) E0 M2 L$ Q( f+ z0 D
while A_i<=30 do begin
6 n7 x$ q/ N8 n& d5 P travel to pickaisle.con(A_i)1 v) H, n* w' m3 |' r* f- V: _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( i$ p* v" P( p+ u) j6 B% ?6 b else wait for 10 sec
1 k: t' s, ~9 K& P1 g if A_i=A_leave then send to die! g: c9 s$ b+ i; @5 p4 A: z
else inc A_i by 1$ H- S: r! H0 b7 s8 d/ K
end
) v4 Z- z- g9 T3 I z7 Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|