|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 g4 r& e5 r5 a3 H) z" |* A n: b; ^- t* X$ V& ~7 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: z3 c. w: z* {+ _( w9 ]/ t# k& A4 v( P
begin P_read arriving
) V' ~; ?1 r' ? while 1=1 do begin2 S3 {7 u# b( @! ^5 ^ t* {
read A_tote from "data.txt" with delimiter "\n"
; j# s( G' f# B$ _ read A_time from "data.txt" with delimiter "\n"3 c- a( v2 N1 K
read A_leave from "data.txt" with delimiter "\n") Z# l1 @+ ] |, N2 f, `
read A_picks from "data.txt" with delimiter "\n": _+ R: X& P, b' A' a2 t3 ^
set load type to A_tote }& {1 w" y0 L" p. p- d
if A_tote="tote 1" then set A_induct to 1! L, C% J0 }2 @4 z
else if A_tote="tote 2" then set A_induct to 28 a# L- d! I& |" I V3 Z
else set A_induct to 3 ; b; G1 e, C. p5 c- x k
set A_i to 0" y6 [' z1 V( Z6 j
clone 1 load to P_induction! P' h8 |0 V! Q- o7 ]5 O* ~
wait for A_time sec
, @) J( ]/ i M2 |( n end
1 z2 }& |" f G) z3 c, u+ {9 \3 _; kend
5 |9 a" A1 }7 K1 @6 l u g* G+ _2 D, o" J2 m T+ L9 w
begin P_induction arriving
$ \. v. e& H2 v' L. F if A_induct=1 then clone 1 load to P_pick1& n$ f3 {8 b. }. ? V# R& d
else if A_induct=2 then clone 1 load to P_pick2
4 v& K7 _8 Y4 ~- O$ a else clone 1 load to P_pick3
/ }2 C5 c$ R+ o+ ]3 |; r- Xend
- w) H2 G6 L& Z) \
& ^8 s- E# H9 F( [; ^begin P_pick1 arriving I1 T9 f8 k6 q# e& S7 w9 |
set A_i to 1; l: R/ A8 ~$ I# n4 F- D
move into Q_induct14 n" W3 k5 C9 k
move into pickaisle.induct1 ~ b) ]8 Y% W. j* W2 ^2 p9 y( C5 V# h
while A_i<=30 do begin
5 R8 ~; f0 e) e" ` travel to pickaisle.con(A_i)
~* B" Q- T* m- g3 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: H1 x+ C3 m+ {+ S9 K. Z' ^. Q else wait for 10 sec
t6 _* M4 e$ x3 Y1 m! ] if A_i=A_leave then send to die% ]1 l% }3 E$ ]8 d% @2 x6 u' T
else inc A_i by 1
' V% A' \3 ?& ~4 r( x end
; O5 ]9 _2 N0 p: gend
: x+ y) i0 G0 s# N
% q9 N0 _/ o8 e/ A l$ S0 Abegin P_pick2 arriving1 @0 u% T9 d& y; n/ I
set A_i to 11* ^: n2 u: u& ~5 F2 U* N$ {
move into Q_induct2
! L. C# l' ^1 P- @% G6 P" U! r move into pickaisle.induct2
: Z$ {7 [# u" g( N2 ] G) l/ q while A_i<=30 do begin* \) M# o& B* {
travel to pickaisle.con(A_i)( r2 q7 ~) b' S9 V+ y: O! K$ W, D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ e% w6 r9 V& e. ?( e, P else wait for 10 sec
6 q! D c {6 R/ P3 f& f if A_i=A_leave then send to die2 z5 K9 a( Z+ W! _
else inc A_i by 15 n. y5 w) {& Q+ q" V$ V
end
, y" a$ x# W4 Q) _. Tend) @7 Z7 k4 W2 F* c$ W9 t8 u/ b/ R
1 E$ \( ?/ s# `9 |0 L& R! G
begin P_pick3 arriving
; G8 B/ h! x3 m, x; i* z set A_i to 21: e$ \, L3 d! f- O
move into Q_induct3
0 H0 q% `* w$ k1 i! C% l5 T move into pickaisle.induct3
7 a2 a% Y, d/ O2 x while A_i<=30 do begin
& B7 D k7 J& q3 y* I" X travel to pickaisle.con(A_i)
2 h% u7 B' r, h7 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& u% b- K( ~) c2 L. A' t* r5 ?
else wait for 10 sec
) w, ?! _- R1 B% Q# g if A_i=A_leave then send to die
' g2 u) U7 d$ u9 j$ n3 I else inc A_i by 1( _' f- x9 C# U9 }
end
- E+ C: R, w4 ]5 U4 v* o' }* 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,其它按你的 ...
|