|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ H: ?9 D) u0 U, U {
( F! d8 W& b2 P2 L1 G# ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 d W" F d6 j( T
, a) a; p* `. k3 Y- V, b/ Dbegin P_read arriving
+ N' H' y% e: Q* I3 w$ ~( u' Q while 1=1 do begin2 p+ z/ E. m6 W. {* d8 a
read A_tote from "data.txt" with delimiter "\n"
- |9 `5 U3 Q$ Q5 c6 ~ read A_time from "data.txt" with delimiter "\n"
) a0 P5 K8 x" d6 U3 R* G read A_leave from "data.txt" with delimiter "\n"
0 e- }# z6 q+ f* b. c5 a% v+ ~ read A_picks from "data.txt" with delimiter "\n"- z! K" Z1 w! R0 L* P2 {
set load type to A_tote0 U2 B% [2 B" \8 ]' U
if A_tote="tote 1" then set A_induct to 10 P) r' {& _& I( m8 R# p c
else if A_tote="tote 2" then set A_induct to 23 {$ n& }8 m+ q/ {) P" x# k
else set A_induct to 3
- [8 w6 L. J6 i) z J; T set A_i to 0
) Z$ W- R6 |" T3 {1 w clone 1 load to P_induction
$ K- [6 {# Z7 k- Z. _ w! i5 K! v wait for A_time sec
! q' S0 `( g+ L* x; ~7 G9 K5 c end
0 o c2 w$ P( iend
( x ]5 D7 w( \2 x7 @; S3 [8 N8 y* u% I8 e0 W' @8 g+ ~: G
begin P_induction arriving
' \1 l9 A( g1 u, o if A_induct=1 then clone 1 load to P_pick1! v5 a, ]' s: h' c! S1 ?
else if A_induct=2 then clone 1 load to P_pick2
- D) H+ I$ T) }9 T else clone 1 load to P_pick3
: ?% b' ~; ?4 G$ E, _0 Oend7 N( R+ o/ E% l/ }. H5 b% b
0 v. D' I4 P' g) @3 u1 F# D! ?begin P_pick1 arriving
4 R" A5 C4 W. E! M8 U9 |& }) } set A_i to 1
/ c3 X6 F8 t! U; ]. z) L( z move into Q_induct1
- X' z( Y; N S. Z3 d7 t. |5 V move into pickaisle.induct1. U2 K; N; J* H8 M+ a9 ]
while A_i<=30 do begin9 F* W4 _* v6 J: S! @: i4 w& a
travel to pickaisle.con(A_i)
) V! p) _ W9 A2 @' z, n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 P8 f' ?9 v) ~+ u else wait for 10 sec |! Q- g; A5 R6 o$ u9 t
if A_i=A_leave then send to die+ |0 F$ E7 O- D; z8 U9 t/ s
else inc A_i by 1
" M+ s" F- G* L6 _ end8 e3 @- G; c) p0 x
end2 C8 ~7 c% d! h& t( K: |
2 g" V% @) q6 |' j: ]; p
begin P_pick2 arriving
3 Y& U% f4 [& ^' r% b" p3 J; W set A_i to 11
M7 \3 C$ [$ d& n3 H move into Q_induct2
4 S8 n) k: J2 b# { move into pickaisle.induct2" |" ?% z/ W% z4 r' o
while A_i<=30 do begin
8 I) X: ^" D# C" B* _ travel to pickaisle.con(A_i)5 \+ @5 o3 G$ `# [- @1 x1 T1 S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, Q4 @0 {1 e: e else wait for 10 sec+ n% x( l3 F7 t" Q' Q
if A_i=A_leave then send to die: R: Q* s6 H! J- p2 f2 @
else inc A_i by 1- S% V1 s, a$ Y9 N- w
end# k) u! G/ V' g5 _' J, @* ?
end) Q, e* Y: a' J) o5 q7 x+ @$ t
" M' S2 T% o' T3 ^5 u2 obegin P_pick3 arriving
) \5 u) I) I \8 P, i1 I/ d. Q/ G set A_i to 21
& e% Y4 c0 [# u$ I5 B: t; d5 U, D0 r { move into Q_induct3# b/ Y1 J' l0 Z |* N( W: ^
move into pickaisle.induct32 g" g* a: w' q* X/ `3 m5 u
while A_i<=30 do begin; D! S) c) E) D9 K9 i/ K8 O3 f
travel to pickaisle.con(A_i)5 L, M8 W5 H: O4 @/ ]" a! v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 b. q5 ?+ S$ F" ^ else wait for 10 sec
; G0 \8 b O+ }' K' }: f if A_i=A_leave then send to die! i" |5 O& ]- F- X, r" `! d
else inc A_i by 1! d. X# B" i8 x! _
end
6 j5 O2 a9 R+ l/ hend |
最佳答案
查看完整内容
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,其它按你的 ...
|