|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& r9 B& s7 o9 x. O! b; W6 J) f
3 g, _9 r" S8 z# W0 f: y8 B+ E8 w, |我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ x9 u4 w# r$ U$ G* L+ j: y+ C/ E' L, ^+ H0 U" w+ f& C
begin P_read arriving! C% _2 q2 Y B# K6 ?
while 1=1 do begin
5 V3 e- j/ D3 k/ o z s read A_tote from "data.txt" with delimiter "\n"
) [8 f4 @/ L! u( @9 T+ ? read A_time from "data.txt" with delimiter "\n" W5 C' e i. K& N: O) x
read A_leave from "data.txt" with delimiter "\n"
5 _' a s- d# F" `; f6 s) H read A_picks from "data.txt" with delimiter "\n", q2 v: X9 a+ T+ R
set load type to A_tote' H k" Q! s# h3 d3 ^3 S2 m
if A_tote="tote 1" then set A_induct to 1/ h4 A7 Z, P" B6 U( P' N3 K& k7 D
else if A_tote="tote 2" then set A_induct to 2
1 u3 Q% T/ V: w: A else set A_induct to 3
; f9 a& {( Z; ^2 V6 Z- t set A_i to 0
' b$ N: E$ W3 i0 ]; U5 }6 [) { clone 1 load to P_induction1 V2 t+ U& p$ Z2 ]& i
wait for A_time sec
; H4 @) p- U9 R# o7 s end
4 V Q& W2 q) S! {" i% iend4 i5 c6 a- L" d2 G F7 x3 R
9 [9 V* `; d3 G( R+ Nbegin P_induction arriving
$ P& i- ]' w- O5 R) \" p6 n( ] if A_induct=1 then clone 1 load to P_pick1! a( i5 s, A3 o. }0 }
else if A_induct=2 then clone 1 load to P_pick2
( m! e; [0 U0 V n else clone 1 load to P_pick3
. [0 D a! }4 w/ o- F$ {end
0 a4 a; s+ d" c- k7 a. a7 K$ h& E M1 N L1 f2 ~' L% q8 T4 x
begin P_pick1 arriving% |3 ^0 C; d$ l
set A_i to 19 ~7 h( Q; c4 A" V( b% e3 V
move into Q_induct1
& Y/ Y7 I' \2 g* l. ` move into pickaisle.induct1
, ~* l$ ~" D" e: u E7 [ while A_i<=30 do begin
' P! x% I5 q5 D- R travel to pickaisle.con(A_i)
0 V2 }, ]% J: j9 y& r1 S( x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 {# U7 z1 X+ m else wait for 10 sec
/ p \2 m& O. A5 Z6 ^% h if A_i=A_leave then send to die$ ]2 D' n( W l W$ Y. H
else inc A_i by 1& R7 J6 c+ E8 V( h0 Q
end
& M8 j! U- b) {8 fend
( B% |! ^4 `# ?
. h! ?/ Q H" R9 f' |begin P_pick2 arriving
" D3 p) s0 p* b1 g/ I set A_i to 11
6 u Z4 a @9 [ move into Q_induct2/ |' T) s6 R$ G) O0 s
move into pickaisle.induct2
8 v ]& E4 ~$ K9 [ while A_i<=30 do begin' P3 F% y0 l1 `) m `
travel to pickaisle.con(A_i)7 A4 i2 ~6 `, A! c8 Y1 o) |% d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ E+ N& l& {: O& g: [8 n% T else wait for 10 sec
# x: p9 U: Q! e# u2 ?1 Z0 ` if A_i=A_leave then send to die, z- t( K* f" g1 J0 ?, B
else inc A_i by 1# j1 J0 k$ c5 i1 k/ _9 f
end% h- K; p( `1 _2 I3 P8 d9 z
end
; q8 ` w0 A7 j4 z7 w
1 @" v8 R1 j! i0 a& S2 Gbegin P_pick3 arriving
3 v) m: S2 W/ s5 r9 K4 _6 i set A_i to 21
, E7 H% O& U0 C+ o6 N move into Q_induct3. y; x% c- w' t7 O( T
move into pickaisle.induct3+ ^) W: s$ N4 [
while A_i<=30 do begin5 g4 d- `3 L4 _1 y9 o
travel to pickaisle.con(A_i)
6 I! L" s, u: X! k% t/ h, Z5 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( \, z+ x! z/ b4 T. Q else wait for 10 sec$ I, o4 f8 V: Z2 O( L
if A_i=A_leave then send to die
4 D5 O5 v; J( J- h s9 | else inc A_i by 1
# V1 e e5 C" } end: s3 }# b/ F* W2 a4 }3 _3 r7 [
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,其它按你的 ...
|