|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" Z0 d, T+ u4 v8 ?" R. K
3 R3 y1 h6 R- J! i7 x我的问题是,在每个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 W. m3 _5 x& m* D
* C- e5 D! k+ n `/ ~. X6 ubegin P_read arriving
" R+ V% Q# \' S2 B2 _* U6 G while 1=1 do begin2 e' v6 Q! q2 B* o+ V0 h
read A_tote from "data.txt" with delimiter "\n"/ m& S1 r9 j" l( m, P/ [
read A_time from "data.txt" with delimiter "\n"
, E I! A! e C0 g! f read A_leave from "data.txt" with delimiter "\n", O. C) n) L; |- v# p% p* N. d
read A_picks from "data.txt" with delimiter "\n"1 z- i. J$ K6 H2 ^) G
set load type to A_tote
+ [5 c5 ]! d) |2 R, [. M& b if A_tote="tote 1" then set A_induct to 1
1 ~# Y3 c% V M& I+ p* G% O else if A_tote="tote 2" then set A_induct to 2
& ]* E2 m8 ?. t1 H* B/ f2 f else set A_induct to 3
7 f! Z1 g, u! G1 U/ r4 W. } set A_i to 0$ T6 i! `5 a5 q$ a- a1 m
clone 1 load to P_induction
& E3 n2 B. ]! P9 ^, k& J0 b wait for A_time sec
H7 j5 O% f1 g/ G end1 t F2 x3 R& ^* p
end
9 Z/ k9 h) a& ?/ n" A6 t/ P% O6 Z8 b6 W
begin P_induction arriving2 e" w( S5 l3 B# z4 x2 s
if A_induct=1 then clone 1 load to P_pick1
# P# y$ l0 F. W, z+ L Q' W else if A_induct=2 then clone 1 load to P_pick2
- w' |8 [# k1 y* N0 l+ _ else clone 1 load to P_pick30 K3 j$ p( Y9 h# L% M5 x
end/ |5 O, t$ N/ J
/ b1 T, y- i+ a8 ~6 Ybegin P_pick1 arriving
7 z9 u3 A- ^4 i7 X8 e4 S) G set A_i to 1/ y7 J B+ w& Q4 q2 T7 M Y3 h
move into Q_induct1
+ S. s4 Y8 {8 @; Q, N move into pickaisle.induct1* B7 Q/ d# \ e& P1 R& D- c) O
while A_i<=30 do begin4 l4 }% K* W# Q) e9 ^) }
travel to pickaisle.con(A_i)0 t( J% \; M1 f% J* y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 m8 I0 _8 {% c# E3 F
else wait for 10 sec
: R$ h# r9 b$ Z2 x8 V4 B' _% @ if A_i=A_leave then send to die% K; {5 d) T& s; C/ o2 E5 C6 n
else inc A_i by 15 p. O- l H4 C' L
end
: \! K e* N/ Q$ y# D) J) Fend& p4 b" h7 e4 s; j6 l, x4 h9 S
9 j* }' z; {9 D& x' Nbegin P_pick2 arriving! C2 q( E9 }9 r, m
set A_i to 11
6 ^ n; B5 x, I' P' I3 Z9 N% \& [3 T move into Q_induct2
: b. K* o' G4 _5 |; t! D4 f move into pickaisle.induct2
, w! ]( E9 z: Q" ~" A8 C& Q( f while A_i<=30 do begin
0 V1 g o% U" [+ J; W travel to pickaisle.con(A_i)
. c6 N/ F) S2 j7 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; P3 A j @3 m. o. R( [# E else wait for 10 sec
- r* ~" Q! V7 t& f8 ` if A_i=A_leave then send to die6 ?4 Z8 f' O. u$ w
else inc A_i by 1! T1 j, O' L) ?9 i
end
; h) ]7 ^- M* \2 C& e" Q4 L- O& @end
1 a8 P' {% ]: s; `. y& p/ @. d o' [$ B ~
begin P_pick3 arriving* i( A; j) ^' _0 w3 c
set A_i to 21
* i: P+ h3 @$ k( y7 r2 c move into Q_induct3
2 _+ N9 M* s$ i% s9 ^/ r move into pickaisle.induct3) A/ ]! t5 o1 D% o
while A_i<=30 do begin) x, t6 }- D# L& a. _* ~+ X
travel to pickaisle.con(A_i)4 T0 Z; W& q' Z2 N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# n. l8 Z* I- x else wait for 10 sec' a6 `2 O l* g
if A_i=A_leave then send to die
3 \3 ?3 w3 W% Z0 J else inc A_i by 1! e6 J9 K" v/ q+ U0 Z) l
end
+ E+ |1 y0 i1 i! k2 S* X$ s3 Lend |
最佳答案
查看完整内容
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,其它按你的 ...
|