|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! x* h" u: K- h0 B
% A5 Q2 W' ` u1 ~$ B# r我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ a2 M# s4 ]# P. g$ y, A/ Y
' t! F, S% x+ c1 [8 X# e4 I: wbegin P_read arriving
6 L7 a4 ]) q$ Z( ~! Y while 1=1 do begin
3 n- y9 X1 z) l d2 w |( c read A_tote from "data.txt" with delimiter "\n"
6 l: U! s- I: X' C$ ~, e0 v2 F1 n% Z- I read A_time from "data.txt" with delimiter "\n"
2 X9 m1 i" b! Z; c read A_leave from "data.txt" with delimiter "\n"
5 S0 x5 r# w W3 E9 v$ ]. R read A_picks from "data.txt" with delimiter "\n"
8 F+ J5 T4 C4 V set load type to A_tote4 d2 U5 [; W" I5 o# s- _
if A_tote="tote 1" then set A_induct to 1' T9 X" F3 T5 b7 X" ^, n# y! F
else if A_tote="tote 2" then set A_induct to 2" c! f$ G3 E4 ]) ?, r1 z
else set A_induct to 3
2 h; ^7 @0 o) `( \, d set A_i to 0
! o! J/ }, M- Q+ w, u$ v clone 1 load to P_induction
0 x0 w L u1 ], F. e wait for A_time sec8 C3 U' k: j) q9 c' b. C
end* P% W! ?: i- t7 `" l* T
end
7 p- t, A' r7 F6 i& c" T' ^* L6 ~! t$ E. W
begin P_induction arriving4 F, p" h- t! Z$ |$ d
if A_induct=1 then clone 1 load to P_pick1
! X$ s0 c( i) e" w0 X8 V- j/ w- b6 r else if A_induct=2 then clone 1 load to P_pick2) h! r( T! c( \7 A+ Y& `
else clone 1 load to P_pick3
) \$ X/ f. R1 u) T" k+ w! Q# I; Kend! q: r0 y4 E z) t
% A/ Q8 C& _( b3 n
begin P_pick1 arriving
- X) [5 R1 R* G; p/ D set A_i to 14 L# v; n$ c' p
move into Q_induct1
7 e! R$ c; c" C6 U move into pickaisle.induct18 n3 Y6 k( p+ c( v( E/ l4 a* @- X' |; E
while A_i<=30 do begin: `+ F* k: |7 A# x
travel to pickaisle.con(A_i)7 Z5 S' s% V. u5 f1 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 Y' `; r9 @1 p4 k
else wait for 10 sec' @: P9 f+ J2 Y1 a) Q, Q
if A_i=A_leave then send to die
3 v1 x% Y- \2 u+ c else inc A_i by 17 {* o& w" L) T+ p
end
- E& p6 k0 D7 Q/ `end! [9 v* w8 W, [
8 z! x0 {+ W J$ V3 Gbegin P_pick2 arriving; B j3 \6 R, E% U. c
set A_i to 11( n! B' E3 R' v& ~
move into Q_induct2
]% {9 |) R, F0 W0 p0 b move into pickaisle.induct2
0 _3 h: {* u: f; r! \* N while A_i<=30 do begin. H( F: E$ m @
travel to pickaisle.con(A_i)
# ~: L( p+ X5 Q" s" m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 O+ P- D! A1 G, |/ \+ z
else wait for 10 sec
- B* t6 w7 s5 M) ]" m) p if A_i=A_leave then send to die
- Y3 j) S, n! C! R8 P) M! J2 L+ s else inc A_i by 1% s" h: s1 z) F) @0 s$ `1 ?3 T
end
& d' f$ H' S% z' Q3 b# n4 [$ Y+ Tend
/ v- T! E( P# f, b/ F5 t K$ {6 e$ Y9 g
begin P_pick3 arriving
4 V* L. e; Z9 i E C set A_i to 21' o+ k1 |' b- M& w
move into Q_induct3
+ a" w, q9 F' h5 ] move into pickaisle.induct3 @! \# v) [. ], W0 n% j
while A_i<=30 do begin+ k- l% @, f- Y& k
travel to pickaisle.con(A_i): j0 z2 ]- O- t' g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec X) \( a' R5 n! B& f% v
else wait for 10 sec
$ h* ]$ K' n" n% z) K* [- y if A_i=A_leave then send to die
8 {% \% V9 u* s v else inc A_i by 1" x, T4 ^% z: u, R' B0 {% N4 `
end
4 G K. q0 _3 w" Y8 \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,其它按你的 ...
|