|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 r. g3 S; r5 a. D! V( _/ p
- {9 N) |$ `$ i* N* D/ `, |$ A: `3 N) {我的问题是,在每个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: |* a. o: _3 |
- d; s) r) Y! K4 T. U8 W" i
begin P_read arriving) Y' l6 f; M5 }. b
while 1=1 do begin
% j! |/ i, F9 A$ r- N0 C: k read A_tote from "data.txt" with delimiter "\n"
! H8 c9 ]. ]5 R: s" L; y- V read A_time from "data.txt" with delimiter "\n"
2 m: z! i* b' }, C read A_leave from "data.txt" with delimiter "\n"
; e$ \8 n6 }" g1 `" f! j/ ~7 U6 A read A_picks from "data.txt" with delimiter "\n"
|' [# D" s& @' l: C0 C: T. J set load type to A_tote
* J! d) w9 @# q if A_tote="tote 1" then set A_induct to 16 a+ f0 E! Z$ m* r9 O
else if A_tote="tote 2" then set A_induct to 2; p# W* G# x" X) e1 O) w1 d
else set A_induct to 3 $ Q7 j, c8 l! B" }' \
set A_i to 0
( m" M% ^) v X clone 1 load to P_induction: A( x2 ^& R* O% W
wait for A_time sec+ s/ t ^1 s) S- b) ^9 @4 Y+ e
end1 \6 O$ u" H, i. V; P$ }. C7 \
end
* U! Z" a9 Y/ O/ Y" J! V- ]
& K- e$ y* G/ hbegin P_induction arriving
2 v! s; G4 a1 g2 W$ S if A_induct=1 then clone 1 load to P_pick1% O, f* v7 k& c( F0 p9 s: c
else if A_induct=2 then clone 1 load to P_pick2& p* s1 I5 Q# C3 y- _ c0 X" a
else clone 1 load to P_pick3
4 X1 q9 P( E& T7 Zend" r5 y+ Q! Z/ [- [2 |" n3 h
7 f5 ?4 c% J; d' h! i$ {
begin P_pick1 arriving9 E4 W' n3 _6 G& k
set A_i to 1
; B: W( v7 G5 X& F% ]7 _1 v move into Q_induct1
. V& ?# ^6 X, F6 B) q move into pickaisle.induct1& v, p& @7 C4 h' M5 ] W
while A_i<=30 do begin
5 p* o! b' f& E. Y4 m travel to pickaisle.con(A_i)/ z) D6 N* {% h2 J* T! N$ d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
^) g) r3 Y' q M/ ^ else wait for 10 sec5 f! o& L: @# n. s+ _- [0 t* G
if A_i=A_leave then send to die
1 s& f. u, m( W; @" |2 x) h else inc A_i by 1# Z' A" n6 h4 _1 m
end
x$ a3 D' q c9 l( _6 ^end
/ h6 F: A5 ]9 x: B2 \8 t$ ]2 b4 D% }1 R# m( H8 e* H* f
begin P_pick2 arriving! P7 C) c5 ~6 i+ T. g% _2 w2 a9 ^
set A_i to 11
- y- j. l2 C9 P move into Q_induct2# v4 O% S/ V- k" z
move into pickaisle.induct23 F" ]4 s2 y0 T/ p% W A! ?" y5 r' ?
while A_i<=30 do begin* k7 {3 ?/ I$ o7 V5 |- q
travel to pickaisle.con(A_i)
! M t2 b l7 u- K( ~$ M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ v( Y2 ^7 R. k* A% D- `
else wait for 10 sec& F4 I8 p, p$ D- Y3 o% {; k
if A_i=A_leave then send to die8 d" H M5 n3 K5 h/ {# b: Z8 w
else inc A_i by 1# H: \5 j+ @$ C; E- z, ?, i d
end) m9 |; D1 N6 g3 @* B( I
end
! }5 O$ D: V, w; ?8 t7 F7 m. d4 Q( }) a1 ]
begin P_pick3 arriving
/ w* d8 U2 m6 F- s! [9 B set A_i to 21: _; e) ]* X! n5 `) k
move into Q_induct3
3 A2 n1 F/ ~" ]0 O9 i move into pickaisle.induct3* f \5 a- R$ W- X, \/ l8 B& C
while A_i<=30 do begin% m- G& j' r7 e/ G, x9 s" g# C
travel to pickaisle.con(A_i)
0 O7 i1 s/ N0 M5 @3 u9 D L8 `, O { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( J g( Q3 W) S @- I
else wait for 10 sec
& p4 ~% U; S* I# W$ C if A_i=A_leave then send to die
7 `! k0 M& I. l! I else inc A_i by 1
+ R2 K% H0 p1 K; m! Z end% u! w- i, E; C5 t
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,其它按你的 ...
|