|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' X5 ]- k4 M' `& m- \. ?) t* _- e5 c K9 p* n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 U+ {, O: e& i b- c& g
G! u- G9 |" x8 h5 Ebegin P_read arriving1 ?: u9 O1 \9 r
while 1=1 do begin
9 F. D# A7 x9 E read A_tote from "data.txt" with delimiter "\n"
9 n; U6 G: f% D- e4 d read A_time from "data.txt" with delimiter "\n"4 C% {: [6 K' ~% l
read A_leave from "data.txt" with delimiter "\n"
/ u3 p3 K: p5 B* l# ? read A_picks from "data.txt" with delimiter "\n"
1 t9 T7 l6 y+ a$ h+ ^! x set load type to A_tote
7 U$ u, H( U7 E5 U( P if A_tote="tote 1" then set A_induct to 1
/ N6 |( t7 F r2 E: T, ~: _ else if A_tote="tote 2" then set A_induct to 2
; f2 d" u4 K7 v% Q0 ~' v else set A_induct to 3
* h4 Y9 i6 E# R0 }/ t set A_i to 0
. t( i: A& W8 w3 U- q, r. P clone 1 load to P_induction
* k4 l& y; G( Y( {* k ^! [% o$ k wait for A_time sec7 s' M! o! t, l; I. J L# u
end
9 n2 x2 m- f+ n# [5 x* B' zend
. C' s% a' I* ?. ]/ e0 i; [0 R; f+ v+ R- a3 P% Q
begin P_induction arriving) A1 y# [0 o! F2 z v
if A_induct=1 then clone 1 load to P_pick1
0 W# a, \) f' {% S( C) X7 h0 l else if A_induct=2 then clone 1 load to P_pick2. M( K- d) s- T! k5 X) m
else clone 1 load to P_pick36 ~# V4 H) E0 b- h( P
end
5 \4 W$ T4 W* ^/ H+ k2 M" A" V5 T& X1 ^
begin P_pick1 arriving
7 M0 F7 O6 ]5 P: X" h1 j7 q set A_i to 1
" ]' }, T2 L9 a) x+ Q3 n% M move into Q_induct1
. u) G8 H3 F7 S h move into pickaisle.induct1
+ `9 B) v# t' V, z while A_i<=30 do begin' z7 _! x8 L* C; [
travel to pickaisle.con(A_i)
2 g- t" d$ j9 H/ J$ M; p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 x6 r8 O: o, s( b, G7 c* o$ U# A. l
else wait for 10 sec
: F4 F6 O- z* c) L" [# ~" Y6 u6 A if A_i=A_leave then send to die
' `& k$ D" p8 ?8 { else inc A_i by 1
6 A% s: V6 f/ V end+ \( T+ w* a) g l) b; W/ U. D
end
# s( C$ r3 D8 } f( ]! F( ~* }
5 J' i$ `- a& Y# r2 ibegin P_pick2 arriving
. I4 E8 @. z' m/ `+ f# v4 D9 N# X& | set A_i to 11
' e p9 g; Z- m* L move into Q_induct2
& i0 F" L8 v6 q$ i$ b move into pickaisle.induct2
9 J* U+ u9 ^3 j& F while A_i<=30 do begin
+ M \& h' t7 L7 B8 X3 ]* E travel to pickaisle.con(A_i)0 _) V6 R& C3 t( b; `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 B( E0 G5 C: T; L& m else wait for 10 sec
* N: N: h1 e& ~ if A_i=A_leave then send to die2 N- \2 e i0 U. P
else inc A_i by 1
" E4 l0 K% d5 T* Q* ^9 S: q end0 p: B" C, B3 V+ L/ Y9 s5 O
end
. i7 p+ C8 x) \: U3 D( i; w; a6 Q8 [, p( |2 M4 I
begin P_pick3 arriving( a9 o+ I: Z- Q$ D0 l4 d; C
set A_i to 21
* M6 g/ y9 G7 ~& u p7 N) `& } move into Q_induct3
8 C8 {) Y9 z e0 y8 [% W- N move into pickaisle.induct3
' F5 n& \8 {2 B. E. W while A_i<=30 do begin& v. V8 s( d6 I! s$ d4 `
travel to pickaisle.con(A_i)
+ P _- U2 y c2 ?$ |+ d, i( M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 g% ~" w. e( u0 M# _$ d: z6 c else wait for 10 sec6 o/ N/ o% W) n
if A_i=A_leave then send to die
: k% V2 _& }$ e9 y1 f else inc A_i by 1
4 b* v) V, V }' B* I end0 q3 l! [# L2 y! _( s
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,其它按你的 ...
|