|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 Z" ]4 T3 }9 \# I0 B4 R9 N$ n4 y, T
( f0 `! ^( A+ x) e- m1 O$ f( D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 l0 K& \; f% @. \! Q# R+ j- T# i/ a: ^ g. q1 Z ]" H _# j
begin P_read arriving% c, U6 L. m3 r ]4 \6 X1 P* t
while 1=1 do begin
4 z: }1 I! ?: N) L, \( C read A_tote from "data.txt" with delimiter "\n"& H6 { ~* f( C5 h* s
read A_time from "data.txt" with delimiter "\n"
3 e1 V. j8 w; u1 I4 w* T6 Y read A_leave from "data.txt" with delimiter "\n"
|; |+ c- }# }% Z5 V% J& I! ~ read A_picks from "data.txt" with delimiter "\n"2 N5 Z0 z8 {: J8 O
set load type to A_tote3 Q6 r! ?: s3 E- {3 c$ U+ U" E: L" a
if A_tote="tote 1" then set A_induct to 1
- ~7 U2 @( ]1 Q5 E+ R else if A_tote="tote 2" then set A_induct to 2
* B y9 T4 ~; H0 X3 M7 q( C: ~ else set A_induct to 3
3 |& e3 j1 G+ P set A_i to 06 H; d- w- }1 m4 \; q
clone 1 load to P_induction4 a# x$ S+ S# F7 g* _
wait for A_time sec
* F/ L: x8 Q6 C' S4 Q3 W! J end# Z7 l; Q9 B) E9 h2 n
end# N# r' n. B# G4 r, i
$ e- i; P- D5 j
begin P_induction arriving
0 v+ x% R! [/ ~. k2 h9 Z. z if A_induct=1 then clone 1 load to P_pick1
" ^4 {' b) G$ k7 S8 r0 g9 [ else if A_induct=2 then clone 1 load to P_pick2
- Y# o! S. r6 l else clone 1 load to P_pick3& m O1 H+ j/ C
end
' Q2 R& W1 }% V* A- z7 L; N) G% G' V7 P8 ]
begin P_pick1 arriving& ]* ]9 S) ?' \+ x) v# c: g) r7 M9 J
set A_i to 1
4 K4 Z1 Z. D( y4 E move into Q_induct18 w* p4 k/ G! s# W+ l: @
move into pickaisle.induct15 o) `- o1 J- R; m$ A/ M8 G* W) b+ x5 b
while A_i<=30 do begin
( p' Q- a) ~7 H travel to pickaisle.con(A_i)7 @$ \: [8 D. o& F, P( B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& B( M6 }0 j' |, [. \ else wait for 10 sec
" n2 [9 W4 t! s. t if A_i=A_leave then send to die
% m& r4 E" i# j! _/ `* E0 z else inc A_i by 1
# ~( |8 B# L! j, X: ^6 ?4 K end
. ]7 b% U& v1 W; send6 O" K' e( ?1 z+ G* q' ?6 P2 ~2 L1 f
- C& ]3 o1 ?9 O+ y1 S9 ?
begin P_pick2 arriving
4 a3 d: k& Z$ s/ U& b7 q set A_i to 11* f4 c& N2 C! X5 {: V) x* Q. T
move into Q_induct2
) n& t, D7 @9 R2 m3 Q move into pickaisle.induct2
+ y6 |4 m8 B- |7 _& | while A_i<=30 do begin
7 I+ ~. F' R' p9 m travel to pickaisle.con(A_i)$ t* i& t7 e2 F* ~" E1 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 a4 t1 p# C! Y7 p4 G5 i
else wait for 10 sec
4 _0 P9 A# Z# [9 c if A_i=A_leave then send to die
4 [; n f- j9 B7 a else inc A_i by 1
( w" l! m4 E* H8 W6 N1 t5 S8 P- w end$ T9 y! T+ x1 N; K( t5 Z
end3 X) V. i. C9 ^0 c2 \# u$ K
5 N( B2 f' n" C6 t' m7 }! S' wbegin P_pick3 arriving1 ?2 V8 ^; j/ [) S! q/ B
set A_i to 21
9 X# V/ l+ F5 w move into Q_induct35 M, @1 h0 {5 T0 M
move into pickaisle.induct3" }8 \) W8 j) I
while A_i<=30 do begin2 ]2 R8 z* H: j& N+ @9 r
travel to pickaisle.con(A_i)* f" V$ z v) Q; o( W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: v4 W& Z: ^! y* N else wait for 10 sec" O9 n+ h* @6 o8 O# s! o* M
if A_i=A_leave then send to die
' _2 _0 ~* o# g; \ else inc A_i by 1
5 s' B5 U1 Y7 `1 U: | end
8 e! @! ?+ x# }8 u/ x& [0 eend |
最佳答案
查看完整内容
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,其它按你的 ...
|