|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 z* B) D0 [5 t# |* U: e9 |
2 H; x8 S6 @# A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ ^; R2 ^! ?' l1 F) H8 j7 `7 k, U$ ~$ c1 {# v& p
begin P_read arriving* ~7 ?$ m5 S0 G* G
while 1=1 do begin9 Q' }5 ?7 Q4 t) G' _$ x
read A_tote from "data.txt" with delimiter "\n"* p+ B7 ]$ K4 ?* g- ^" X4 j
read A_time from "data.txt" with delimiter "\n"0 Z% ~1 q. u' a- |. N
read A_leave from "data.txt" with delimiter "\n". }) {: I6 z, m4 h, M/ t5 D
read A_picks from "data.txt" with delimiter "\n"
9 Z) Z/ C7 B$ d# i5 L! F set load type to A_tote0 L9 l6 U; l# [# \
if A_tote="tote 1" then set A_induct to 1; y8 N# e# R% N9 x; |) r5 e& F3 L- f
else if A_tote="tote 2" then set A_induct to 2; U y( y7 w3 v. T& x
else set A_induct to 3
4 x0 J0 {. d9 O2 h' s0 T set A_i to 0
+ I7 E) q6 d" X, t7 ^ clone 1 load to P_induction8 [) P. o* T8 l5 t6 C$ \
wait for A_time sec V, A" C. O8 a1 O: A5 r& i. z- H4 c
end
+ s, O/ u9 d2 Mend
7 m1 k2 E- \6 j/ v0 l A0 ^( A2 O( ]+ |6 Z+ v
begin P_induction arriving0 k, f+ C3 @; a3 }/ C6 s. _. O* Y
if A_induct=1 then clone 1 load to P_pick1; ?. r B$ S9 D( T- f: k0 ~
else if A_induct=2 then clone 1 load to P_pick2! ?( q- h" _; M+ ~/ }
else clone 1 load to P_pick3
/ k2 [8 e: q- R, x8 W6 h2 pend
) O) U$ j2 @' }. \% a& C' `
9 B' W M0 X: W+ _begin P_pick1 arriving) w( T- R! }7 G) w, R! [' G; p( H
set A_i to 1+ K/ r8 c& l! [3 E
move into Q_induct11 G/ \; s6 W% }& ]3 Q
move into pickaisle.induct1& q0 ~, [ g& H {& Y
while A_i<=30 do begin
; ~, o' F3 \/ O: a travel to pickaisle.con(A_i)
( X/ j6 H' R( [# \3 @5 O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, C* P. P; Z$ y- V else wait for 10 sec* k+ {* `- H6 }
if A_i=A_leave then send to die
" a, _$ g1 t4 o" a( @5 m6 X; | else inc A_i by 1# U/ }7 i6 s3 [. \
end, |6 R9 C4 K# H- c/ [9 k
end
( z4 ]% X, n6 q6 j- V) [/ O
: X/ P; D) }: V# \& W4 F1 ybegin P_pick2 arriving
/ V2 o& m3 ]) Z7 |! f/ ? set A_i to 11
* |; P9 z* o- A8 Y( q& X4 l! L$ e move into Q_induct2! J* T- U' x- m) g9 A9 x7 a
move into pickaisle.induct2
4 o; s* h) y) y while A_i<=30 do begin) j) [+ q* K; {
travel to pickaisle.con(A_i)- n- @! ]9 x# { X* P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 Z# V( Z L9 l4 K% [ [# z3 Z9 u else wait for 10 sec
) B+ X) s B9 ~3 ]% I if A_i=A_leave then send to die
- G. B. i7 c i& ?4 N6 k! j) j$ W else inc A_i by 1% K2 ~) D& g, g0 J, Q( Q( T" \* V2 K/ F ]
end! Z( j8 O* c. N v) G% N! o4 m
end
3 P. N5 r$ y& R& D( o
3 N& z+ E0 l! c2 Ebegin P_pick3 arriving
6 d, j1 P# p3 X set A_i to 219 R9 z6 h/ U0 d+ Q+ L% l
move into Q_induct3
* a& X$ Q7 X" z7 R3 e7 p) V move into pickaisle.induct3' [4 x3 d0 F% X. S& J7 d( V0 V r
while A_i<=30 do begin
1 f- |1 _5 w/ c& |/ D* I! R travel to pickaisle.con(A_i)( {4 P8 z9 f4 `9 f! T' A4 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p9 f/ n6 U0 P& D. L4 j else wait for 10 sec
" ]9 T& _* {' C/ T0 G if A_i=A_leave then send to die
2 a7 \9 N+ i: A9 G3 m else inc A_i by 1
# ~! C0 W! K7 y% r& S end; ` k3 ~2 g/ ~ |6 A: ]* g. k
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,其它按你的 ...
|