|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 E& y2 [! X; ]) R+ Y+ a
0 L; ^2 N9 h' H( U) e4 n$ C我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 \6 ^: _. `8 O
( _0 h5 B5 a4 K. F( obegin P_read arriving
& C0 \5 `- p% E/ l% @ while 1=1 do begin
( G; U6 J8 b( S read A_tote from "data.txt" with delimiter "\n"; z3 r' A6 n5 s* B" E
read A_time from "data.txt" with delimiter "\n"9 t* c6 j) ]0 ^) M2 |
read A_leave from "data.txt" with delimiter "\n"
( x! W2 l$ C% _6 t y! K read A_picks from "data.txt" with delimiter "\n"
0 t9 R+ \" h( p" s u2 [% y set load type to A_tote
0 Z9 i0 Y, v( S if A_tote="tote 1" then set A_induct to 10 u g+ K+ w, K
else if A_tote="tote 2" then set A_induct to 2 C/ m' I8 h( s/ D7 a
else set A_induct to 3
- ^; |: G$ i/ P& U! |0 L, D) Y' Q set A_i to 0
$ n1 D; S6 A+ O3 B$ ?! S N5 { clone 1 load to P_induction# l% j4 N/ P4 ~4 I& r
wait for A_time sec2 }7 c5 m9 ]% m$ h" k
end3 d6 |& P" }/ X2 Z
end
. h4 V$ k, |! r l9 u8 i6 D7 g7 X2 O3 a
begin P_induction arriving" l7 V; r. o' R
if A_induct=1 then clone 1 load to P_pick17 U# w: H6 V; V5 S& ~# T: Q
else if A_induct=2 then clone 1 load to P_pick2
$ K2 i; R. y# I# g else clone 1 load to P_pick3
2 s; M# e1 C Y: x0 E% Yend
5 Z9 p2 C2 _- v6 Z
& C: E, N1 n2 ?% q4 Dbegin P_pick1 arriving
% a; y# C; e. b+ L* c' ~ set A_i to 1
: b1 P5 z% c; a move into Q_induct1% L( w$ b4 H* j1 Z) O# l' H
move into pickaisle.induct1
# N& P7 z+ \. }8 u! _) x while A_i<=30 do begin
0 j; @# u$ N7 A) c& `8 r! H( X travel to pickaisle.con(A_i)
9 y' ?. D( w, h8 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ E1 ~4 r1 k- C else wait for 10 sec& F8 A( B' G) K& m& Z
if A_i=A_leave then send to die; W3 J u* F' r! h# M* a4 Q4 y, r
else inc A_i by 1- P" C8 a3 w- _4 q# M! O$ R
end f2 Q' d5 K5 h
end
9 N7 ]7 w+ B6 Y/ `3 b' T# e ]1 u" q
begin P_pick2 arriving
* e& n( i% W0 O, a- ?7 F+ x, I0 z set A_i to 11
2 v+ d- K+ O& w/ B; }3 C5 N1 o6 t move into Q_induct2
& T) c. l, P# ^# U ]% i4 ~ move into pickaisle.induct2
5 s0 E$ `; I. N ]4 j. m while A_i<=30 do begin( g' |) K* m+ a' o, ^
travel to pickaisle.con(A_i)6 v( M1 p1 A0 h6 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! q( U1 L& M& C1 D) j* j& {
else wait for 10 sec& a8 p8 @: x5 s5 \. j
if A_i=A_leave then send to die# O: F. g P1 A2 E
else inc A_i by 1
* {) \& ~, c4 n! L end
" Y1 w* B$ M3 q0 S5 P. S8 gend1 I* h" H3 d! J) g f
# \( M6 L# g9 p( X1 ]4 w& [" B8 qbegin P_pick3 arriving
4 L% G' o; g7 @, M* ~ set A_i to 21& H D2 P; g9 H! e) y
move into Q_induct34 ]% O# Z9 ]% f
move into pickaisle.induct3
1 T) K4 @5 |1 ]# _9 P) w1 q while A_i<=30 do begin
4 W$ q: V; }8 `1 j% U travel to pickaisle.con(A_i)
1 U: o8 k0 e M1 S) T' H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 J0 \+ p( P1 T else wait for 10 sec
: D4 `8 g- |9 U* q5 U1 X- e if A_i=A_leave then send to die
& ^7 b7 b' L) }( B5 T O! [ else inc A_i by 1
. C6 }* K: f2 O: } end
/ V ~( R. \. S$ Z3 C: U; mend |
最佳答案
查看完整内容
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,其它按你的 ...
|