|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! k0 c1 {" r* h/ x# q
7 N7 |; q$ h5 \5 x5 E5 O2 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 V( b# ]) ~, ]
$ M, S2 Q; X0 D1 y T
begin P_read arriving l/ Z( W- B1 e$ r% W2 C
while 1=1 do begin3 w) P V- j! f; W* S3 H. l8 H5 M/ Y
read A_tote from "data.txt" with delimiter "\n" R5 H3 A% j3 n; D/ @# ?
read A_time from "data.txt" with delimiter "\n"* c8 q/ T3 {9 ]2 {
read A_leave from "data.txt" with delimiter "\n" f/ R1 k2 y2 ?; [8 K
read A_picks from "data.txt" with delimiter "\n"- W- K: p* b K9 W
set load type to A_tote
! ^$ S+ O M9 W- J9 _8 ^ if A_tote="tote 1" then set A_induct to 1
) Q( ?' N3 }( I& o, w5 F else if A_tote="tote 2" then set A_induct to 2% `9 J2 ?+ ?" ?& M
else set A_induct to 3
5 O! [+ _5 U( F6 h+ R! i set A_i to 0
6 |+ ~7 C' [9 w0 R clone 1 load to P_induction. P% j2 [/ n. F& a4 v; y/ [
wait for A_time sec
2 g) X" M* W1 M) {* k& u end
3 B6 C% q% D+ I* zend
* T6 T$ Z& M) R- n0 c; V3 h7 Z: U" [0 |0 l& N( f8 b v
begin P_induction arriving
# }- \8 W2 F1 W3 |4 M if A_induct=1 then clone 1 load to P_pick1
' P1 M% \& N0 J" B/ k, W8 P: ]( f else if A_induct=2 then clone 1 load to P_pick2
8 l t& H0 A# V else clone 1 load to P_pick3
4 j' j- ~( k5 t6 v; T3 R, \end: h& Z' `, `* i" U ]. a9 o
3 N: `1 N5 m* U- D) Pbegin P_pick1 arriving
4 w( K' k$ k9 I+ j set A_i to 1- p/ R# R- A @! D; y
move into Q_induct1. f. _* G; r" }: ?! ]* }; e
move into pickaisle.induct13 K7 C" q. _. C8 N4 a! N
while A_i<=30 do begin
1 G+ b& N" ^- P. F$ L; _7 ~0 e4 j travel to pickaisle.con(A_i)
# O( m7 X) t' ~9 B# D1 Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
H S a+ w9 J k else wait for 10 sec) W/ e1 W6 r" j. x/ g
if A_i=A_leave then send to die
3 a) ?! ^" G: |, \( J else inc A_i by 1
}* u; G* y% W5 v H* o end4 w, b7 _) ~7 J2 j1 F
end/ F- V/ Z: p; F- I1 M8 g2 b
) m; m8 |; d; R I/ h" ^$ Fbegin P_pick2 arriving
7 K2 A! i8 d, N* l4 V set A_i to 11
0 ?& @( c2 \1 y: m, u% ^ move into Q_induct2) s1 x/ @1 e: G6 v$ A7 ]3 S
move into pickaisle.induct2
% ]9 r% ` b" N) ~+ P: [ ] while A_i<=30 do begin
1 x: a3 {! {5 ?7 X0 G travel to pickaisle.con(A_i)" w. N4 x8 w0 \% S2 N' r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# F9 G1 A# m5 H+ r: W2 A1 c, ^# N
else wait for 10 sec! z" Y* z. t, g/ ]9 q; U- Q
if A_i=A_leave then send to die0 r2 c9 Z0 V. G2 E( h$ u2 u0 ^3 \
else inc A_i by 1
) O& `# K; a- p: N, I, `9 R end
( G4 {6 X; f* O$ [- Bend
! r2 u1 M# e, n+ x' r- W( i6 b
begin P_pick3 arriving
# l/ _& O1 d: k. j* }# M& R set A_i to 21% K% }* c* ^. m' a
move into Q_induct3, Z/ O' u& _6 S& Z5 M" o
move into pickaisle.induct3
7 N5 T. q" q) V- b- O- A while A_i<=30 do begin
6 q: F: K# ^, B travel to pickaisle.con(A_i)
! k/ e* Z3 I( S. T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H% @2 o& J( N: h else wait for 10 sec
2 ~! }3 R) C8 L) _+ N+ K& u if A_i=A_leave then send to die, |1 Q, [) X8 s
else inc A_i by 19 e6 n. s- e+ G0 c
end2 N3 S9 X2 P+ q% ?4 K7 }' b
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,其它按你的 ...
|