|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ N% v- R+ h7 v: `
3 S& y& U+ i* R我的问题是,在每个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中的数值,不知道会不会有什么不妥。' v: |+ |7 u6 [& R) ~2 h" k
+ ^% ]( d0 G( k% P- K
begin P_read arriving
; E2 k, W+ V- L2 b while 1=1 do begin; S- Y! x0 |3 i3 J# ^4 a- y. Q, j
read A_tote from "data.txt" with delimiter "\n"
" s) o2 u3 X3 t2 b) g! s read A_time from "data.txt" with delimiter "\n"+ j8 {/ e0 k& z! {; v
read A_leave from "data.txt" with delimiter "\n") y% `# Z0 P# j0 S- J, Q# ^: Y
read A_picks from "data.txt" with delimiter "\n"
; j( c& X+ e9 D! f& T% C set load type to A_tote
9 C5 [) D: c; ` if A_tote="tote 1" then set A_induct to 1
8 g5 Z% v: M2 @7 o else if A_tote="tote 2" then set A_induct to 2
/ P$ G3 c& b, @$ |% S6 L2 R% x else set A_induct to 3 ) Z- M o! S0 X) V
set A_i to 0
/ C$ q f. c2 \ clone 1 load to P_induction- g. Y( J3 _6 U1 b5 r
wait for A_time sec& @6 Z* {. j1 m) d! _
end: Q# B2 W7 m. @; G% k
end
0 |/ Q; y0 `7 r; g7 f
4 H# b$ g* Y* ?. C9 @- q% abegin P_induction arriving
; K0 Q r9 \9 i/ a8 v1 D if A_induct=1 then clone 1 load to P_pick1
* f9 m# \4 }/ f6 g; D else if A_induct=2 then clone 1 load to P_pick2) K8 W* v. s/ d
else clone 1 load to P_pick3# q2 b, o6 u' @6 N# ^4 v5 h
end0 D; @; t5 A# y0 R! P
7 J K/ W. M) z) }7 t
begin P_pick1 arriving
# e3 L* @/ z+ ~6 E M! U! e set A_i to 1
, [, i6 I. _, D" O* [# N move into Q_induct1
7 N6 ~* S% v8 t# i. ]- } move into pickaisle.induct1) F8 l" b: ~4 A
while A_i<=30 do begin
d) G2 Y# Q. d$ A7 i3 y$ k travel to pickaisle.con(A_i)
' S( H4 t1 a, @( h) A5 B: H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% }6 W9 p6 K2 t" |6 E4 M& c9 q
else wait for 10 sec
: p5 P% b7 I$ @1 |. p if A_i=A_leave then send to die( N# I* f! j8 w% l- a9 ]) }5 ?
else inc A_i by 1
! i3 c+ L0 Z' k9 C6 q end
( \: v! ^+ y* R0 Y+ cend$ P D. T5 U! M8 {3 |
. t1 t; ^1 s: A# G0 k4 \! Ybegin P_pick2 arriving8 ]! f* V5 L% C# j6 X c! M4 }
set A_i to 11
1 Y0 X8 Y8 G" h% t& o! z" p3 D move into Q_induct2
0 Q9 a5 o# A5 }8 h9 d8 n; l Q move into pickaisle.induct26 Z" n! P; L6 Y) k: q7 L' g( a; U
while A_i<=30 do begin A, e: i$ M g% x6 t( P
travel to pickaisle.con(A_i)
5 B) G' n; j+ c% _5 J2 D( n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* b B- u2 E7 x2 Z- \ else wait for 10 sec
5 L1 b0 }- x9 M3 L8 T( O6 @/ \ if A_i=A_leave then send to die
6 f) S) O Z' [) X! Y else inc A_i by 1
7 y) O8 V5 s2 h8 o end [+ y. D3 |' [7 ~9 i; O# R* i
end
( D* ^! r! Z3 n! {( h) A4 m* d' ^, l0 i4 L
begin P_pick3 arriving8 P: ^, {3 P+ ~' p5 w' e( ~
set A_i to 21. ^( S0 B0 \3 Q, q' X2 V: n3 |
move into Q_induct3# L; K9 n0 `! k
move into pickaisle.induct3& [/ e5 ^6 f. e' W) ~9 S) J, {
while A_i<=30 do begin0 `; b9 V4 e P# G" @. L8 ]8 Q
travel to pickaisle.con(A_i)
8 L! s; p4 Z! C! `' B# N, T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. r& ?; \/ V7 h2 I/ A; H8 l+ O
else wait for 10 sec
" X% |# S0 i. K if A_i=A_leave then send to die
) P5 T, [5 \, I6 J% ^% H else inc A_i by 1" U, z7 k# D% l& T1 v
end5 R3 L. ~! t6 }; s
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,其它按你的 ...
|