|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. _) I6 c5 d* c9 }$ b: r0 M6 n0 x- |
7 {% a% ~* k' L% v我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 k% z/ ~. O- r. M* a8 c3 P- ]
9 H+ q8 L0 _# Y Zbegin P_read arriving
$ m6 a, \# ~5 \; V9 b4 c while 1=1 do begin; z$ y( r( E* T6 y" Q! Y2 s
read A_tote from "data.txt" with delimiter "\n"
: w1 E$ q! S# C7 k' G0 C' J read A_time from "data.txt" with delimiter "\n" D, g/ F* @! [# h
read A_leave from "data.txt" with delimiter "\n"
6 P2 u' s) Y# b1 f9 g read A_picks from "data.txt" with delimiter "\n"( u# j7 E0 u* h- N
set load type to A_tote4 Z- u# L B$ m. t, x& \% m2 U9 I1 N
if A_tote="tote 1" then set A_induct to 1' H: x8 s( @; U: c5 p+ \9 W/ b' ?
else if A_tote="tote 2" then set A_induct to 2
. A* A& w' d7 a& J* P0 [2 Z( ^ else set A_induct to 3
2 P* D3 p C* I3 U, ^ [! B% D set A_i to 0
- g3 V- E3 g0 I: M+ X1 I7 c" u clone 1 load to P_induction! M' ?0 C% U1 W7 J. _
wait for A_time sec- G& Z- j A/ ^+ z$ o1 C
end$ N- q/ L( e9 N5 Z o
end; D5 g* w: p a) }5 s
* E" o) ~/ R4 y" o, R
begin P_induction arriving
. D2 S; `- V0 |- m' m if A_induct=1 then clone 1 load to P_pick1
( W8 J. L( a9 c/ d- o else if A_induct=2 then clone 1 load to P_pick2
5 D* B5 w3 B( i5 _2 @0 G else clone 1 load to P_pick3! S7 n1 ~4 [( @) `
end
, p$ X- T3 G+ x
/ _( I7 H& l2 `: V* Cbegin P_pick1 arriving
: O h c+ F( I0 _2 k! b+ y* G set A_i to 1
N$ Y: c0 g' r1 e( r3 ? [ move into Q_induct1$ E) V' L& V- k- y
move into pickaisle.induct17 G4 ~' T; d& Z, J* S- a
while A_i<=30 do begin+ W3 O6 F5 K* h: X- T
travel to pickaisle.con(A_i)
1 }0 e) z+ _4 t' ^! W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- W- Z: Y' M1 H( b% ~6 e
else wait for 10 sec
( @: ]( X4 I \2 a if A_i=A_leave then send to die+ {. s" v* \, ?% F) S8 ^
else inc A_i by 1
& Y4 L' Y k) \) e T7 m/ A end
R- E. [: T, ]6 O7 p- a3 yend# J" l& p$ m! H7 ]2 e+ N
* R9 b9 D \3 V" Q
begin P_pick2 arriving
4 `$ V6 J, Q: f! V9 i$ v* Y' H set A_i to 11% n$ t$ l8 c2 W( O/ q
move into Q_induct25 C) j( E3 y; N2 E# }
move into pickaisle.induct2! Q5 x4 F5 n- G1 W
while A_i<=30 do begin
& R9 Z" R: J, R! [3 ` travel to pickaisle.con(A_i)7 O, y( i# ~$ d _" h7 E. W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) d* K1 Q! w; C. O. }
else wait for 10 sec5 g: X" S7 C% L& z. }
if A_i=A_leave then send to die
) d( z8 P6 L$ s8 M( B( F3 S else inc A_i by 1
( ?; `- x2 l9 v- c- j/ v end
' Q7 W; x* ?2 e9 U. Q4 Wend! V! i- y. r+ N* v% q4 [
4 s' C0 l4 n! h3 h3 Z) Jbegin P_pick3 arriving
7 d* @5 y- u, l7 n, d+ \4 K, ^* [( i set A_i to 21
3 v9 P! H8 E% f& \% r move into Q_induct3
# V- x; w9 m: q move into pickaisle.induct3
3 F4 K R9 \: K p: y1 I while A_i<=30 do begin
7 Y7 Q* ]5 V4 x5 u/ j travel to pickaisle.con(A_i)
0 o) m7 N) b) ~8 g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" H8 `8 m! e2 d. Q+ u else wait for 10 sec
F; ~# z; X7 q) q" N: P( N, ] if A_i=A_leave then send to die
2 a. v l5 R% ]6 y else inc A_i by 1
$ ^) C% R# P8 I9 ? end
7 _. r4 _2 f( U9 iend |
最佳答案
查看完整内容
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,其它按你的 ...
|