|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& l. O+ O; a3 c! Z5 [4 p s& L( E* ~9 ]$ k! D; d0 |9 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" b7 {' j# I! N* \" ^9 |, M" e8 v" D2 T, X: t; _
begin P_read arriving" \( g O8 m2 y! ?
while 1=1 do begin
; B0 A! @3 P" i& E2 X" ] read A_tote from "data.txt" with delimiter "\n"; u5 L6 Y& }( N5 d6 i/ U% _
read A_time from "data.txt" with delimiter "\n"0 ^5 a3 s5 l( p: V
read A_leave from "data.txt" with delimiter "\n"4 |8 [+ z0 W3 a$ P( ~" I) h
read A_picks from "data.txt" with delimiter "\n"! x& J) b2 D" O/ F: h [
set load type to A_tote
9 l* @0 {( q1 X- u% W- U( S if A_tote="tote 1" then set A_induct to 1
, E% U9 C# h( g J+ J else if A_tote="tote 2" then set A_induct to 2
+ ^) a8 v ]( O- u else set A_induct to 3 1 V2 X8 o9 h' k7 G& H
set A_i to 0
3 w( \; i$ q; R3 ]+ s9 R6 I clone 1 load to P_induction' D+ ^# F0 m) {4 S2 |
wait for A_time sec" `" [- P. `3 t& U
end+ @! z7 ]% Y: V4 F2 O' J2 W
end' m4 s' R3 I) h" \/ g: S2 |8 L
, y+ F' f$ o6 x" q$ Y
begin P_induction arriving
0 n C% G* }) R2 d9 ~" Q! z9 q if A_induct=1 then clone 1 load to P_pick1
2 I6 |! g5 Z7 C+ b. I else if A_induct=2 then clone 1 load to P_pick2
: x- {# v, f5 h9 |$ T: z0 z else clone 1 load to P_pick39 f2 p1 Z2 o) Q- K& j# q7 c7 ?- p
end' G: ~+ f( T5 c% B0 T/ V' R y; u
5 K9 b: N f% W& G/ N" V) O
begin P_pick1 arriving, J u* `2 R% Y4 ~/ U
set A_i to 1
9 D& M9 `0 O! |6 a: c move into Q_induct1
) `3 {8 |4 K+ r) h! X move into pickaisle.induct1. `. n z `% j1 L# i5 g1 ]+ w" ]* L/ E- ~
while A_i<=30 do begin9 b! b* T; C/ b& | G; h& |' _
travel to pickaisle.con(A_i)1 K6 H' `7 Y# d% ]$ r. ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) U/ I( H5 a" T/ \ else wait for 10 sec
2 T$ Q7 t) q, j+ L/ g3 L& y if A_i=A_leave then send to die6 T! ^& X. h& R1 S- h3 X
else inc A_i by 1
8 ]- \" B+ y3 G3 d end
: `/ H% ]9 N- b6 |end2 i! [, N, H) Z0 o' K! {
& `) @- C& P0 q- P! d5 R5 ^+ _
begin P_pick2 arriving
# v3 z8 x4 d7 p8 W2 n set A_i to 11
! I8 |) c6 s0 b) X move into Q_induct2& g% R+ e4 h9 h6 I. G9 }
move into pickaisle.induct21 o4 H. \6 P- s
while A_i<=30 do begin3 b8 P/ c* Q" X; Q) W& t, N
travel to pickaisle.con(A_i)/ Y" I' Y2 P3 }" _. k" `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. [) z6 A( M" g: o3 f( t' d else wait for 10 sec5 i3 F& E% r5 Y4 B" t3 x; N
if A_i=A_leave then send to die f8 D; Y. j$ j) H
else inc A_i by 12 q' G& S# T O% |# e
end
4 e2 q3 R+ @$ {end" Z2 E) y" E5 E1 i9 L# W
" z. ?8 c( ^& nbegin P_pick3 arriving8 b1 L }& Y% a- d
set A_i to 21
7 M) k8 \+ h$ M( Y move into Q_induct3
0 r2 }* Q; g1 S. p- r; J move into pickaisle.induct31 B. N1 x! j% z- J
while A_i<=30 do begin
5 F, z, i" t3 c6 M' [ travel to pickaisle.con(A_i)( Q, d. M7 i# N6 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: h4 u2 a0 Z% h- g7 A else wait for 10 sec
) ]* S. J/ C/ K9 m9 O* ~2 ^% h if A_i=A_leave then send to die9 z% m7 v; D; t L n
else inc A_i by 1
& \- p- e. [! V( g) E. [7 V- O' u end+ o: i2 ]& J* V, U' v
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,其它按你的 ...
|