|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 n6 `9 L$ L- m! a/ X1 C: y' m& 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中的数值,不知道会不会有什么不妥。& E) x4 E- V+ ]/ x, z1 H5 I; l2 K
7 q2 p9 [! l, b' C1 W. G6 U8 \begin P_read arriving) I# m$ j4 x) L; l
while 1=1 do begin! m* U3 J8 j+ D6 j3 f/ p1 T+ ~
read A_tote from "data.txt" with delimiter "\n"+ r# V! U- {, O+ ~9 m" x) S& s
read A_time from "data.txt" with delimiter "\n"( V7 M% b3 [0 a, `, K4 C1 J# Z; J
read A_leave from "data.txt" with delimiter "\n"
6 ^, q& n3 w' v read A_picks from "data.txt" with delimiter "\n"
/ k$ D3 J/ R6 R6 \+ h! P% J set load type to A_tote! v3 ]& h6 [0 E! j& |8 K
if A_tote="tote 1" then set A_induct to 1
- n+ o& J0 D! P( m. A% k8 a& s3 G g else if A_tote="tote 2" then set A_induct to 2
& j8 o( Z4 O, E else set A_induct to 3 ! K5 S% a3 a! A; G. f% W
set A_i to 0
3 A' I+ }0 Y: q& w4 X$ M clone 1 load to P_induction
6 y7 O+ d. F6 _$ F7 h, b1 S3 Z wait for A_time sec$ j5 I- x' I3 _2 B& f8 l) E5 l
end2 C4 `, D' V! [* [: U9 s
end
8 q* s* o% r: f) X4 h+ b) `
6 j: b! |! x' Fbegin P_induction arriving0 D y" r, B: v6 y& w1 X, c
if A_induct=1 then clone 1 load to P_pick1
|; r1 s# F7 `! A# j" z- ^& o else if A_induct=2 then clone 1 load to P_pick2* _' w9 c4 }, D$ Y1 h0 ]- ~
else clone 1 load to P_pick33 g5 C8 m4 L* ]. M3 i
end
) v: `; ^( Y: [+ t0 [# G- T1 X& N
& D" ~# G% B4 Obegin P_pick1 arriving. V5 m" H& {- R, W4 R
set A_i to 1" P/ I) ?! }' {# P+ R. u) x4 \
move into Q_induct1# P' H# h m$ c! `% {( K; D
move into pickaisle.induct13 P* v F B- O; a" @" e
while A_i<=30 do begin
; H8 O1 Q( O1 F5 [ travel to pickaisle.con(A_i)' d; l9 p) R) v1 f+ m; a4 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 W# W" w- {4 I* l5 m1 W1 Q else wait for 10 sec+ m" \" d0 \# m
if A_i=A_leave then send to die+ a" v. h9 V2 K- [! `& Q
else inc A_i by 1
6 F, c4 y, F& j7 b# t end
?0 Y' o8 l" h* L/ }end
, e: N7 [- q& H! B% U' e' v0 m7 k5 q6 I4 y7 T
begin P_pick2 arriving. X9 X/ t6 h% p+ i, B8 y
set A_i to 11; v) k$ U* s- A4 s" |1 M7 }
move into Q_induct2
7 V, R! L |6 p% X move into pickaisle.induct2
) @; {4 l1 K) J. g; X) |6 | while A_i<=30 do begin
% \) m- g" z( R; T* U9 c8 U" i travel to pickaisle.con(A_i)
& l0 Z( b; c, _2 G5 Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& O6 b1 d% b2 B) S; e% k else wait for 10 sec
) A# P7 h1 K8 j" ~! E& L if A_i=A_leave then send to die( e. S' Y2 v& |/ R, G% i1 x
else inc A_i by 1, e! B1 V5 v2 x1 k: h
end( D( G [4 V0 z/ c& U) g
end8 V2 l+ e; \! T6 a4 ?3 @2 ^' v& q
8 A' v& V5 I4 ?0 y/ n. b9 R$ |
begin P_pick3 arriving
0 R) _3 K7 q5 H) Z set A_i to 21+ t. E" X; o# X1 K1 Z
move into Q_induct33 c1 p) f: ?- D$ W2 Y3 b5 j2 f
move into pickaisle.induct3
- c6 ]7 g# f4 N* Y$ H while A_i<=30 do begin o0 C2 e+ E$ Y1 O6 d
travel to pickaisle.con(A_i)/ l; S7 d1 p2 F( G5 E& n: Q T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: N/ M: i/ a! G' e+ P else wait for 10 sec0 S7 e" h2 {4 F9 G5 w0 r5 ], h
if A_i=A_leave then send to die
) S8 d7 L6 } D- O5 B3 ], C else inc A_i by 1
% v! i2 t1 ^) x6 J end, h0 h# \8 }( t( w; e$ ~) d
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,其它按你的 ...
|