|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 X/ P4 K) d* x9 s+ }6 Y! X! W: D/ 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中的数值,不知道会不会有什么不妥。# e: O( ?0 G* {% N _$ _( V1 }
, O' b. v( A+ d& ybegin P_read arriving
' K; U, N% d7 C* j2 A while 1=1 do begin6 n& Y3 @$ m/ u* P
read A_tote from "data.txt" with delimiter "\n"4 W7 K" i, A3 U G- b7 o
read A_time from "data.txt" with delimiter "\n"
/ Q" N6 B) ? {* \. `! d/ l- p read A_leave from "data.txt" with delimiter "\n"0 R' a) p6 k/ k" | C
read A_picks from "data.txt" with delimiter "\n"
$ c' l' n- j$ O6 b, J8 m set load type to A_tote2 o2 g1 s8 V0 m- C5 O8 {( D: Q
if A_tote="tote 1" then set A_induct to 1$ d$ M$ F! L- U. ^
else if A_tote="tote 2" then set A_induct to 23 K# S# @ F/ O$ @/ t
else set A_induct to 3 2 o/ ^& L! n9 h( n s
set A_i to 07 \/ P3 l4 a. n1 g2 `
clone 1 load to P_induction
$ N2 W0 Q$ K0 q1 { wait for A_time sec' ]! |+ c2 U4 w2 A+ Z6 X7 |; \
end! R3 T9 R$ l) u8 m
end* a2 C0 R& o/ c7 l! ]3 H, _
, v# m9 i, B: ?begin P_induction arriving
# @6 ?$ n1 j$ V+ N* B if A_induct=1 then clone 1 load to P_pick15 H! t% f+ B1 H9 s) @
else if A_induct=2 then clone 1 load to P_pick2
8 T0 }2 q: P G8 K: j else clone 1 load to P_pick3
G* k; j6 ]* kend
% I1 [) t# e0 Y" j, J2 J/ c2 }0 Y" R, F5 p5 m6 Z5 h2 P$ g# e
begin P_pick1 arriving
8 _+ O* _& N% v set A_i to 1' q7 J4 c4 Y8 B5 i$ J
move into Q_induct18 q( {8 D" j/ q
move into pickaisle.induct1' k9 F0 j8 q2 N0 f) j" c
while A_i<=30 do begin
0 {6 }* u7 c( b travel to pickaisle.con(A_i)- u9 N+ T. M }# j$ t$ a- P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 t3 M0 Y: y& n& Y2 Z4 ~
else wait for 10 sec
3 K) L9 p0 \3 T if A_i=A_leave then send to die3 v7 I- L, `0 {" ^
else inc A_i by 14 G9 T" C) F2 `( u0 [: R! g8 c
end4 e d3 @0 a4 P7 U
end
3 \$ A2 b1 Q& r6 W: U4 L7 `$ _
7 d; f" |% |: a1 j- N& W" s! ~begin P_pick2 arriving- {8 x2 Y. w D8 q2 ]. ^1 _
set A_i to 11& H5 @% T% S2 B# H4 ~( u
move into Q_induct23 d% b5 {4 [5 c# ^% P4 h: d
move into pickaisle.induct2
3 U& t: u4 V2 t7 W" b while A_i<=30 do begin
1 M6 c8 X& f- B% m travel to pickaisle.con(A_i)% J: I2 X" D( k# V. T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ?4 [! p y& g& L$ a8 Z' E3 A, x else wait for 10 sec. w! ] q* \, p" V" G) i, m
if A_i=A_leave then send to die
7 m$ F `3 _2 A' ] else inc A_i by 1
) T) F7 e- b/ ^: V, P6 k0 o end
& ^8 M5 N* N7 F7 @) Vend- W ]; p. O9 o
. o" ?: G7 r% O9 u& [begin P_pick3 arriving
& l# r* l$ T) f2 O" X set A_i to 21) l2 b3 h; M$ H* o
move into Q_induct3& T7 G. H: z! {& b
move into pickaisle.induct3
0 b4 o6 U$ c$ E/ c3 r7 ~/ q: V while A_i<=30 do begin3 ?- R4 I) b: P' T+ s V; j+ @/ h8 R
travel to pickaisle.con(A_i)
, [$ H+ i: X0 T& f& K" F; n" u% T( e4 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 |/ w( u; P ? else wait for 10 sec8 U7 X8 ]8 }& ^0 O9 b( F* O
if A_i=A_leave then send to die$ m3 U0 W* h) `) C
else inc A_i by 1
! Y J4 P2 O. J end
* g4 l- A, t5 {/ ] H9 B1 \1 Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|