|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( I8 B! {& w2 y2 f3 R
: p2 O1 F2 k% H6 D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 l3 n3 d& \, m0 W. k
( c8 W; p$ K' T& kbegin P_read arriving
: P- j5 E4 R2 J/ |! O7 ] while 1=1 do begin- f+ a; O0 L* ]$ d) u- w
read A_tote from "data.txt" with delimiter "\n"- k/ b' [6 `4 x! t o G
read A_time from "data.txt" with delimiter "\n"
7 S; u6 H* t: b/ M4 q3 `! ] read A_leave from "data.txt" with delimiter "\n"
$ {5 p/ |. L4 J: B" H2 d7 x7 O1 [ read A_picks from "data.txt" with delimiter "\n"
3 E N9 R. p, ^! _0 ^ set load type to A_tote
9 Q& e) q8 b0 Z1 a+ e if A_tote="tote 1" then set A_induct to 1* B' }0 a) Q! z1 C3 V/ I$ F
else if A_tote="tote 2" then set A_induct to 2
, ?& C( Y; i: L# d; G6 J9 j Y else set A_induct to 3
6 N" e( l! s5 Y6 s set A_i to 0( G3 \2 K, [! H6 t: {
clone 1 load to P_induction
- s" K: a/ S* z Y4 `/ B wait for A_time sec7 ~$ x& m' E6 Y8 W1 b
end
" x7 S3 h1 m6 @ G. Vend! q% _) d1 H& _) \4 R l, h2 v
7 O# a) { d, l+ N! `begin P_induction arriving
. E2 G# H5 e5 t if A_induct=1 then clone 1 load to P_pick1$ S# }! G9 j% v( V) y
else if A_induct=2 then clone 1 load to P_pick2: v3 [! D$ ]1 v# D
else clone 1 load to P_pick3- J: C& d5 n1 g) Z3 i9 S
end
. I7 T a# B) t
: f4 v, O1 O( x7 K! o$ y( Ybegin P_pick1 arriving
) k# ]: t5 P5 P2 R" t& ]0 K* {) S" M set A_i to 1
3 k- o* p" ]8 V- R1 ]5 D move into Q_induct1- V# d, r% a$ U, ]+ t
move into pickaisle.induct1! c/ Z. G6 i$ G. a6 i- f
while A_i<=30 do begin
& Y! \6 f6 Z2 o travel to pickaisle.con(A_i)/ W! [: q; Q; O. F: `' t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, u8 l6 g/ Q9 F6 |, G- }5 E
else wait for 10 sec# a& h) A; K) g$ K; R
if A_i=A_leave then send to die$ F6 E: Q1 M1 U& U
else inc A_i by 1& _; Z! j) m2 q" t2 b: ^
end/ r, D3 W# f, m6 ?; K
end
% }6 D7 E5 h2 H8 \5 S0 v& Q. Q# o# i7 G( G1 \
begin P_pick2 arriving
* v, E4 X" Q' G4 n: p4 z8 W set A_i to 11
+ F `8 P6 i ~ move into Q_induct2
9 Y! a5 g+ p$ X2 r& H, R move into pickaisle.induct2/ X; R" {% `) q- @: c) S5 ~" z5 E
while A_i<=30 do begin
! x' Q, H( ^/ Q. u- [ travel to pickaisle.con(A_i)
- I$ c6 o* C" H$ n. w( \% @2 v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ F. X B d5 m( s4 L& } else wait for 10 sec/ ?% k7 n3 [3 N; u8 i
if A_i=A_leave then send to die
9 p- P8 K" ~( m+ k else inc A_i by 1( C7 `" r- b: S2 X C" N
end
# \+ q3 Z9 Y2 V2 bend
& a2 _7 O/ _8 W
# d6 a/ G" e( ?begin P_pick3 arriving( l2 Y4 j' ]- A4 O$ l
set A_i to 21
_, F) ?$ F7 D/ Y! J; O: I: B move into Q_induct3
5 {: R; w, [+ O4 ]9 i7 `( l move into pickaisle.induct30 G2 [8 W2 P: ?/ l. U; v
while A_i<=30 do begin
* ?7 p8 u( y. i3 ` travel to pickaisle.con(A_i)
0 y; c9 |& W+ H; g, Y9 u" r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 l+ w1 H) A1 N7 E8 Y h4 i else wait for 10 sec
& o0 U8 p( H$ e- m/ f if A_i=A_leave then send to die
: e# Y7 C+ Z; X. `% H else inc A_i by 1+ C2 _8 W. x% C) z
end* R9 }% n* z5 m7 V# E3 \1 h
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,其它按你的 ...
|