|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 N L0 Z( u% R- E# E* F5 O+ e% U% F2 \
. n5 g& i! h! E2 a& M0 O. l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& a. {$ J# l" h, L) e1 k m7 D
5 e5 Z i* E8 f4 t4 S1 r
begin P_read arriving
7 G: N4 s) c& F, b( o while 1=1 do begin
/ s" J' R5 x; N$ E( E6 T read A_tote from "data.txt" with delimiter "\n"
0 ?6 c$ _6 a/ ?. I read A_time from "data.txt" with delimiter "\n"
" K' b0 T" M* O read A_leave from "data.txt" with delimiter "\n" K6 z4 o- x0 Y' S) k( y/ v% ^8 V
read A_picks from "data.txt" with delimiter "\n"
1 H( e a( [ v/ Q7 b! M4 a( t) E set load type to A_tote
7 e" f+ j) F7 B8 _! L- ?& G0 M if A_tote="tote 1" then set A_induct to 1
4 h# c3 K9 P0 L else if A_tote="tote 2" then set A_induct to 2
9 c4 { a( r. v5 z, Q/ K else set A_induct to 3 3 u( T8 M' d8 W6 a9 n- T
set A_i to 04 G# r1 U: F. O
clone 1 load to P_induction
; E0 g! S: k" r- w" N9 } wait for A_time sec
8 V/ S+ M- @- _" K5 f. e end
1 L2 l$ p' g6 v7 a& ]end
2 K+ g4 a: Y: j4 h( Y4 e8 ]" C0 d5 O4 D1 v, F: f* k$ k
begin P_induction arriving
( T& u0 l: e6 j( ~/ P+ M if A_induct=1 then clone 1 load to P_pick1* z9 p, t% _$ T0 G' c
else if A_induct=2 then clone 1 load to P_pick23 p* Y& d; ^+ o9 N* G; t
else clone 1 load to P_pick3. E9 j) T/ c6 @9 {# N7 B8 N+ T
end: k8 y8 T' h, ^ B5 ?7 N
: o+ |1 F0 F2 K0 R9 C
begin P_pick1 arriving4 v3 F4 v6 n- H' B1 u3 t0 G$ |/ N
set A_i to 1
" I" r4 s$ e4 p5 v8 L$ F+ B" `+ a& |7 Q move into Q_induct1
# }7 ]$ d m/ p; @ move into pickaisle.induct1% v/ o, S! h# `& [4 f
while A_i<=30 do begin
9 ?- E, o5 X% H6 |) k6 L travel to pickaisle.con(A_i)5 O5 y$ `! c6 X+ T4 y5 x0 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ^1 A4 Q9 n2 w6 i( G5 E" } else wait for 10 sec
# f, R$ d9 U7 L4 {4 Y* ^ if A_i=A_leave then send to die# j1 I% D( @5 @. ^6 ?+ Z
else inc A_i by 1
( X: s2 O; M* B, W1 W# v j end
6 }2 Y" E \3 Fend
0 H M. I" ?- i* J" W8 c: v: F+ ]
begin P_pick2 arriving
8 t- N( s6 M0 m" A: N5 A, `3 Y set A_i to 11
( H) J; |4 |& p9 x move into Q_induct2
c. C7 x4 Q) R( O! V1 {8 q move into pickaisle.induct29 @9 G; S2 U& Z8 U+ d2 l; t
while A_i<=30 do begin
& J7 z" u, z, h. U travel to pickaisle.con(A_i)
! ^! g9 W& J2 z* G o& l) M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ o: W$ J: N7 f" j8 E" V
else wait for 10 sec
" s6 A; D# L3 e) k if A_i=A_leave then send to die; c9 `8 n4 q# A9 G0 x1 g O& C
else inc A_i by 1
2 J0 ^6 L2 L4 t0 t5 E end
i! }; d8 v% o# W* P' |end
" T# ^" r7 `+ Q! M! y8 d- s7 d1 E0 _- a2 Q1 E$ m
begin P_pick3 arriving
$ N+ R1 w8 w1 O+ t9 Q# ~3 f3 Y set A_i to 21
, W+ H& _. Y8 }" i) \ move into Q_induct3
$ N4 h/ ?$ H2 _" g move into pickaisle.induct3# O8 q5 _; y9 U) m6 O* E( s e
while A_i<=30 do begin3 s& c+ g ]2 A
travel to pickaisle.con(A_i)
8 V/ k& \% o; x% w# B7 c! X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ X1 U- |. J5 p* @) N
else wait for 10 sec" v) \( ~6 {: _" l& a6 n
if A_i=A_leave then send to die
9 O! ]* i9 Y* F C6 ?, s else inc A_i by 1/ \9 Y7 [# H( f& q
end2 f) K+ `3 @, F
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,其它按你的 ...
|