|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, x M% J% O4 j3 M
1 k1 r+ m T$ U+ p0 A8 P9 h4 d# m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# ]+ y% d7 B W4 U0 d' N6 [- V% J: q, X
begin P_read arriving
; N. X' _8 M7 V$ ` while 1=1 do begin
7 l2 z4 z. b5 P) _0 u% f, ]$ j read A_tote from "data.txt" with delimiter "\n"
! D. f% `$ h* ~ d% q: d3 H read A_time from "data.txt" with delimiter "\n"- ^7 \$ Y& O& ~8 p( W0 t
read A_leave from "data.txt" with delimiter "\n"2 f* d% r- P6 d: Y" V: ~ j
read A_picks from "data.txt" with delimiter "\n"
4 { E) ?' W. k& G: P' y; }. A set load type to A_tote
$ u: t o: x! w6 }* W% Z if A_tote="tote 1" then set A_induct to 1
8 M$ n( y: b0 ^; E8 K7 ^ else if A_tote="tote 2" then set A_induct to 27 Z- t6 B8 w2 t- r' `# \
else set A_induct to 3 % K1 D& G# f' Y" _6 F2 n
set A_i to 0
$ Q# F% h; U5 t9 v* n8 j9 a c5 O clone 1 load to P_induction
/ m" U* K1 x& u wait for A_time sec
5 q& T; r* ^ C9 _4 ] end
& ]8 ~# G: S Aend
9 w4 ^8 ^2 u# y2 g0 w' N; t% M
6 l p8 Q, f2 H9 e5 w3 ~. Ebegin P_induction arriving
+ N8 Y6 r( l% H4 O0 w6 @+ f# ?2 j" ~( e if A_induct=1 then clone 1 load to P_pick1# C4 J8 u7 |: ]2 I: H7 u3 @" i
else if A_induct=2 then clone 1 load to P_pick2- V( S2 o/ @0 \& a8 d
else clone 1 load to P_pick3
! a! ]2 T+ d& t2 U( O1 Zend! Z) r% c" v4 z: O
/ s3 p" \, g" n$ p3 H. [begin P_pick1 arriving
e: L; y* s# o c set A_i to 1
9 a" W: ?! t* K+ J7 m. v0 K move into Q_induct10 i# I( F+ X5 j% T4 `, X
move into pickaisle.induct18 N+ _) z' J8 D1 x; w- b3 A6 W
while A_i<=30 do begin
1 _& u- ]. f& ]- g travel to pickaisle.con(A_i)0 ?( u8 @$ p9 I' I! A, [6 h Y0 C/ a! P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 b! G$ O+ k0 s) e, N! j
else wait for 10 sec6 \8 l L5 ?/ F
if A_i=A_leave then send to die
2 ?5 d: R2 N1 s ?$ W1 l( [$ G else inc A_i by 15 D; f2 j# y$ E5 P
end; i, K' w% [- Z
end
$ W' E+ l, s3 x9 h# v- ~/ M" n, Y R; o- S/ ?5 p
begin P_pick2 arriving& ~ }3 F. d8 e$ t% d6 ^
set A_i to 11
& T- R( r* |3 [: U" v$ f move into Q_induct27 U% j9 J7 a3 }6 o" x4 Z
move into pickaisle.induct2" D: e2 y& [. x" ~, [+ Z( u8 G, F
while A_i<=30 do begin
! E4 E3 F# o1 {7 }3 N travel to pickaisle.con(A_i)
$ t8 V* Z- m8 c( L- p8 t! D d" C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( G: I8 v+ p# v+ G) i9 B- J/ y- ]( a else wait for 10 sec
* S$ q2 [- e, p/ D+ Q: w" n if A_i=A_leave then send to die2 ^, P' }" {: @7 U3 U5 u
else inc A_i by 1
5 f+ f: T! X q A w5 } end7 |4 C" Y9 j' N& k. C: {6 f! L c
end
9 e9 a3 m4 J, y( ?- V# m
# B/ S0 P1 R! fbegin P_pick3 arriving
$ N% u( m0 l; L- I! K set A_i to 21
% F1 M6 C/ V6 b move into Q_induct3( |: P9 y; }$ N1 s0 t( j; v
move into pickaisle.induct3
+ h b$ L# E5 g& x4 \$ D- @ while A_i<=30 do begin
. n: J2 g i* `7 m8 t; ` travel to pickaisle.con(A_i)2 t) B1 ?6 F2 y% o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' G. u* y3 _3 V" r1 K" |% U- P6 @ V else wait for 10 sec
6 E. D V/ A- _, D' ]# v if A_i=A_leave then send to die) u8 p/ y- z" t. X6 A
else inc A_i by 1
. }9 [9 p0 [4 g. M* c4 U- X end% M# O3 `& y5 ?
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,其它按你的 ...
|