|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 b% |( p6 T7 _: w
5 r" [1 w% v5 Z ]我的问题是,在每个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% U% K2 [, Z; m* O* U1 k
' T" a! @0 ~# G w7 Fbegin P_read arriving. o( P( N3 M" V5 r
while 1=1 do begin- I. A) a4 `+ x* h7 _
read A_tote from "data.txt" with delimiter "\n"4 B. j+ m+ A8 j7 q4 Z" B$ |# Y
read A_time from "data.txt" with delimiter "\n", q, p2 X8 l5 x1 J
read A_leave from "data.txt" with delimiter "\n"
e# c' W" b) f6 K0 P e read A_picks from "data.txt" with delimiter "\n"
, |3 V [+ i9 ~9 V0 F set load type to A_tote* D) |% ?8 ]8 r2 J! {
if A_tote="tote 1" then set A_induct to 1
[/ a1 r9 o2 M2 e2 [ else if A_tote="tote 2" then set A_induct to 2
1 ?4 h0 e& F5 Z+ \+ v else set A_induct to 3 - y/ g' O7 S. Z9 j j/ X
set A_i to 01 d( v( A0 q/ L) L L
clone 1 load to P_induction
' l7 t9 R' U/ K3 E w5 F wait for A_time sec
, [+ h/ Z: G8 i3 i( d end
' M0 C: Y: @+ J8 Fend
) {0 V* v3 ?% [) Y
$ K8 H+ [9 f1 abegin P_induction arriving
0 R0 E# Z& B4 R if A_induct=1 then clone 1 load to P_pick10 e* ^+ K/ g4 m3 I: [! Z1 V0 `# n8 z, K
else if A_induct=2 then clone 1 load to P_pick2
]3 T' F& e3 q! I+ l V3 K else clone 1 load to P_pick3
7 v) ^( X1 K. k. ?end
+ r/ D! T4 J2 T$ m( f( D/ _/ T$ j2 O/ X9 M
begin P_pick1 arriving
! V7 u* Q# N# P+ M' q q; b set A_i to 1
6 U- I3 G3 p* l9 S move into Q_induct1
/ ]3 h* L8 P4 o% y7 S move into pickaisle.induct1
! d) V" S1 O$ E7 p$ D7 y0 x, M while A_i<=30 do begin
" ^4 j$ s, @& _0 _/ ` G' R travel to pickaisle.con(A_i)9 }, L4 s7 w2 b6 j' Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 t9 G* ?- I6 @
else wait for 10 sec3 h. G# G& z8 O. ~- s' M& n3 r
if A_i=A_leave then send to die
: ?( h# C/ Y+ k- K else inc A_i by 1
: B+ y! ]7 l- A0 a end
% Q, x3 G8 D# r0 `4 t. ?3 y- Jend
S( ^- `1 C; I6 {! X6 W2 Q, v) p$ {% _8 }0 B: y7 s' o( K2 e
begin P_pick2 arriving' c! Z" E- p `. I
set A_i to 11
Y. G: w7 P2 A7 A8 O: b3 ^. A move into Q_induct2/ a5 y; ^4 J* a/ \& L
move into pickaisle.induct27 Z8 i6 e; @! u0 a2 ~) f
while A_i<=30 do begin
" _& M3 k0 F5 L6 z9 G3 W travel to pickaisle.con(A_i)) |) R1 F+ z( p9 _5 O, r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 h% U" w2 ~1 `! h9 p& Y# Y6 o
else wait for 10 sec
- m- r7 q; O0 r0 A if A_i=A_leave then send to die
/ z2 ]/ l+ Z2 [; G; q( u else inc A_i by 1
7 I! X/ c+ _+ [; r) t end) f R; F& y4 x. d+ Y! {" D/ A$ m
end
O1 P) _& c# F7 L
" }: d+ t$ T0 _- e1 @. ~begin P_pick3 arriving- t) }, K% A; `2 f9 ~
set A_i to 21 J) {2 a }$ l
move into Q_induct3 ]- r' m; |- J% O+ D
move into pickaisle.induct3( b; N0 R' F, y2 W/ b
while A_i<=30 do begin
* t, Q9 `0 y8 J2 I _ travel to pickaisle.con(A_i)7 r2 _) I& U! [1 c" ~$ t ^/ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P4 O. i. H+ A5 r: o ~8 P
else wait for 10 sec" L) H# o5 q8 s9 c! e) m$ N4 X, Q
if A_i=A_leave then send to die% W0 t" h4 m S9 L) \, C
else inc A_i by 1
9 v1 D- D6 m" J; H end e0 c- F. D/ d
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,其它按你的 ...
|