|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) n% W4 T }3 @3 {% x- R
- [* u# Q% ~* E! F6 g# V我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 @1 x) @6 Z5 ~# A
3 c' j' g0 {$ J+ |3 N( I
begin P_read arriving0 ?5 h& m0 X- q& w. V
while 1=1 do begin4 b. x" g! k! u C
read A_tote from "data.txt" with delimiter "\n"
L6 N' u; Q) a3 g; G4 ], ^5 r% |" H read A_time from "data.txt" with delimiter "\n"% U. k& T, t1 Q, C& m5 @
read A_leave from "data.txt" with delimiter "\n"0 N1 n0 c: O g8 w5 c1 L3 W/ c* r
read A_picks from "data.txt" with delimiter "\n"
2 e; `, z6 }% T: ?) L set load type to A_tote* C9 w. E& Z+ a9 w
if A_tote="tote 1" then set A_induct to 1. `' J# x& f$ s' s4 i, M
else if A_tote="tote 2" then set A_induct to 2
# i, ]5 B: I4 \, l p else set A_induct to 3 , I3 D( U0 X4 Y$ u0 s* w. S5 R- o e
set A_i to 0; l+ y$ U+ F p& b m% [$ n& ~9 r2 b
clone 1 load to P_induction& D, a8 B2 z, ]' W( v
wait for A_time sec
" V7 k9 E9 D- B0 Z9 ] end
4 n0 @0 B! ~* i0 x4 S* k$ y8 send
+ \+ X8 h, H$ {
$ h; _0 k, w$ B6 m4 Obegin P_induction arriving: ^5 n; x8 s$ e4 P" a4 z
if A_induct=1 then clone 1 load to P_pick1! p% j8 `, D1 N8 }/ m' F
else if A_induct=2 then clone 1 load to P_pick2
; J/ w. M; V: V- v else clone 1 load to P_pick3( V( ^. |, h& u( K% M& R% d% z
end( h# ~3 n! W' O5 F& V. o S7 c/ l
9 ?3 [" K, ?0 Obegin P_pick1 arriving
1 v7 m0 K3 ~& ^! @8 f set A_i to 1
* g; x* s5 L M move into Q_induct1
% }- |* h9 Q8 _5 B; I0 ~ move into pickaisle.induct1
y6 V4 e; y8 f) F while A_i<=30 do begin
, G( n( P n6 \" i* }$ I2 g travel to pickaisle.con(A_i)
2 V0 A% X2 b7 p r# W$ u* @& V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 T( C G" a1 E7 i4 i else wait for 10 sec G2 ]0 e! g8 R* t
if A_i=A_leave then send to die8 f$ u$ ~" I2 a3 |& ]
else inc A_i by 1
" g4 C* {1 q) `1 P; Y: q. U* s end; e1 E8 g( E- S7 P9 i8 f6 {# K/ [
end
0 Y4 p$ q7 E3 ]; a! y% x/ d# e% p1 W4 x# k s! ]& h' R1 n- O
begin P_pick2 arriving
( m9 ^+ y; ?. k' @0 f5 ] set A_i to 113 S8 k( G2 r' r, k
move into Q_induct27 e0 s$ K) ] P( d; m8 d |. ]4 T
move into pickaisle.induct2- ~. z# Q3 h* `; y# G; Z+ {! J
while A_i<=30 do begin" f0 H1 v, \2 ] k1 M) h" _
travel to pickaisle.con(A_i)0 K: c- J) X0 ^6 m+ ?2 ]" ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) {0 a; s% K( y" `7 a else wait for 10 sec
; k; {2 K$ k) g: Z) K# ]6 a% G if A_i=A_leave then send to die
5 R0 \. p9 f9 Q( U p else inc A_i by 1
" m3 C9 D6 a* F7 d end
1 M7 Q3 [4 D/ r) ~) e4 Kend2 m# w5 l0 B( X; u+ S
$ x$ M2 t1 ]- A1 B2 l% Xbegin P_pick3 arriving
7 v8 r- k' Y. ]; X5 p5 c6 { set A_i to 21
% L3 N, |3 [% W9 R move into Q_induct3
# P/ S' |: O2 H" d0 g move into pickaisle.induct3
4 t ^3 ^7 |5 m5 a! A while A_i<=30 do begin! u3 F$ b. c, A6 Y% |
travel to pickaisle.con(A_i)
$ p, p9 h9 g( c: `* o0 b P# O! L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) N3 n5 c7 b+ o$ z" O3 n4 {0 P
else wait for 10 sec
5 O) b1 k+ G; j# `5 b+ Y5 ~ if A_i=A_leave then send to die
6 D7 n3 x" D: c5 h else inc A_i by 1& }4 X h- d9 p! `; `6 @7 o! g
end, C. J0 ]# K& z u" n: y
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,其它按你的 ...
|