|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 ~# c. Z$ l6 v7 s' W- o; b5 [* @
3 F/ x9 ^; L0 u# P我的问题是,在每个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中的数值,不知道会不会有什么不妥。% f) ~$ A2 M) C
0 [+ p5 D4 \5 b; h! q" W
begin P_read arriving+ p& n1 t( j% a# v2 ~% P
while 1=1 do begin
* Y( I; C/ \( y. U4 w read A_tote from "data.txt" with delimiter "\n": T2 v G8 z, S; t% O
read A_time from "data.txt" with delimiter "\n"* Z* F ^+ ^& c. O) v' \
read A_leave from "data.txt" with delimiter "\n"$ }/ |! g/ J- P/ W( }1 T
read A_picks from "data.txt" with delimiter "\n"
5 r; V9 H: P: B, f3 _& Y% | set load type to A_tote
9 C- O% l: K7 C5 B5 C2 h if A_tote="tote 1" then set A_induct to 1
4 G! G2 _ O" I* }3 k+ S else if A_tote="tote 2" then set A_induct to 2
6 s5 {: O4 `4 E1 P3 i+ h7 \" ` else set A_induct to 3
$ ?5 V6 z/ ^. y/ r% n8 q set A_i to 0
4 R( d0 C, v5 z9 L( I" c4 Z, n: c clone 1 load to P_induction
9 F3 p( O- S. q7 B+ c wait for A_time sec- B% B% q* q1 a. C3 t
end I; B* } o2 K) n$ d& |6 J; r4 k
end
- U2 B4 P8 F0 h7 G
3 e# v1 Z& b2 A9 t: b6 t! c/ Fbegin P_induction arriving# I6 \9 v: O7 h' b6 H
if A_induct=1 then clone 1 load to P_pick1$ G. P4 Y- o2 C$ a! m" C q' c
else if A_induct=2 then clone 1 load to P_pick22 @9 n4 L T' E4 Z5 q
else clone 1 load to P_pick3
# L, V& E: \4 U8 }" w3 O3 qend0 C1 m6 m- [. H; d5 w
" L7 h" O2 c0 q: P& j
begin P_pick1 arriving
: r) ]. I2 g) y6 r; S. [ set A_i to 10 l" z% F" M" W- T) P7 @( p) ^, J
move into Q_induct1
* q* i6 R0 K! {% e% p! \/ ~/ u move into pickaisle.induct1
9 b; i) x7 c7 K- s while A_i<=30 do begin7 H y2 @- N! U, t/ E
travel to pickaisle.con(A_i)2 n$ U7 W2 C: N8 ~ M; ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ?: e( r4 J8 Y5 J( D/ {
else wait for 10 sec
5 q: _) l8 \/ ~9 e if A_i=A_leave then send to die, p+ t, f- j; m- Q7 M
else inc A_i by 1! o: M0 f6 Y$ L# ?" J1 |
end- R0 \& Y9 P( L% n1 e
end: y9 P6 @% ^, R& S I; T
1 U1 R2 s8 M* G' B- P, Abegin P_pick2 arriving
7 R* K' ?# i5 ~: K! U* @ set A_i to 11
' M1 r0 e7 ^1 s2 z4 S$ R$ G move into Q_induct2' v5 l/ H" z: s) m x
move into pickaisle.induct2% Q4 d/ e% o& K# z8 C w
while A_i<=30 do begin" w) X" |/ N/ u* J
travel to pickaisle.con(A_i)
! p: H# q. @9 S, Y1 v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ o8 V+ z: y7 D else wait for 10 sec
! D5 d. g- q$ t# u s5 w if A_i=A_leave then send to die/ D8 k) }: V e O, j% t, l
else inc A_i by 1
0 t' I" q! t7 s9 P6 m+ g1 L end
3 M/ p( F0 T, O2 G: I# D. xend. v: B: b$ ?. q4 j0 O
# k% ~ F1 c8 i7 r& Q! K3 Rbegin P_pick3 arriving
7 T" v( }8 c- w/ I set A_i to 21& @4 t( j5 g8 r5 A0 I0 Y6 b
move into Q_induct3
* m* x% B4 Y" T; b move into pickaisle.induct3
$ R' G5 [+ p7 G' b$ [5 j5 ]! D while A_i<=30 do begin
$ W* B: L" _6 s' R8 Z6 w: P2 I travel to pickaisle.con(A_i)' F# m7 ~" H& M( a1 k/ l/ l9 O Y$ [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 o& F7 ?' [ N
else wait for 10 sec
9 g9 j* P8 a- n& I6 y% Q( B3 Z if A_i=A_leave then send to die
p t9 m. d. U# b G' A2 A$ [" ] else inc A_i by 1, G& X; ~; H3 B$ j1 E
end
: T# z- o: j0 t3 a; |( D, [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,其它按你的 ...
|