|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* F7 f& H# u9 B4 O" h2 k( | z9 A% l$ [( S5 C; @0 l+ z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: j4 r, A0 f! {+ ?
4 A: d# g) f( _: u" N
begin P_read arriving
# @: C# V4 }: G6 p9 e8 t while 1=1 do begin
2 Y# i5 X; T" \8 W7 n read A_tote from "data.txt" with delimiter "\n"% H. v1 u( d( n3 V0 Y
read A_time from "data.txt" with delimiter "\n"3 P$ q6 M! r& ]8 K* e7 p
read A_leave from "data.txt" with delimiter "\n": q, @- D7 @( u2 P# F5 w
read A_picks from "data.txt" with delimiter "\n"
( M* \0 t2 c8 u- t+ ~ u set load type to A_tote4 t1 r& x% f4 |' z; h; n* S z O+ B% n
if A_tote="tote 1" then set A_induct to 1$ u- K9 W7 e9 O( n/ d$ k. a% T
else if A_tote="tote 2" then set A_induct to 2% H1 a. d& R! h+ ^7 k$ @' w
else set A_induct to 3
2 R3 w" \- r/ K: e6 W1 h set A_i to 0& x7 a9 ^: W7 k9 s4 r) U/ J
clone 1 load to P_induction
! N0 ]; `: x. ^" n2 S) r0 B% H# o wait for A_time sec
' k$ S0 A2 T3 x- A end
# T3 a/ f7 M2 c9 q6 Z- N xend8 r' P+ _5 M- e. r
- m, u( x% W6 I9 M" C
begin P_induction arriving9 b4 C8 p7 t( U2 |; g1 G- L
if A_induct=1 then clone 1 load to P_pick1
7 O3 Y; z+ j) Q: ?' X' E+ x5 \ else if A_induct=2 then clone 1 load to P_pick2
. K# x6 O6 m9 M# @) S5 { else clone 1 load to P_pick3
+ S4 b) n# ~, l x2 Send
4 O3 M8 C' n4 }
: p2 Y) A( y" t7 ~begin P_pick1 arriving8 c* x; ?9 O3 `# w$ Q ^% w2 y0 @/ S
set A_i to 1' i" M. m) r" J
move into Q_induct1
3 ~* C. p. @) B- H1 D move into pickaisle.induct1
8 E( y2 t5 f7 p: u, j3 p while A_i<=30 do begin" [ S. h# G/ Q# @8 d; a
travel to pickaisle.con(A_i)
+ w; e9 u- Z V% v/ a% f! \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; B8 n1 Y. V$ G. g4 S' Q else wait for 10 sec. [/ D, J: t; M6 I4 u
if A_i=A_leave then send to die7 F3 |7 M3 f1 K9 J, t" a+ s7 g4 W
else inc A_i by 1
& }( d) Y+ u4 O6 d' n0 s end1 ~: R5 [. a9 r2 e C& ~; u' N
end! d9 ^; F8 I! V9 G5 m
( S7 t% ?( S. Z
begin P_pick2 arriving
# h1 O6 X$ E& A& h/ K9 C/ d# x set A_i to 110 _1 Y4 R. p0 ^3 r
move into Q_induct2) E0 ~* f' p& J! d3 w# U
move into pickaisle.induct2
0 u3 w' H" l4 c f0 c9 v while A_i<=30 do begin
( C! V% N3 e! a' L" X travel to pickaisle.con(A_i)
- m- F) e+ r; W- T7 J" c% Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 H% t3 T$ p: J
else wait for 10 sec
! H+ l$ q( ~- h7 W( y1 e6 P if A_i=A_leave then send to die2 e4 O" {5 ?5 k8 G
else inc A_i by 1
- v6 u0 W8 n' ~ end# ]0 f2 R, U3 E: k: o* @
end, w* q" \3 X8 u
: p7 q2 x5 | s+ j! d( x9 D
begin P_pick3 arriving+ g* }- Y7 G4 x2 H# ^; P% h% r& ~
set A_i to 21
% {4 A6 J' R+ c8 H4 U3 Z$ U move into Q_induct3
8 R/ n H1 L7 X+ b$ x* F( Y, j- c move into pickaisle.induct3
0 L. j1 t' {7 b- y# l while A_i<=30 do begin
# ]& k6 a& t& ~! C$ w$ q# A0 J3 } travel to pickaisle.con(A_i)- z1 ]" C" c9 q" y0 G, O" z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% O6 [" f9 Y0 {2 k. `8 x3 {
else wait for 10 sec
8 T) y9 h2 a' C' `9 D8 l if A_i=A_leave then send to die' R! R+ ~6 M% K b4 I
else inc A_i by 16 R1 ^7 ]8 t8 i+ }$ i' d$ [
end
' J& U5 n& N( W' K H/ r3 Xend |
最佳答案
查看完整内容
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,其它按你的 ...
|