|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% w1 U& H( s* D& k) N( ]6 y# W& J8 Q4 J E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ f8 i, n' r. j: L! L; c: k
+ t ~3 L. ^& n, y/ Ubegin P_read arriving
4 z2 A' i/ R( ]$ d; \, Q3 p while 1=1 do begin
" c* F6 n5 F- N. y* @6 d read A_tote from "data.txt" with delimiter "\n"
" u: w( W" l& t0 V# e# c2 l read A_time from "data.txt" with delimiter "\n": `- F+ a; H; p7 W$ Z a! k
read A_leave from "data.txt" with delimiter "\n"# V G% I. _/ d
read A_picks from "data.txt" with delimiter "\n"5 G9 t* A8 ]$ P
set load type to A_tote
5 D$ g5 R3 O! D" C2 n' W: d if A_tote="tote 1" then set A_induct to 1
% g2 h: @6 G& ]: ` else if A_tote="tote 2" then set A_induct to 2+ f+ m( U& c2 ^/ E( r
else set A_induct to 3
: [: a7 l; U0 L' P: B5 H7 C; z+ _1 L set A_i to 0
3 H( k3 t7 P5 V3 t7 b0 [+ ^, I- i+ r6 a clone 1 load to P_induction" S* H" k4 S, }; Y* i# o. s
wait for A_time sec) F8 q" V/ u6 D& a
end
: ~, `- x9 h9 A# V! Q) wend
1 m$ m8 q9 K& @% W- h. S8 J" l
begin P_induction arriving
7 ~4 V8 g; H; b$ D+ q) B if A_induct=1 then clone 1 load to P_pick18 z; @- K1 w' q2 g. s
else if A_induct=2 then clone 1 load to P_pick2$ Z7 @$ p2 H4 e3 T) j
else clone 1 load to P_pick3) k. E% u8 s, b6 ]/ j
end: U& E/ \3 J8 Y6 U. W: S6 `* ~& _3 c
" d$ D5 l$ M4 s2 z M& U
begin P_pick1 arriving
0 o" H/ x# U+ e8 |$ _( ` set A_i to 1* F) m. @8 o- e. A, ]- G/ h
move into Q_induct1
) J2 Q2 n" I* p% N, |# a move into pickaisle.induct1' w- _: w. F: p7 j, S) R' Z, g
while A_i<=30 do begin
% \" q( {9 s4 Q& F \/ s travel to pickaisle.con(A_i)0 ~5 U7 b B2 B1 Q% I7 M/ c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) H! L0 L; A% P! k
else wait for 10 sec: ?8 R( O U+ m0 i! n! ~- E
if A_i=A_leave then send to die
& k" l1 i0 v, c% S else inc A_i by 1
/ X( N: P7 W( |8 T* E% R9 k& h end
0 ^% g' [* z4 u1 v' K, r5 L$ oend: k6 j7 g a; t+ C# K
4 a1 z% Z; G2 S& Kbegin P_pick2 arriving0 I1 b3 b5 g2 H% ~# ?
set A_i to 11& T5 I6 d& `4 l2 w! I Z/ B7 ^
move into Q_induct2
1 n" |: p& P. M; ? move into pickaisle.induct24 G2 c1 S" J6 X
while A_i<=30 do begin
% d( y) w% @/ G7 [! n+ n travel to pickaisle.con(A_i)
/ a0 o2 g6 {0 y8 s) b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) L1 F. g9 Y5 j
else wait for 10 sec0 V. M9 f0 \3 W1 d
if A_i=A_leave then send to die/ o) y6 ?) e8 A8 {1 K5 W1 B, z
else inc A_i by 1
; K; \; N/ Q6 ^ end9 v$ I' d2 t9 W& G5 O7 k
end
& y) Y/ H( Y9 v4 y0 q! b6 _
# f2 F$ R9 `& r, lbegin P_pick3 arriving
8 R! c. p% B' [* R9 Z& Z$ I set A_i to 21
$ E4 L( P) n E1 b6 f move into Q_induct3
$ r: D$ L4 q% P" i' V move into pickaisle.induct3
1 F( ]5 `2 t* r" y. L while A_i<=30 do begin
' o" Z* E+ g- i! l travel to pickaisle.con(A_i)) b! Q# {+ o- s9 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ v: h5 o q# O4 W' x else wait for 10 sec
% }; ~7 E/ h& h: l2 v if A_i=A_leave then send to die+ ~* `+ U$ Y, L8 j
else inc A_i by 1
4 d5 T# S3 p# F8 m0 I end
6 E# p$ a/ Z8 [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,其它按你的 ...
|