|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ z9 J- P v K& S( r
. U* L- c5 J( x% P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& u; a( F C- @* Z* n$ H& N9 e j- x% L9 @
begin P_read arriving" M% C* z9 @. ^" X( H" b
while 1=1 do begin
' m. G, q e' C; x6 V read A_tote from "data.txt" with delimiter "\n". X, R3 @7 k8 J. J$ I* I
read A_time from "data.txt" with delimiter "\n"/ `4 h+ f; f+ ^
read A_leave from "data.txt" with delimiter "\n"" D" C6 _: W8 @) K2 d' `) C
read A_picks from "data.txt" with delimiter "\n"6 ^2 p9 x/ r1 N
set load type to A_tote
& y( ^5 h* r' Q' _ k if A_tote="tote 1" then set A_induct to 1' r5 s6 N1 ^# t8 o8 R7 M
else if A_tote="tote 2" then set A_induct to 25 S4 V) b' `+ }$ q8 \8 i4 I2 }0 A& Y% N
else set A_induct to 3
: H% [# j$ ~+ h. N2 t9 p* i- w7 h set A_i to 09 `7 {* A- J/ m% S5 \
clone 1 load to P_induction# o+ ^, ?8 b" t) t' ?+ r
wait for A_time sec) L) L5 L3 @' Y$ `& b6 \
end
9 J1 X- N) ?$ K8 h" B" o6 Z. Lend( I+ u& H4 ^' Q9 P2 X4 ]
3 ]7 `9 V% o/ V: [; A; H2 a
begin P_induction arriving
2 H% S+ u5 X0 K6 a7 S if A_induct=1 then clone 1 load to P_pick1/ a) R6 T7 g0 h& n4 a3 p3 { a3 I
else if A_induct=2 then clone 1 load to P_pick2
( L" q! N3 P" i( ?& B0 ?9 e9 a3 H else clone 1 load to P_pick3
+ ^3 n/ l. b6 I. O- S3 rend+ n7 v! q. Q6 A" y7 @; h M D
, E) x* L k6 i! b: s3 J
begin P_pick1 arriving
- D' c ~: E: u: J, p. P set A_i to 1
$ H) v9 ]: e3 h* V! Y% K0 @! Y3 t move into Q_induct1! Q- V9 P" n% }
move into pickaisle.induct1 a0 d, P0 X6 K% n6 K
while A_i<=30 do begin
, ~6 Z; B# E) V7 W1 o0 M# f travel to pickaisle.con(A_i)7 P1 J% }6 P* v3 j8 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ u! x c* `; U9 ^ else wait for 10 sec' S! f5 W# T. M' k+ A2 p/ b/ O* x
if A_i=A_leave then send to die0 N) C% s! Y1 Z# P6 Q: r
else inc A_i by 1
* F3 n( n! P# X% ~. S/ y end4 b9 |, y0 M6 K; w
end
& c4 }7 o5 r$ _: n8 v) {. G
4 D( A/ U1 Q* y; X( T& b" C. sbegin P_pick2 arriving+ p3 O/ z' m y ]
set A_i to 11/ b7 A+ E9 a/ c+ S- Y! L
move into Q_induct2
8 F% s. g$ B3 g move into pickaisle.induct24 P0 x7 A+ `8 J7 f" [
while A_i<=30 do begin
6 B1 D" E3 d' |9 ?5 N- \$ _ travel to pickaisle.con(A_i)
' }- V* a. z5 {) U) M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ d0 J% g; h; [% w: q/ d else wait for 10 sec+ b/ W! Z' b; I! c! I N% C: s
if A_i=A_leave then send to die5 w3 C2 I, T7 v5 A1 p) n6 B; M* @0 \3 ^
else inc A_i by 1
, F, }9 j. J/ v6 ^7 A0 V. |& w end" T0 a9 O! ^) _# s$ \+ X* I
end: Q- g9 M$ E: W& C4 q2 w( J' T, ~
+ a. V+ T3 x( r$ c9 \ x
begin P_pick3 arriving
; n3 R& T( t6 E: E% L c set A_i to 21
8 M4 S& c1 B! }8 ~ move into Q_induct3
; p2 x# H$ }7 g1 h move into pickaisle.induct3( V; q( i, L9 H4 u, b( B
while A_i<=30 do begin
+ V0 @! ?0 @7 i: R" d* G travel to pickaisle.con(A_i)
* Y% k ?/ x q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 w* {" f9 z' d else wait for 10 sec
+ o' V2 ~" Y6 l3 j6 }) i; h if A_i=A_leave then send to die
. f6 h2 Z: X; ^ else inc A_i by 18 Y" R" `5 l9 N& {0 q
end
+ P, K3 G3 e: w0 ^8 j% T% T; `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,其它按你的 ...
|