|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 v+ V' s$ {& Y! |- L5 |1 S. ~- ^/ e, a J9 m' {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( k* R' c( W x& E
9 n+ y+ C( s$ c' ?$ V, kbegin P_read arriving# e, s, _1 o( y. a) J+ V
while 1=1 do begin
7 d; \1 q% d" U% S7 Y/ b4 { read A_tote from "data.txt" with delimiter "\n"% f+ M. x& ]3 n! z, }3 a$ Y
read A_time from "data.txt" with delimiter "\n", H( G2 m( P2 r1 ?! M
read A_leave from "data.txt" with delimiter "\n"+ _/ d4 Q+ G4 q: N+ T/ k9 n
read A_picks from "data.txt" with delimiter "\n"
8 i8 E0 V9 `& z3 ?3 e* f" ^& ] set load type to A_tote
3 F% ^& ?+ h5 y! I( y! j if A_tote="tote 1" then set A_induct to 1
/ c5 t0 m7 d! e6 x/ U else if A_tote="tote 2" then set A_induct to 2
# C* P; a1 G, l2 q0 J1 O2 }$ T else set A_induct to 3
" k$ d; Q5 }1 l4 R4 s! y t4 p X set A_i to 0
* p! z9 H6 K9 X5 L' w# O1 s+ ^ clone 1 load to P_induction% @- N! \( M% Z" f2 J) O7 q
wait for A_time sec
8 z, ]1 v7 O4 k; n4 C end# [8 z& u6 m6 T1 J p
end3 b$ }+ A$ d8 G) }4 l( Y/ h' t% l* k# q
# C6 o r, `+ g9 X
begin P_induction arriving
& q* a! O- k0 j if A_induct=1 then clone 1 load to P_pick1
& H; P4 O9 B# X4 Q5 s; b else if A_induct=2 then clone 1 load to P_pick2
) K, Y8 l( }5 Y$ l$ \* N/ _2 h+ G else clone 1 load to P_pick3! b; w4 Q1 e- a9 O( M& }
end( M# _6 N$ {' u9 I; U; Z' m
; {7 h: i. e- T. C2 w& Z7 Pbegin P_pick1 arriving
% E/ K. ]+ K! h; t0 S) ?; F$ u" x set A_i to 1
$ u3 h8 ^" P; x9 ` move into Q_induct1
! B3 p/ n) j* H3 r move into pickaisle.induct1
2 B+ V2 f, p0 Q while A_i<=30 do begin" |( Z( I }1 P( P2 Q6 @
travel to pickaisle.con(A_i)* _) n$ r3 Y# T" C! V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 H# I P* O( {0 V8 |
else wait for 10 sec' ]; ~6 l9 \' f/ l# p5 {5 i7 w
if A_i=A_leave then send to die' m8 K4 j3 P: t' j! j' b
else inc A_i by 15 I1 M; @5 D, N- |
end2 D) w7 h; @# }+ D' f0 w6 m5 u# R
end
! e- j ]5 p. b: V d% K* w
0 G) a7 F9 q1 f2 @ w- obegin P_pick2 arriving
. }; q- y9 M/ l# D set A_i to 11
* v+ V/ v W% d+ j move into Q_induct28 N& a' a0 ?' ?1 p) b4 V% L
move into pickaisle.induct2
2 k+ f' S ?$ U" l9 M$ u while A_i<=30 do begin6 r6 }( D3 V1 X% [) ^: I. z1 X
travel to pickaisle.con(A_i)
0 Z$ D; Y& a* C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ _# W1 r( P. T" P else wait for 10 sec
; z( Q0 K! r3 u& `5 |% k if A_i=A_leave then send to die6 c$ L; X9 @3 b& h! M! Y
else inc A_i by 1
" H7 S8 N" a6 }+ _7 N) B4 ` end
4 {5 i, s3 c! h E0 ^: dend; L- w: D+ [6 l! C4 ~
) A2 W. L6 F' J y/ Xbegin P_pick3 arriving
% e" ^% _( q5 b* H set A_i to 217 {7 {4 B( M9 ]! O& f" b
move into Q_induct3
% T( t. S0 S; H; s& Y3 V move into pickaisle.induct3
5 K# ^1 w1 J" Q% M2 M" T! \( S% F while A_i<=30 do begin6 P4 p$ ?' ?, V9 m* z5 W/ X
travel to pickaisle.con(A_i)7 ?& K- p7 P# A0 L: W* p9 ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- o% Z }, r5 O: R
else wait for 10 sec
1 C2 l* s; ?' O7 H+ t if A_i=A_leave then send to die
6 [6 {& V1 z) b( n0 Q) {3 o/ _ else inc A_i by 14 Y2 j8 D4 ^5 g% d) [
end
( A2 X; I/ i8 g( P# H5 _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,其它按你的 ...
|