|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 @( a$ I3 F4 n1 k
' s9 [" ?7 a; O' S: ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 R t. n+ |8 o1 F2 W5 {1 i' M$ \
8 L' Z! t2 v. Abegin P_read arriving
$ Z% j: l4 d( R& |3 _ ]' I' P) B1 l while 1=1 do begin5 A' P" c) j) r* K9 R5 O
read A_tote from "data.txt" with delimiter "\n"
5 H( ^: e8 H3 G4 o% J read A_time from "data.txt" with delimiter "\n"
S8 X h" H2 C( P& K. t4 G read A_leave from "data.txt" with delimiter "\n"+ p% j2 K, ?6 }0 w1 e: \; d
read A_picks from "data.txt" with delimiter "\n"
1 h( {* ^7 @' H3 a5 A3 }2 t$ s" E set load type to A_tote1 S& z& ^" U: l6 I* \" _' p
if A_tote="tote 1" then set A_induct to 19 f2 x z: S( ]$ e5 Q) c% Y
else if A_tote="tote 2" then set A_induct to 2
8 _8 o8 _3 v D9 p, p- b else set A_induct to 3
) q. y$ N" t9 W! }7 c/ S set A_i to 0
( R" t' \; w, @' H, W$ D- y clone 1 load to P_induction
+ h: g E# O1 S+ W; x% c wait for A_time sec
# B9 H7 s" c4 `. h end, O/ w- Z i- u
end+ k8 v. _+ b1 |* o$ G2 N" K* {% C2 I
0 { ]4 Q/ U, ?! ^$ F! t/ Nbegin P_induction arriving
( l, a/ x% B: ^' Y5 y: k if A_induct=1 then clone 1 load to P_pick1
1 t9 Q D' {; k* B# q% V& l" [ else if A_induct=2 then clone 1 load to P_pick2
6 x Y6 ?- i. Y: g' G5 a else clone 1 load to P_pick3
6 E' A1 x" ?/ h; B0 Zend- {8 ? i- u) S" q5 ^
( F" {( @' O& o" [7 t6 Y
begin P_pick1 arriving
2 h: R M1 L8 M) W/ o' s$ X set A_i to 1
7 J7 ]' R: W# ?+ X: G! m move into Q_induct1
+ @* f- S8 d6 t) u& j" X move into pickaisle.induct1; s9 b. f- B' x) e; m; G
while A_i<=30 do begin
4 A4 Z" A/ h. H+ I travel to pickaisle.con(A_i)
, o( ?2 K m, Q, N/ |% j, C, ^+ o: D7 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( `: X, b q# u; H else wait for 10 sec
, k) k0 Q( P, c" ^+ e% ]# i if A_i=A_leave then send to die
# ~4 ^7 N% G. `, j( Q- |9 e else inc A_i by 1+ w9 E+ h/ a' K
end' T( Y9 v5 J8 h+ B2 P2 I) f
end8 d1 I0 ]6 {0 C( O
: {! b' N3 K& Cbegin P_pick2 arriving; z5 `, J$ e0 p- z
set A_i to 11
8 N9 G% j+ Q o% p; ^ move into Q_induct2& D/ B6 P6 N# s
move into pickaisle.induct2& J' N6 V3 P0 o
while A_i<=30 do begin
% y h* q0 A6 K d9 b& B7 C' K travel to pickaisle.con(A_i)
: q# I% k: q! }( C ~* C$ X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! G+ R# i+ i; H, V
else wait for 10 sec
( m8 y, o7 y( d$ I if A_i=A_leave then send to die: J( ?7 M& y0 f) r" e) L3 F3 _
else inc A_i by 1
9 N/ f1 w; g7 z4 E' N* d4 _ end9 T: K& o2 m$ I, w/ O1 }4 l7 d5 S
end
9 R% y8 @9 c/ |1 |5 r6 K' W0 u: J% V& J3 c( J' r2 Z
begin P_pick3 arriving2 s4 O5 ^- {5 ^/ A+ a
set A_i to 21
2 O$ H' ]5 K8 f6 f( C move into Q_induct3% N+ a4 \" _$ S7 Z# W7 e2 |
move into pickaisle.induct3- H% J7 S! o0 K% \+ h0 i) N, _% v
while A_i<=30 do begin
7 Q8 Z- h( j9 t& z' N travel to pickaisle.con(A_i); p; m) H# i6 O0 _/ B, y: X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) `9 {1 x+ k* w# |3 {8 J
else wait for 10 sec
) _3 k4 d( l9 |0 F* v& n if A_i=A_leave then send to die
2 [. S5 f6 `4 x else inc A_i by 16 b% C7 v) d3 f" i+ ]
end+ v- o5 [ E: s; B4 u
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,其它按你的 ...
|