|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. s$ h3 }0 H1 D+ }$ [* B7 {
# Z; ^" O. c+ n9 Z. y t我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 U3 _( i. a+ Q3 W$ a$ B
! M4 v8 A& F0 S5 t6 \% ?4 _- ?begin P_read arriving
) e& r. B7 E3 C; X- Y: H while 1=1 do begin
- |4 N6 n) T" @" T' ~ read A_tote from "data.txt" with delimiter "\n"" L r& @: U& H% I& k
read A_time from "data.txt" with delimiter "\n"! x; d/ V3 _% T& A9 i, ?& @6 @) h
read A_leave from "data.txt" with delimiter "\n"0 \. U0 G% W1 g5 j7 |
read A_picks from "data.txt" with delimiter "\n"6 F9 e( n1 P7 O7 K
set load type to A_tote: Q& p5 s) H9 W: z5 {% W
if A_tote="tote 1" then set A_induct to 1
( M9 L1 x' N! n6 L2 ? else if A_tote="tote 2" then set A_induct to 2; h* g( l" J3 x5 p2 v: y# }# O/ ]6 ?8 [% J
else set A_induct to 3
! S6 d: ]3 z4 F set A_i to 0: B3 _# f7 }$ {
clone 1 load to P_induction
( S! B1 l9 z7 ]6 u* |- w wait for A_time sec
2 P( H+ e) ~4 j( f7 l end; P7 s4 ~ N% Z& ~1 Y6 f( }% l
end6 ~$ \; ?2 j% Z
$ `$ p" S3 e0 }/ o/ I" \begin P_induction arriving% p' w0 R& t5 _/ C1 L% ?5 o k
if A_induct=1 then clone 1 load to P_pick16 J; I! j8 `, X7 R2 Z! ^
else if A_induct=2 then clone 1 load to P_pick2
# H! }2 e- }9 X8 F( ] else clone 1 load to P_pick3
2 w: U: u" u" N$ Mend' X, ~7 Z: V# w+ Z$ K0 Z
* g/ Z1 a6 ^; d4 O0 T9 L, e5 j
begin P_pick1 arriving$ \5 l! _% b* ^8 }+ W* H
set A_i to 18 i% ]; l0 F" J k
move into Q_induct1+ t( V6 Z% n2 S6 U: m
move into pickaisle.induct1& V/ x( R4 Q6 B
while A_i<=30 do begin
/ m" x, W/ g; E, J+ v B travel to pickaisle.con(A_i)
( R: _; q6 C& A$ j# S0 _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" y! m. l$ `' o0 l$ `( e" }
else wait for 10 sec
) Y' t# n# t0 \; w/ u if A_i=A_leave then send to die" h' f5 I3 o( d; o
else inc A_i by 1+ p. @- P; W& k0 b
end0 U6 s0 z$ J' N
end. I' V3 t e- a* O0 p4 ?7 W9 I
7 ]+ U" c& z* a1 x+ L L
begin P_pick2 arriving
' ^$ z9 R* H4 ]+ _+ i8 V* K# t u5 U' p set A_i to 11' J7 P, {( {7 Y2 W9 e. i
move into Q_induct2
+ A9 n% O* |* f5 B5 h# P move into pickaisle.induct2
) U5 `# T. b4 O# n7 ^ while A_i<=30 do begin. g9 t. j. L# m; v8 S
travel to pickaisle.con(A_i)
7 F/ T( ]! |& K' N& d; j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 l( e- P7 l$ N else wait for 10 sec
1 d/ b: f, A& @$ @) E8 a( k5 W) c% f' C if A_i=A_leave then send to die
6 _8 k! ^$ |% Z% o9 Y- \ else inc A_i by 1
1 o d5 d, N6 u end! h9 X9 V% O$ I$ e1 q
end9 _5 I2 z1 g I+ y9 I
% m% L5 G7 H! b# |) K+ x- ^
begin P_pick3 arriving( L3 j! B+ v" M( d( Z: c
set A_i to 21
9 H, J, j: M& v I# @' ~: e move into Q_induct3
3 E2 T2 L7 q+ y+ `: _0 w" l move into pickaisle.induct3% ?! x/ b+ [8 P
while A_i<=30 do begin
/ `+ A7 t) T& r d+ B travel to pickaisle.con(A_i)' ~( K8 p7 l; a1 o# J( p$ v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 z3 m; T8 r7 o, {4 W1 X else wait for 10 sec
/ n7 U% y& g+ s/ Z6 {- r0 h- P if A_i=A_leave then send to die
: i0 R# P9 P- k9 K- M3 B& h else inc A_i by 1% X5 w* T. H% y7 b" ~ P& o
end9 h$ b% h$ n# J7 ~
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,其它按你的 ...
|