|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 N" q" Z; S1 Z; k
$ g$ c% U: Y) s+ j4 X+ g: f: Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 W3 \: t2 a, H4 {/ I+ ?; I3 A5 m
( m* o" Z- x2 ]( X6 v
begin P_read arriving
4 k* F1 Q1 n* _' m) T F while 1=1 do begin; o5 O5 i& F( N6 N6 b
read A_tote from "data.txt" with delimiter "\n"
" F4 _/ k) ?4 z read A_time from "data.txt" with delimiter "\n"
/ I8 G/ @8 f0 i, X read A_leave from "data.txt" with delimiter "\n"7 ]/ r7 l$ L1 p) b% z8 U
read A_picks from "data.txt" with delimiter "\n"
3 T1 B0 k0 x5 r I set load type to A_tote; `5 H- ~, _0 O5 r Q
if A_tote="tote 1" then set A_induct to 1
r* R) n$ m( n3 g8 D else if A_tote="tote 2" then set A_induct to 2' h( f8 [* c3 x. o$ y8 O2 k4 N5 v H
else set A_induct to 3 ! F$ c: U, X1 _+ N7 k
set A_i to 0& \. n# @, ]/ D: n
clone 1 load to P_induction
, E$ j3 l/ j& c wait for A_time sec8 U4 I6 p: {- f% }
end
' h: j- r5 d, O P% V* F+ nend
% i- ~; P- W' s" `* A3 e. S* u" `/ D2 S6 b2 P: a8 G/ d
begin P_induction arriving
! E9 u# [0 |- b8 y, J if A_induct=1 then clone 1 load to P_pick1: o( O* `* b/ F: F
else if A_induct=2 then clone 1 load to P_pick2
8 G [3 ?9 m7 l2 K! d! I7 q5 C5 ~/ \ else clone 1 load to P_pick3
+ b7 ]$ d1 R* B: @4 B* M: ?end
8 g3 B/ r' V9 S+ r# X) b# F: H3 Y6 i& ]* ^( N
begin P_pick1 arriving' q% E9 H. m8 f A
set A_i to 18 n4 I. G5 z8 X J% L/ F; e0 W
move into Q_induct17 {8 d$ Y# q$ A) E
move into pickaisle.induct1" E5 T: {' B7 M: i
while A_i<=30 do begin
* W9 G+ I) N/ }; w! s travel to pickaisle.con(A_i)
3 N4 f) N s: g% U6 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! I- c2 M( q+ Z# m/ @! B9 o4 E2 P. C
else wait for 10 sec4 ]% @/ o+ R: ^, `5 e
if A_i=A_leave then send to die
# M3 `6 B2 j7 c3 L- N M; B* q& V, k else inc A_i by 1" [/ K8 T% m6 g2 ]$ m9 T) R$ z
end
+ f: O" l3 p' t' {5 J( Tend
) g# F7 J0 n; x; N3 X5 i3 Y( f8 J0 ~4 e; U4 Q
begin P_pick2 arriving
8 I, [% C5 m0 M; q, ]$ E0 K set A_i to 113 u6 L. I( ?7 L
move into Q_induct21 m, T4 D, T: O' T8 B' q* A
move into pickaisle.induct24 {- F* U* Y% h7 v* ] O8 ?7 Y6 G
while A_i<=30 do begin* ^7 X8 t( O: C. P, s
travel to pickaisle.con(A_i)
( e$ }, V, p0 d K3 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X2 E% w7 ^5 X; D else wait for 10 sec$ p6 v) @5 K6 z8 f0 v, F: Y# W
if A_i=A_leave then send to die# e ]4 \& c9 q0 w- u/ ?8 M
else inc A_i by 1" d! ]) V9 J+ W- h! L4 t
end
9 h, |( G4 [. G; i) gend0 S. h/ B. d! I" @
0 g6 q; T( x) Y
begin P_pick3 arriving
- t; E( j$ m0 x. R( ] set A_i to 21
0 V2 }+ I9 s5 m, V/ C( l, ~ move into Q_induct3+ H! v7 Y# |. Z Z
move into pickaisle.induct36 |; `. e- Z# |$ v
while A_i<=30 do begin8 F- ~5 w0 O3 X9 s/ V' R
travel to pickaisle.con(A_i)
) c4 I! W2 X( B) O/ W* \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ q% h, _! F* H. R4 ~8 K
else wait for 10 sec
. H2 X' F+ |, s ^! S if A_i=A_leave then send to die# w6 D# o: z. @9 Z, f3 p
else inc A_i by 1
1 F8 A2 t# K i# u1 T end
% R& Z y% M- {7 @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,其它按你的 ...
|