|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 ^ u0 ~# u8 f) j/ n
2 m7 q4 m, q* a1 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中的数值,不知道会不会有什么不妥。
! {: K8 y# H5 @& X8 E0 x1 b% G
! J9 w5 V4 _7 H4 B" Ybegin P_read arriving$ B O2 f4 I1 `- S5 [$ T% M
while 1=1 do begin: `6 z$ i( r: W; u+ v
read A_tote from "data.txt" with delimiter "\n"& n+ F+ h+ U2 k0 K4 Q, M7 n- [
read A_time from "data.txt" with delimiter "\n"
. m. X1 C+ }8 | read A_leave from "data.txt" with delimiter "\n"% D- G2 q. q5 ~8 f, Q! N/ E
read A_picks from "data.txt" with delimiter "\n". R! I( f4 s5 M- `9 ?
set load type to A_tote
& e2 D/ G5 B9 J, ? B if A_tote="tote 1" then set A_induct to 1' m: A; G3 c* g7 }, P
else if A_tote="tote 2" then set A_induct to 2
( Z2 x2 F- \% ], ?( o- l+ K else set A_induct to 3
) V5 w! G4 A: j$ P, r; T( y set A_i to 0
; f, m1 H. w/ d clone 1 load to P_induction
. ^7 }( W& p- j* c wait for A_time sec' ~1 G5 n) i$ s
end
; p" R, w. S9 [- F8 f* x' `/ ~8 _end( n, L, H7 ?* a0 Z6 A& o
9 c( j" q. X1 Z ibegin P_induction arriving
& J# z9 H. @* d0 O/ b: B if A_induct=1 then clone 1 load to P_pick18 B4 D0 x: m! d. k" {
else if A_induct=2 then clone 1 load to P_pick2$ {3 `$ o6 V( F% J& K7 B
else clone 1 load to P_pick3
; b) }/ t6 a, {6 t% vend
8 Y5 b: L. O0 E$ I/ U/ b2 G! X% A' |* Q) I0 D$ i3 c' ?
begin P_pick1 arriving
1 S' Q# I! @: T5 R: f+ k5 K set A_i to 1
( ~- i( C5 D$ A |3 {9 A ~ move into Q_induct1$ {2 a! k N- w# T2 f
move into pickaisle.induct1
# n+ |) ~8 g# ^( E* \ while A_i<=30 do begin7 q0 q& x- d# |! v& c& U
travel to pickaisle.con(A_i)
9 G* ?: ?! a4 V" `% a' r. U8 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ q$ N2 c% H; f2 r) [6 i else wait for 10 sec
0 Q& S3 @) Q/ r# Q3 }7 T) Q- n if A_i=A_leave then send to die
. _* U! }5 p) C9 S else inc A_i by 1
$ x0 Z+ e& ~0 j* r$ s; T end
' H9 k9 B' j8 u- c. ?: ?9 K* Cend. F+ T' J% |6 P2 h) q$ _$ b, B y
# i# {) p' p! c5 kbegin P_pick2 arriving
, `5 u8 |7 ~7 O' L5 m1 f set A_i to 11$ | o9 `, N" Z8 `
move into Q_induct2
4 i) z6 O+ h) Q Q2 p move into pickaisle.induct2: ^! D: e, V+ L1 f: \1 E: r
while A_i<=30 do begin
/ j8 X( Y) c1 ]4 p travel to pickaisle.con(A_i)) q, y- S: s& m. S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ t; W3 \ v3 r( a2 A4 A& v: f
else wait for 10 sec6 y3 k3 K7 a' }: F6 k; ^. M
if A_i=A_leave then send to die
( ^7 _! o$ O3 {# G' O% u% E8 Z else inc A_i by 1! X. i( s4 O- j. ^. m# I
end
7 q# |+ x+ t: s6 }7 T. Fend
$ N; m8 d$ c% [* P7 z! K; T, Q! a ~5 v
begin P_pick3 arriving* q! d3 h m7 e. E- N
set A_i to 21
* ?6 e) n9 z) I4 \- B# F; W: _( A move into Q_induct3
+ y3 X% O) w0 e1 d5 @" U- ? move into pickaisle.induct3; O0 ~2 u$ R. P% V' V4 h
while A_i<=30 do begin$ a0 t0 f. A! U: N
travel to pickaisle.con(A_i)! s0 F$ E5 Y' K- `3 T. Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Y% k$ g1 P6 q: Z& N4 s
else wait for 10 sec% z+ X7 c; K; o3 Q g
if A_i=A_leave then send to die. ^( ^% k6 c! N
else inc A_i by 1
5 P; g, a D4 E$ ] end. m% E% K, x! [& r# }7 R: A
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,其它按你的 ...
|