|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- K g3 z7 _8 u" T* y
) G) I5 r) z W& l+ O我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, q! F* Q+ \1 S9 f
3 b* z5 a; R2 s9 J, l. X2 ]; T5 H; W: ibegin P_read arriving2 J- q4 A- ^+ d8 Q8 d+ o) N' U
while 1=1 do begin( G" @3 b# ?# N, u" I
read A_tote from "data.txt" with delimiter "\n"
4 ~) a8 M9 N* u& j7 B- K read A_time from "data.txt" with delimiter "\n"
5 ?% Q3 ~4 \% B) Z, }" U read A_leave from "data.txt" with delimiter "\n"+ l5 \2 H' N8 ^# P
read A_picks from "data.txt" with delimiter "\n"
" ]& |3 G1 W: p) t5 l set load type to A_tote
8 m; j4 g' _ Q if A_tote="tote 1" then set A_induct to 17 ?8 A r4 ^/ q( O
else if A_tote="tote 2" then set A_induct to 2
0 i$ W4 K/ u1 [& j else set A_induct to 3
0 T6 D( @/ S5 f7 |0 ^4 U& h5 E set A_i to 0
" M% ^6 g3 e4 }" D3 C2 m( N clone 1 load to P_induction. V* ~& `* J; ]8 ]5 g5 g* V
wait for A_time sec1 X g( o, n; h4 ]3 [$ c
end
& `+ N# P$ C* m5 j0 h% jend
! _; U6 H6 V+ G
L& {3 ]! _ R+ \' Ebegin P_induction arriving; L6 F2 s3 g* ~. \9 S
if A_induct=1 then clone 1 load to P_pick1
6 X5 X* K- g- P8 P else if A_induct=2 then clone 1 load to P_pick2
- O& c" L$ a2 E' [; I6 K; T& T. g else clone 1 load to P_pick3, `& i1 k7 L2 Z* y7 Z( d$ _& q
end
6 ?" ^1 _; ]+ w- ~# l/ q% X' O/ |4 q3 ?# w1 ^
begin P_pick1 arriving& u9 Y0 _' @; T3 c' K
set A_i to 1. l; {) |; X1 d3 | N5 x7 N
move into Q_induct1! i% T4 Q% C5 L! P [
move into pickaisle.induct1
8 t i& P$ t6 F3 V8 ^, _9 ~ while A_i<=30 do begin
8 N) r# X3 F& W3 X0 j) l7 A. V travel to pickaisle.con(A_i)! l& N* l* X* p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ^8 T; x. X" G7 } a8 [* ]: y8 t4 b
else wait for 10 sec
# L Z/ @9 ~+ W+ p7 J if A_i=A_leave then send to die; R7 t3 k& s- _" A. Z
else inc A_i by 1
8 g# K9 }4 N$ I2 l. C7 [ end4 s6 i( D; a+ X5 l' Q0 @
end
9 ~9 ~3 j% T7 l- }+ Z
- ~* f3 n6 A- I. i, j- d' ?; n, Qbegin P_pick2 arriving1 E8 ~. G% D' K9 q1 a
set A_i to 11
5 U) b n6 Y; ~1 s7 u move into Q_induct2
]' `0 _# B/ w- Z move into pickaisle.induct2% q1 t& l) ?# X
while A_i<=30 do begin' T4 a/ t e S7 f$ P8 F
travel to pickaisle.con(A_i)' ^( y* h. P2 G. z" ^ n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 H0 _/ E7 P+ D, j8 c else wait for 10 sec- [, y( x( b& ^7 b. H2 J+ Q9 E$ Y
if A_i=A_leave then send to die
: q, m( w$ q8 G. H: T else inc A_i by 1
- D/ y S. W3 f# I( E8 L+ D end. _) a5 r: m; X( {, C1 {4 x
end% ]( T" I9 q6 S
) q% f* y/ ]( y8 n
begin P_pick3 arriving
) o& U) v) g9 ? set A_i to 213 `, |9 ^3 S: \ g5 |2 J3 B
move into Q_induct3
- i! b) I% | r) z9 E; _, }) G move into pickaisle.induct3. z% w- x: a) Y' f1 p" b
while A_i<=30 do begin
2 w( Q. K2 ] A5 t6 l# E travel to pickaisle.con(A_i)8 a$ f9 y- `+ h( G$ x9 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' g& j( x" a) V
else wait for 10 sec
6 {' w9 S# t$ a4 M if A_i=A_leave then send to die n9 l6 N& m% f1 d8 l F/ s# V
else inc A_i by 1
4 `$ c, E; { {/ n end
- Z+ L, z- E1 O& send |
最佳答案
查看完整内容
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,其它按你的 ...
|