|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 H+ W- |+ N! E# S0 G; S. Y
/ e0 d8 ~' ?2 w0 f) `我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 m6 r1 ?2 R2 I
+ U; X D5 @2 @# L$ Abegin P_read arriving
, i' Z/ r/ }' N- H1 i: K# k while 1=1 do begin
& X( ~7 D; s* `) v! |! C& i& [ read A_tote from "data.txt" with delimiter "\n"
+ p( Z3 C6 H6 D0 h7 Z" R4 L read A_time from "data.txt" with delimiter "\n": g Y; ]3 i0 D$ i- \( f
read A_leave from "data.txt" with delimiter "\n"" F, S: t% p1 Z# i% Z
read A_picks from "data.txt" with delimiter "\n"" ?7 ?# _5 b3 F9 ?
set load type to A_tote
6 r% a' A( g& R) \) x6 h if A_tote="tote 1" then set A_induct to 1) @1 |/ N6 f+ }4 z5 l q
else if A_tote="tote 2" then set A_induct to 2
$ x9 }# m* i- v4 y; o+ a: b8 v( r% P i else set A_induct to 3 ( D0 V% {/ a2 `* b \8 l
set A_i to 0
" |# K R o+ y% F7 y( \& j clone 1 load to P_induction
" Y( {2 Z, J! K" ^. R/ l2 _* M wait for A_time sec
- J$ ?# o* I$ J# P& q% v end$ i2 t! [7 c8 n( e+ g
end& W' d; k* S" n7 N" v! P
$ J; C' E6 n. O1 O8 [4 Q. k
begin P_induction arriving
, G2 T- D' Y+ ]& _& p& `0 i if A_induct=1 then clone 1 load to P_pick1% t% H0 A3 L8 ^' R% D8 B: j4 B
else if A_induct=2 then clone 1 load to P_pick24 h7 a7 N2 k0 J0 T/ A& L1 o
else clone 1 load to P_pick3
+ t k- |8 v, b5 R& Lend- {% D* C5 L3 l; y: S
& J9 I2 p. |/ |* O0 a0 H; W- X0 G. p
begin P_pick1 arriving9 |( S0 d1 A( z4 p6 f8 o* f2 h
set A_i to 1
+ h/ s# T0 j4 G: {( p5 J3 F/ o move into Q_induct1
4 V" m# ~1 M6 L0 T) c move into pickaisle.induct1
; ~0 j; m9 N( D" J; A while A_i<=30 do begin& a2 Z: N) Q/ ~1 _
travel to pickaisle.con(A_i)
' e7 ?% o: J7 p. h H7 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 O( j3 Y- i- y5 h
else wait for 10 sec
; p h! d$ V& T+ b* G9 k2 U! K if A_i=A_leave then send to die) l, |4 g; v) Z g% x' j9 @
else inc A_i by 1
6 C) Z7 R; U% |: h& [1 O0 h, S end
+ C. H' A! C7 u. a9 G) ]; Mend3 b" N5 H1 h: f( r4 c4 X
5 v% x3 o% L- ~( Z2 N; z2 k
begin P_pick2 arriving" z2 t# c4 w1 K- G k0 i9 o9 e7 Q
set A_i to 11
3 }! M% [1 f+ x; | \3 B/ E. R move into Q_induct2
. l3 {3 f4 g8 ?) Y. N move into pickaisle.induct26 `5 [: e0 S; K$ T7 z! J- V
while A_i<=30 do begin
" H% X4 Y+ L8 E" N6 }4 b7 `6 l travel to pickaisle.con(A_i)* e9 d' f" U7 G. {) u+ E* b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: V1 `' U' y. R( @8 b* y& c else wait for 10 sec# k7 U# e% S, z& U6 M9 v
if A_i=A_leave then send to die+ g7 ~! V9 D9 F. p2 ?0 c* _
else inc A_i by 1
7 R% q' F' ^9 { end4 L' I0 z( m, V2 c& ]
end
# M3 }- F9 ~8 B9 T. ~/ y
# ?* M$ A" r6 ~+ obegin P_pick3 arriving* `7 G# D/ Z0 O; a* E
set A_i to 21
1 m6 k2 `5 z/ D* u( t5 a5 ? move into Q_induct3
: |8 e2 D" ^0 C9 e* _! k6 c move into pickaisle.induct3# T% I% r1 ?- O- Z6 c- y
while A_i<=30 do begin& k; n7 @* f" ~+ y/ i4 p3 k
travel to pickaisle.con(A_i)
c7 Y7 S6 P" U: j% P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ~1 |+ A: \: R3 W
else wait for 10 sec
. }/ Y0 Y( x3 f; m7 r8 p! S* t if A_i=A_leave then send to die
. D- H9 ]6 {5 h; d" o; W else inc A_i by 1
" ]( |1 N0 v+ T; [/ x2 x end9 Y! _7 |$ |2 e0 b! u
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,其它按你的 ...
|