|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' k" y7 ^8 l. D5 B7 h8 D6 W* n; q0 Q% X/ ~ W3 {! y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ?) Y4 a- R; }2 z+ }2 z- _, Z3 [; O! k
begin P_read arriving
B1 j! \: r6 W! ~9 E5 U while 1=1 do begin/ i0 g$ c$ z& ]& r/ ~. a2 f" r
read A_tote from "data.txt" with delimiter "\n"
8 N& J) ~3 q* K! T! z read A_time from "data.txt" with delimiter "\n"
" O d3 f+ R. K7 \+ i0 _ read A_leave from "data.txt" with delimiter "\n"& S$ M) q: u# i. ?+ J N& Y
read A_picks from "data.txt" with delimiter "\n". i- j& m6 `5 x" |9 r6 m$ i' I
set load type to A_tote
0 E7 ?4 x7 P; g0 l if A_tote="tote 1" then set A_induct to 1+ b% Q6 O9 A' R7 @6 E
else if A_tote="tote 2" then set A_induct to 2
* H/ [; k5 T8 ]( Y+ u/ o2 M else set A_induct to 3
1 [9 T8 @ d* H" h6 C set A_i to 0/ g& N3 C8 |) g% V
clone 1 load to P_induction' j* I$ b. l# a8 Z; J$ p- F- M* {9 D
wait for A_time sec
- D8 S9 b; }) ^ end
3 m, K! B+ ~1 M/ `end/ ]) r/ w5 O# z/ e4 a
6 Y) Z8 `, D" B( J8 ?& }
begin P_induction arriving4 N# p2 h' h- F7 d% `& p
if A_induct=1 then clone 1 load to P_pick1, ~) _- j& q7 s9 e) V7 e8 e
else if A_induct=2 then clone 1 load to P_pick2
3 j0 x$ L% f' t% J3 `( Y8 A else clone 1 load to P_pick39 e0 E$ S P/ g
end! R0 r" |4 o; Z( ^
+ t/ u! B3 V/ {! S/ ybegin P_pick1 arriving
8 D f( r2 m* \! x set A_i to 14 V7 ^) t4 W% t
move into Q_induct17 [0 s3 e5 Q! `1 k7 t% F
move into pickaisle.induct1# F5 A$ @2 i# |1 L' e2 S
while A_i<=30 do begin
) k0 b4 K5 t. d$ D0 I0 J' J9 z+ u travel to pickaisle.con(A_i)
# u. K0 o& L% s, n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 E& [( @8 T. Z7 I9 W( V3 M else wait for 10 sec
! ?/ e4 D) R9 D; H1 Z if A_i=A_leave then send to die
8 h6 ^2 o6 Z% y+ P else inc A_i by 1, N3 R4 `6 Z' O1 a" A# A) {5 w
end
8 [: s/ `; T* M1 m- X1 c7 Aend
/ b, Q- J' B+ k9 a
; Z0 l! t3 Y9 |begin P_pick2 arriving
3 E) ^3 F. E7 G7 e set A_i to 11
+ q- r: F0 T' q+ l move into Q_induct22 r# P) {2 _. z) j
move into pickaisle.induct2
$ c4 J: \- o) z& W1 | while A_i<=30 do begin: r% r4 s* {1 d+ }+ P, V
travel to pickaisle.con(A_i)
! D% O0 {6 `$ m3 ?9 a4 p! l. n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 R3 j& Q7 M' d$ G* g
else wait for 10 sec
, O6 u) h% N* o- j: Q5 Y8 s6 r0 ? if A_i=A_leave then send to die
# v) j- }: D& V5 H. r4 T* d4 g else inc A_i by 1
# _$ Y H& X; W$ f s1 R$ w: B1 _ end
5 ?% Y& x+ T( B" fend) k) ~8 q( c0 A. L0 P* P- L& P$ P/ [* f
' O3 Y0 T& F' k% O5 S- |$ Ebegin P_pick3 arriving
; R3 {8 V9 y4 a3 @; P" h" O1 ~" @! E, ^ set A_i to 21% k" q+ I4 I1 G- u
move into Q_induct35 w- P, c4 d$ D* Y/ _
move into pickaisle.induct3
- w" Z/ D, e$ L% k. n" b0 x while A_i<=30 do begin
0 Y9 E: r/ k+ p; J* A3 }7 | travel to pickaisle.con(A_i)
" `+ N9 t5 `( D" E+ X3 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, @8 E3 A6 F( l; U else wait for 10 sec& V( c/ w' }/ @; M
if A_i=A_leave then send to die0 c- P3 R |6 Q, w- p
else inc A_i by 11 b7 Y! c$ G) @2 D
end* T5 s9 d9 d7 `) D6 e( W
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,其它按你的 ...
|