|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: e% x3 |- H0 m& T
+ Q0 r7 e( R: @; ^ A% 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中的数值,不知道会不会有什么不妥。
8 M) D5 s# f# ]# \$ z+ N
* Z, ^8 |6 P& {$ A/ Gbegin P_read arriving* u Z. C# r' a* V# w
while 1=1 do begin
( t" v# _! \3 M( p read A_tote from "data.txt" with delimiter "\n"
/ y" B2 @" D% p read A_time from "data.txt" with delimiter "\n"9 d6 d8 N9 L% b& |: \6 p
read A_leave from "data.txt" with delimiter "\n"2 M! L6 g1 D8 ?9 Y- h
read A_picks from "data.txt" with delimiter "\n"4 k6 Z$ l1 ?- B9 c' T
set load type to A_tote- |2 ]2 L$ T) e+ T5 W# l
if A_tote="tote 1" then set A_induct to 1: Z: k$ z. v5 \$ s* ?
else if A_tote="tote 2" then set A_induct to 2% e, c- w1 y, a
else set A_induct to 3 ) f3 }3 `: e2 `
set A_i to 0. \$ ~7 l& j2 S' Z
clone 1 load to P_induction0 t7 j7 @6 M' x# Q, K
wait for A_time sec1 t8 O% G3 z0 z* K
end
5 m5 R5 ?5 |) aend( R$ S" y: |) v8 L/ W( G: L
2 }& u0 k$ @: o- M2 @
begin P_induction arriving- V9 J$ ~3 k5 F1 ]
if A_induct=1 then clone 1 load to P_pick1
7 x7 E# Y2 ~ \8 n: `8 z else if A_induct=2 then clone 1 load to P_pick22 g4 h |% I. K! |2 p9 ~, M1 g
else clone 1 load to P_pick38 G, V4 L B u ]
end- d1 z+ t- D5 X$ Y
( n" _* r3 }- x7 x9 T0 ^/ h
begin P_pick1 arriving
; f5 }6 v$ y: B3 \% T set A_i to 1- n, _. A9 j( K6 o; L S
move into Q_induct1
9 W, D" H" w; J9 i% j( L7 D) {( w+ t move into pickaisle.induct1
. a+ y" Q. P/ r3 e) F while A_i<=30 do begin
7 R# [+ D- _2 u" q' n' c/ V; N6 p travel to pickaisle.con(A_i)1 U! k9 f G4 v. _6 H8 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 K$ C/ s" f! W% p
else wait for 10 sec
, q) n& d N+ {8 t. g. p9 } if A_i=A_leave then send to die# ^9 S! m- S' g7 I) a; B
else inc A_i by 1
* D0 Q) X; `0 W7 j7 f' M end
8 P7 v) }7 J) T7 Q# {6 Lend
4 B9 f: Y" P& y3 d: w( K
. _. c5 ]( D0 H7 z9 l" H! Gbegin P_pick2 arriving! ]2 H7 X) {- H; Z
set A_i to 11! o( C# ~) T3 X
move into Q_induct2
+ W, \0 c! `) P move into pickaisle.induct2/ E, s& ]/ E8 c! U9 X( m- h6 \7 a
while A_i<=30 do begin! ?. {- q: z3 S6 r2 K* c f+ o/ `8 W
travel to pickaisle.con(A_i)
" l3 o& }3 t$ J& F. @1 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. A& m O- o4 }# q else wait for 10 sec
5 Q, B X" d! ?8 s* R/ Q9 ] if A_i=A_leave then send to die
) p7 {2 c+ M/ k) C t' C4 z else inc A_i by 14 O2 d# H6 n1 M$ m$ a, P6 T* y
end
7 N# k5 \# E# F: B) m) ]end0 ~6 }' I) y/ p! D5 x
' E i" z& \; H! h8 e* Ybegin P_pick3 arriving7 O# k& n. C [3 W- H3 b: b
set A_i to 21! f% }( d m- S7 w; i: M
move into Q_induct3
C* @+ X$ T1 Y. @, ?$ P move into pickaisle.induct3- J {3 F2 [, x8 T4 v1 L7 D# [
while A_i<=30 do begin& g8 e* g# K2 I0 O- G: V
travel to pickaisle.con(A_i)* j) [+ C4 ^" Y, \8 ], _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k/ p5 L; l0 X) L7 b) w else wait for 10 sec
! ^- x! p: \. C2 B1 E if A_i=A_leave then send to die
- W* Z1 F. A1 j6 H( a/ e else inc A_i by 1
$ s- |8 n4 X) D/ k end/ V6 D7 Q* b$ X3 d, 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,其它按你的 ...
|