|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 Z+ M1 B7 } r% b3 ^! Y2 u$ _9 w. q, T$ O6 m, ~9 X$ h* U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 B/ G. N4 \8 e& f! R
5 s7 q9 u" p" D4 w8 \5 h/ G- @begin P_read arriving c% {" Q" T- R
while 1=1 do begin$ X- m; n @( A1 f
read A_tote from "data.txt" with delimiter "\n"$ n9 |. E" G5 _" P Z
read A_time from "data.txt" with delimiter "\n"1 K8 f' L; w t# v. c
read A_leave from "data.txt" with delimiter "\n"+ [) @2 x2 r' K6 Y$ I
read A_picks from "data.txt" with delimiter "\n"# E6 U* E1 T. a$ g ]; L/ _
set load type to A_tote
2 L* ~- E! l# P if A_tote="tote 1" then set A_induct to 1 \2 p9 p, b6 [; j0 M$ x- ?
else if A_tote="tote 2" then set A_induct to 21 @4 Z# ]) D/ D
else set A_induct to 3
3 [( ], G9 q6 C }4 P/ E# V" y set A_i to 0
3 [$ ^; f4 x6 n. ^ clone 1 load to P_induction
K2 R1 q) ~* e( @1 n4 E: M: l wait for A_time sec
+ Y2 }. |/ [% w) u* @! ] end
1 L- `& a! W- dend R( j8 o" v0 h0 t \
0 V5 Y( t9 h" r- f; U1 hbegin P_induction arriving2 j% ~9 N$ p0 }8 a( R% u, v8 v$ {4 X
if A_induct=1 then clone 1 load to P_pick15 z2 e; d( [& K- ?" \' G$ P
else if A_induct=2 then clone 1 load to P_pick2
5 ]" z: B) ^1 e1 [( p1 k else clone 1 load to P_pick3
& m: B1 j, A" O( Yend
. K \: o3 z- [" y* J/ d! T5 z+ l0 |5 A$ x' x( ]
begin P_pick1 arriving
9 y- ~! ] z3 {# I7 S5 z0 n set A_i to 1
: i; `5 d& _7 y2 Z5 U move into Q_induct1
7 D) H% [# P1 w' [ ?9 b% A move into pickaisle.induct1! G5 _2 S" ~) G1 ~3 z# _
while A_i<=30 do begin
# o1 }# t' s% {1 ?) k* |* n travel to pickaisle.con(A_i)& K. G# O5 S& Q: ]6 ~8 z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! F- _' o9 z0 G! p! c1 g- F
else wait for 10 sec5 K t. ^1 x7 }0 U; L
if A_i=A_leave then send to die+ L; n) P( I5 V0 N2 s+ ]# t
else inc A_i by 1
( X$ |3 x& M% k' l/ o# A+ { end
5 q1 @/ c% U1 C, `. M3 O7 `end
+ \; p: r) @/ Z$ O1 ~8 L) s- ~3 m$ A* f4 e( I$ {5 W9 u7 A9 H- A
begin P_pick2 arriving! D! V3 d6 E/ X% B1 y
set A_i to 11
$ P9 ?6 ~2 o; A" l! i: a move into Q_induct2
# C3 K/ M7 ]5 j0 @ move into pickaisle.induct2$ L, d' V/ n1 [
while A_i<=30 do begin! p. M j) N8 z- O/ \
travel to pickaisle.con(A_i)9 J! ]1 i6 c2 U4 @6 \7 C( J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 N: @1 T: D( u( {
else wait for 10 sec
4 }) t. t$ ~! s9 @5 X( F1 K e* b if A_i=A_leave then send to die
/ k! n) } | s$ W. h! V- [ else inc A_i by 16 K4 o+ |, l" [* C1 |
end
% g) v9 ~( k2 F8 aend) @8 M! @) e3 [2 x
( a& E/ O( y( H7 g: @begin P_pick3 arriving
3 l! u+ C. \, |0 F. ] set A_i to 217 a" [# q3 m" A: r0 w4 D1 `) r t' q
move into Q_induct3
# Q: [2 O9 K, J2 J move into pickaisle.induct3, i8 S- w$ E5 F1 c
while A_i<=30 do begin
4 Q' W9 z: x( x9 J0 Y) ?1 n. u travel to pickaisle.con(A_i)+ x& m8 S2 c G4 C$ C) z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 r% o. e: z; }) ~1 F) r else wait for 10 sec
8 ]2 R' S+ e/ A if A_i=A_leave then send to die, x+ n% Y/ T- E J) Q% J
else inc A_i by 1
, d7 M& E# I$ G( Q end! z4 z6 i2 x N v& e
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,其它按你的 ...
|