|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% i4 T7 S5 _6 S9 S J
* W+ k9 M M- d$ \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ u" B ~5 q( B1 q0 ~0 e. Z( v% r9 E. V: d
begin P_read arriving
) P, W8 g! a0 t" ?- s4 K6 E while 1=1 do begin0 K! v) ]( ^: I% h" ~* H0 W
read A_tote from "data.txt" with delimiter "\n"
+ x, P. @. \/ F6 j read A_time from "data.txt" with delimiter "\n"
% p- C7 s/ q- s2 C read A_leave from "data.txt" with delimiter "\n"3 r( f- p- z6 I+ m# U6 x, ?$ u% a
read A_picks from "data.txt" with delimiter "\n"
6 W5 _* P5 j0 B- f5 P4 U. { set load type to A_tote
0 _, Y% w' T. [1 g0 k0 P' }; ] if A_tote="tote 1" then set A_induct to 10 s6 [5 n# g- E0 Q( j" `, Q7 q, ^
else if A_tote="tote 2" then set A_induct to 2
1 k0 q' s2 u" E else set A_induct to 3 4 }; Q% K. e: S+ i
set A_i to 0 x2 X% r- {6 K& J4 c
clone 1 load to P_induction. W$ ]" b* Z6 E6 ]4 b6 j6 b5 J$ {" j
wait for A_time sec' E. i9 l- e$ s% u
end7 ?1 `/ U8 }3 C' |
end
, N- C! h0 d# d7 b4 r1 e4 ?0 D: x5 |7 [, _# Y% z" Y
begin P_induction arriving j v. k, Q- ~& q7 ~; H- @# A
if A_induct=1 then clone 1 load to P_pick1
' r0 [1 L* ~# h/ F5 G2 | else if A_induct=2 then clone 1 load to P_pick2
* T3 M# x; H4 I, J( [7 B else clone 1 load to P_pick3
; K' }7 D; q! n- G" f- hend
0 @, z1 i" ~7 k7 N* [
; w6 a* s6 l+ d. ^' I' P/ @begin P_pick1 arriving
& c' Z e+ N6 H: Y set A_i to 1. x' B' v4 V, X
move into Q_induct1
. j8 p. |8 b" S: g2 x move into pickaisle.induct14 T1 i2 g6 e3 ?* @6 c0 @$ R
while A_i<=30 do begin/ I5 N9 e/ w/ i, O
travel to pickaisle.con(A_i) e. [% }# W0 l* i# \; n9 l6 X: @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 e% |+ u9 M7 S3 u7 w! a else wait for 10 sec8 Z C3 m2 { x' ]4 ~- e2 A
if A_i=A_leave then send to die, K" p' X ]5 a4 ~9 C8 L
else inc A_i by 1 t# ^8 r/ p9 s; K
end
( N" o3 o8 ~ I9 U; n* ?1 jend
7 L( u& r M( f( b
" K: d( _3 N7 T4 vbegin P_pick2 arriving+ K) ]1 M$ J i2 s6 t+ k
set A_i to 110 R( e" ?" J/ y _9 Y h1 r
move into Q_induct29 E6 `# T m0 j7 |* Q
move into pickaisle.induct2
/ p: c9 H4 k9 m s2 @3 u( B( C while A_i<=30 do begin
; [ v- F# a- L/ v4 I travel to pickaisle.con(A_i)
: o: Z6 h; D% x* r8 `$ B& q1 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 e$ I# p. u: v) X" r% N
else wait for 10 sec
0 } d+ E3 O$ ^1 H1 [' n+ W if A_i=A_leave then send to die
$ K, G! I6 {3 E- @+ d1 A( s% r9 L8 r else inc A_i by 1( t1 u2 a* h \6 E
end
& E" w2 R. g$ F9 m0 Kend
+ w2 l6 g6 r9 l5 x0 s! A
7 L. V9 t! [6 R: @7 f4 i5 A5 o# b4 |begin P_pick3 arriving
4 ` Z% P& Y- B# ~3 _1 D( E set A_i to 21
/ I' B9 @) {6 Q7 D4 R: ?( F! k move into Q_induct3
# r V: O; z8 b @5 F move into pickaisle.induct39 t# p4 M: A$ }! X- o
while A_i<=30 do begin: V8 d. J" |/ G- F0 F
travel to pickaisle.con(A_i)
4 Q( G" [, R6 d- V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: r: {% P# u! z6 f- L0 P8 |
else wait for 10 sec; V! Q/ V) Q8 O
if A_i=A_leave then send to die
) `3 \5 A5 @3 t else inc A_i by 1$ P- z: O+ m2 h* q; ]6 n
end
+ d" C, T9 m% P' r' Aend |
最佳答案
查看完整内容
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,其它按你的 ...
|