|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- n& T1 B, K7 L0 @8 L
6 L N* G) }# {) O; D8 J- w- b
我的问题是,在每个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 t6 J" `; P# Y7 s6 o7 X) h
$ D; r% @& Q2 p, G. G& x% ~+ mbegin P_read arriving
s! y! ?" E6 Z+ [% ] while 1=1 do begin, _* z. H: a3 E$ J) K+ Y! x
read A_tote from "data.txt" with delimiter "\n"
& R& J6 T4 |( t+ P6 } read A_time from "data.txt" with delimiter "\n"3 R4 K0 m8 l1 d8 ~- S0 `) ^6 [7 m( @
read A_leave from "data.txt" with delimiter "\n"
# K1 b0 Z% w4 T7 [8 L; } y7 }. e6 U- t read A_picks from "data.txt" with delimiter "\n"
5 _# j$ d! x3 G1 z: B/ O9 P set load type to A_tote8 [6 N7 x# b2 J J8 P* i( i
if A_tote="tote 1" then set A_induct to 1
' j! M1 B# z- k$ t# ~4 W else if A_tote="tote 2" then set A_induct to 2* F8 Z0 a0 K# Q
else set A_induct to 3 ) m' ]- [$ V1 U# H* k( `# c
set A_i to 0
6 o% J+ m$ p$ v& S/ x) j! Y clone 1 load to P_induction
# K, b {8 ]7 F wait for A_time sec
9 N9 J- l2 j& a! n( [( f end
! q" U/ C% i5 Y9 C/ Fend3 V0 F* ~4 C! m
8 K' j, X8 \1 d. f5 M4 Q! G" V2 |
begin P_induction arriving+ ?* g' t( ?6 |6 C
if A_induct=1 then clone 1 load to P_pick19 v0 ^; w9 i8 D
else if A_induct=2 then clone 1 load to P_pick2
4 y" @) k. ]0 D Q else clone 1 load to P_pick3' g. b B. S3 |+ Y9 c z
end5 z& a _8 {3 O
0 ~9 ]% L/ x$ V/ G+ j+ l" u h6 j
begin P_pick1 arriving2 `, n# a( P0 |2 J, `6 s R
set A_i to 1
, _: ~2 w+ ]! q E move into Q_induct1" X. i. V" Q8 b+ V
move into pickaisle.induct1; j$ k4 A1 w& M7 I* P5 s
while A_i<=30 do begin9 q I0 ?( c" A
travel to pickaisle.con(A_i)
6 A2 ]4 y# d z- ^1 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F4 c" n% c# e3 V2 Q- ^
else wait for 10 sec
; r& G8 `- c$ {6 ~ if A_i=A_leave then send to die; O8 a0 @2 [5 I& T
else inc A_i by 1
6 G& e$ m* k9 Z2 X5 ] end& h% |3 ?9 ]6 H9 q/ N
end
7 X1 \% r1 O; E* m+ t/ x5 C
* A. z: S' @# M3 ]/ rbegin P_pick2 arriving
8 K( ?* b2 w, a6 J9 D7 o set A_i to 11
* T* c% L0 d: a' w6 ? move into Q_induct2+ K2 L+ J6 \/ s- @, {
move into pickaisle.induct2
' \/ [; h! a4 h9 C6 j while A_i<=30 do begin
6 R G9 V7 g5 s! \# ~ travel to pickaisle.con(A_i)2 E/ n, Q1 \4 u) r8 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 [/ x* q; b$ t9 Z/ P
else wait for 10 sec
5 K( b- H" h; b3 s" H3 J. @: ~/ d+ D if A_i=A_leave then send to die
/ ?9 V6 U; Q3 O else inc A_i by 13 m( M5 E2 W; F- M
end+ P7 x% E: @2 t& [7 k$ ?% s
end
2 }: b) X' A4 N3 @+ c& r# n1 `- n2 c3 U* k
begin P_pick3 arriving& X2 l- a* Z7 [) b+ t# t
set A_i to 21( u0 R0 g( N! [0 ~
move into Q_induct3% F0 ]! u# b4 Z% u5 D! k% E/ P
move into pickaisle.induct3
3 L' X4 G/ ?! e1 a! V1 s% R6 V' w while A_i<=30 do begin
, g7 }' W6 [ F) w* E8 z- ~! e travel to pickaisle.con(A_i)) b( N% i9 k Y9 P' h: R$ w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec r1 D2 b8 x1 S0 F
else wait for 10 sec( o) G, A) P% }) c: [; H5 Z
if A_i=A_leave then send to die
" ^* _2 j8 H4 N else inc A_i by 16 P) k& d x% p
end
) H) w- e( A3 kend |
最佳答案
查看完整内容
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,其它按你的 ...
|