|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% P0 a2 @( h, D4 Y' H. ]( e4 y: @0 u3 C8 m8 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 d- {. R/ A9 r% {) B) v
+ S7 |7 s4 Z9 S: ^) h7 W
begin P_read arriving9 J8 n% I8 s4 E
while 1=1 do begin: K" s2 l( ?! R4 U3 I* Z
read A_tote from "data.txt" with delimiter "\n"
- d, x( Q! \/ v, v1 g. C read A_time from "data.txt" with delimiter "\n": W8 X% o) B+ {, j
read A_leave from "data.txt" with delimiter "\n"
: L0 Y U: d/ F read A_picks from "data.txt" with delimiter "\n"# N5 ?0 Z3 k! _
set load type to A_tote+ C; P. e, l6 G2 M3 x2 k, U
if A_tote="tote 1" then set A_induct to 12 o5 C! k) d( N) n3 u& ^ w
else if A_tote="tote 2" then set A_induct to 2: b1 m3 T: |& l& ~8 W" u3 V
else set A_induct to 3 n8 t( e- V( b! p- H$ ~& r
set A_i to 0
$ z% h! }% x9 V# `1 r7 l* C( Z* d) ^ clone 1 load to P_induction/ Z# ]4 N; m8 r0 ?5 T/ F _- |( `1 d, L
wait for A_time sec
' x. P, e9 {8 y3 M ^ end( N; w! _$ W0 G3 D
end5 ~. i6 D4 T5 z% ~
1 m/ X! }4 H2 Y# b) n5 H. obegin P_induction arriving5 T# e- j1 J4 K8 ?$ c, d5 y% P1 n
if A_induct=1 then clone 1 load to P_pick1
" M8 _3 y) _) K+ x else if A_induct=2 then clone 1 load to P_pick21 ~7 F: B* C6 j+ K" I
else clone 1 load to P_pick3
+ M4 ]$ D, \% z, q6 Uend
4 @* X) Q* m/ a1 v6 P M
' {) c0 ]7 S: x9 ibegin P_pick1 arriving8 o; G* i% S5 |8 C( P
set A_i to 1+ }+ u% D. g2 J0 _7 y8 A: w
move into Q_induct18 g# M6 ~' {( w; b
move into pickaisle.induct1
p& w" m! D9 x; _: M% t while A_i<=30 do begin
% q6 g7 c9 x) {5 \$ i travel to pickaisle.con(A_i)
, s" F+ B0 \! \5 B4 D, T# ^/ k7 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" g4 w( ~* b! W, U/ M6 {
else wait for 10 sec1 v# w) c: Z b C
if A_i=A_leave then send to die! ?) ?& I6 `% O+ P" v8 z b9 f
else inc A_i by 1; G. q' ~& N4 T. y
end+ A4 G! N* U+ c
end3 M' g0 |. U4 A
! C9 v8 e" @2 p5 J3 I$ @! P% C
begin P_pick2 arriving
5 r) u& q$ z0 o' q set A_i to 112 {% v. _- N( K
move into Q_induct2. h: Z; L( j/ t7 o! a- y/ D4 S/ i
move into pickaisle.induct23 v- w4 C7 W8 Y
while A_i<=30 do begin
- _9 f! @4 z3 ^" e( C5 L travel to pickaisle.con(A_i)" W" q: a5 n& m5 N! b& J" V* n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. O) C5 m( p+ q. F$ P: M
else wait for 10 sec
$ W3 f' N4 p9 @& }3 r U% { if A_i=A_leave then send to die
) K6 r$ f9 P) W0 Z. D else inc A_i by 1, ]6 D: R9 O/ x! w& F
end
- x$ T4 }# v3 K) l8 e4 q5 ^5 ]end
( p) L0 q% Q6 o+ ?3 u8 |) g) D: C1 t9 C
begin P_pick3 arriving+ f. V; J$ f. s9 V! k. y
set A_i to 211 X+ s% [, Q1 K; x" h" B
move into Q_induct3# f# I- c5 t! F% q+ x+ V: y$ b
move into pickaisle.induct3
& [- K) M& u. d4 n& b4 x while A_i<=30 do begin; j1 B% z+ c% P' I5 i
travel to pickaisle.con(A_i)" L1 o9 m5 `+ ? { ] `% V3 X$ O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ~3 o* V% P% b2 V6 V0 u% s
else wait for 10 sec1 @9 p! j b: c F( }$ Q" M
if A_i=A_leave then send to die" K, x, `$ t6 f/ m1 r3 F
else inc A_i by 1
3 s4 V0 J7 g2 X5 j7 H6 v$ m end! X7 l6 ^. j) p* l2 ?: w1 x
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,其它按你的 ...
|