|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) v4 [3 r0 I2 k/ p" Z" m8 g4 t
& m1 E" E; c. N. V# z, y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! t) K5 u* l- v) Q6 f( k8 @
2 z7 ?& Q9 D( j6 _3 fbegin P_read arriving
! y* q: r8 q* u' ^ N- _7 q; U while 1=1 do begin
$ W' b& ]. O- Z0 j2 Y" l# q read A_tote from "data.txt" with delimiter "\n". s" N4 q8 \2 e8 d
read A_time from "data.txt" with delimiter "\n"
' c+ ^6 x0 `' A# B read A_leave from "data.txt" with delimiter "\n" e" ~5 b4 e* m( ^( H3 E: h
read A_picks from "data.txt" with delimiter "\n"/ \+ H+ v' z. O" @7 q
set load type to A_tote
% @0 V2 r1 W3 u5 J4 L ?7 d: O% Q if A_tote="tote 1" then set A_induct to 15 g5 f, X! u: L
else if A_tote="tote 2" then set A_induct to 2
L, ]: |5 Z9 F' ^6 @- X# B else set A_induct to 3
4 P: I7 M5 i3 A1 L: r2 ? O- p& q set A_i to 0
' e- ]. Q4 n" N4 |( p% Z clone 1 load to P_induction! P8 T- }. i9 ~0 @
wait for A_time sec
( \) l9 [0 J3 q, s+ I! Y end
& W1 B: k) w4 w0 eend" g- B) ~9 w4 [0 \% F! P; B
( z9 t1 @5 r2 mbegin P_induction arriving# B' E2 E8 R% f1 n
if A_induct=1 then clone 1 load to P_pick1# h) K- Z, i) p" N- _
else if A_induct=2 then clone 1 load to P_pick2. C8 R0 c3 {* \6 w
else clone 1 load to P_pick3* l& l7 l, R4 w, \
end% {4 x5 i( [* t
3 y5 A7 j* u$ r* u. L, zbegin P_pick1 arriving
8 h/ i1 x0 t% C" n8 b( J+ J set A_i to 11 ~" m6 m& C" l5 }
move into Q_induct1
5 s& o' l; R/ X. s move into pickaisle.induct16 r ^% e. `% s0 o
while A_i<=30 do begin ?1 F# O. O( G' q4 b3 W: m+ u H, d
travel to pickaisle.con(A_i)
' {$ f- W" E5 ^& S! U& j! G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h( Z0 E9 @# d L) n
else wait for 10 sec! n1 q6 s, t9 e2 G9 B! g8 K
if A_i=A_leave then send to die
4 F6 c: \" \! N- o$ N" d else inc A_i by 1* k1 r: r, X, z% k7 e5 u( z+ e
end* }) X" g) H% i
end
% { s+ M3 [ _. b. }
+ f. }$ }, I* m- O4 Rbegin P_pick2 arriving
- Y _5 q" `" D- [ set A_i to 11# m$ [) _9 V, o( F2 B( _& M
move into Q_induct2
$ q1 W" C2 K# U7 h move into pickaisle.induct26 p4 h0 P; {1 A- _+ G% {
while A_i<=30 do begin
+ r+ `# a2 G% V6 x1 o travel to pickaisle.con(A_i)
2 x- D1 G0 R2 ~( I5 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 u! m p! q! S! j I: H1 y0 C
else wait for 10 sec
3 \' Q& f* p/ e+ s+ w if A_i=A_leave then send to die# U! _; e7 Y' D* @
else inc A_i by 1 J/ b4 u4 Q; g! ~3 x
end
& Y$ c. l; w! G2 Z3 U# m/ rend
2 T, V4 p, K' f
2 b6 K! [$ L. v4 M; E# u# zbegin P_pick3 arriving
Y2 K7 K* z7 ^/ F set A_i to 21
6 d8 o- X+ C. }& r$ I% I7 l6 P move into Q_induct3
& d# b4 R& U$ v5 [% d' D& b- F& a move into pickaisle.induct31 {- T9 b- g' F8 K: E. Q+ }
while A_i<=30 do begin
1 m3 `' s# R3 f. e travel to pickaisle.con(A_i)- D6 q' \* T1 z6 s% Q9 o* a' e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ?2 P# d: p. o8 b% E5 i# h else wait for 10 sec9 T& x. [* K* a! V6 F9 C, @$ |
if A_i=A_leave then send to die
0 d, p; Z+ Q7 m6 R* ~ else inc A_i by 1) [+ @4 f8 Q) {2 C {
end4 ?. N& S* z6 Z) V1 a! S2 t2 D1 N
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,其它按你的 ...
|