|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 {* P; W% x+ u$ V0 t
- m0 s _8 g; I8 V我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 g. L5 q8 s6 b$ h* i/ {
, n3 M# G, a# _! n0 \
begin P_read arriving
4 r) r7 l- v# ^ while 1=1 do begin; E* V0 M' v9 e9 m
read A_tote from "data.txt" with delimiter "\n". ^! B6 ]+ J. `2 \8 R& Z3 e: \
read A_time from "data.txt" with delimiter "\n") X$ n0 [- D& T* y, D. G
read A_leave from "data.txt" with delimiter "\n") b; G- R' h" v' t
read A_picks from "data.txt" with delimiter "\n"' q u# P, b, r. f
set load type to A_tote
- k: J- c: f8 _! ~ if A_tote="tote 1" then set A_induct to 1
3 ]6 I6 I: f, f6 X7 P else if A_tote="tote 2" then set A_induct to 2
- \( S& ^6 i8 O' L0 q0 J else set A_induct to 3
6 r% I9 y- U: Z9 L2 W3 ], X0 J; t" P set A_i to 0
9 S1 L8 o2 h& A clone 1 load to P_induction
3 E( t% s; t7 ^) g' W4 `) a wait for A_time sec
! M8 @& _* E! R end! g0 F# E1 k" \, C: U+ R* W6 U
end
+ f1 R, a0 {5 t, [ m
$ S- F' D, O5 D( U; Q5 xbegin P_induction arriving; d- q# `3 }$ B9 G# _2 m& ^
if A_induct=1 then clone 1 load to P_pick1
2 y& I7 }7 f; {+ e& n% E( F else if A_induct=2 then clone 1 load to P_pick2
# r% ^# x; @) F- T else clone 1 load to P_pick3
! ^3 _, B( F( z! }$ e: d! Rend
8 G) ]% e+ k+ k( \$ H& p9 G1 M: d, d* r; A. K+ F" e
begin P_pick1 arriving
8 W) W7 \8 K4 { m5 T set A_i to 1
0 j* E& X! [7 z move into Q_induct1
- U- P9 l7 @0 ~, d- R B* C move into pickaisle.induct1
4 y% S* I' J4 g" @) M while A_i<=30 do begin
6 B. W! ]! d6 U1 T* b travel to pickaisle.con(A_i)9 X8 P* c3 C+ h% R: h! W I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 `: ]2 [8 o1 R* Z5 T
else wait for 10 sec, C1 n' C$ O0 O) o1 V# A3 f
if A_i=A_leave then send to die
0 G$ b$ w: w4 z- f else inc A_i by 14 `9 J' P L/ U! ?, C
end: Z1 z0 ^8 A3 u- }/ ^6 k- K
end. f4 \) t( T- b y* H0 ]
/ ?9 M. z9 ~3 v2 e( K' F
begin P_pick2 arriving
5 v% X" c+ X$ c3 W$ b7 P6 x7 O set A_i to 11
6 f$ l- X0 j1 Y# |$ I move into Q_induct2, y( m I3 n* y% D$ S: {& U. ^% y
move into pickaisle.induct28 Z. ?9 u' \* N* g, b5 ?
while A_i<=30 do begin4 D$ c* u( R/ v1 B2 M
travel to pickaisle.con(A_i)5 o( W& n" c" f9 X" N+ @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ]* N+ L+ C" D5 D/ M( h. c- A else wait for 10 sec7 ^! S {5 [; p! a
if A_i=A_leave then send to die
- m" u/ m; }9 {9 p v else inc A_i by 1( V- G" i" [1 \3 N# q2 U
end. v% L* W# a) e1 y$ N$ b
end
# g5 }6 m0 `3 F; ?% P: g: R1 `! X* b' x& V( y. Y
begin P_pick3 arriving
' M; d. P: z8 U& Y7 Z D7 o/ r" v g set A_i to 21
& q# S. @' d5 g0 v! \/ ~ move into Q_induct3
& W0 X/ l1 s* _; y2 ~+ \& N7 ]" t* z move into pickaisle.induct3
Y5 J9 J% S+ k j1 T7 p1 i while A_i<=30 do begin. j1 w: v% {# q2 Z) o
travel to pickaisle.con(A_i)& I" W3 P. a/ C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H+ E( F) l V6 X2 [0 Y1 W1 g6 [( @ else wait for 10 sec2 H6 p9 |" O3 G0 ~- {" S6 s( t
if A_i=A_leave then send to die4 M7 W6 s3 t) |: f
else inc A_i by 1
4 P4 C3 w8 E0 O. J1 m( {$ I end
* l) ?; X# L0 x( `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,其它按你的 ...
|