|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* y- f& x$ M: b( V1 d/ a
# K" l, x* v3 Z% o+ Y9 G" p我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' U& ?' ^* F+ C: b& g, h, I) ~2 f* k( u
begin P_read arriving( }: _( C5 }0 |4 Z8 W7 R( G4 c; a
while 1=1 do begin
2 W5 c J; ?& U1 q read A_tote from "data.txt" with delimiter "\n"7 b' f3 g& D( N/ v
read A_time from "data.txt" with delimiter "\n"2 L; M( I: x$ ? K4 Q9 g2 O
read A_leave from "data.txt" with delimiter "\n"
7 R' k% e, h" E3 B; F, p read A_picks from "data.txt" with delimiter "\n"( m5 `/ O4 a! ]+ v0 i4 U
set load type to A_tote4 U* X- a$ d# y7 ~- X& n5 Z1 [
if A_tote="tote 1" then set A_induct to 1- g$ f; ~# i9 t+ ~8 d6 ~
else if A_tote="tote 2" then set A_induct to 2
; l: q. B% ]0 M else set A_induct to 3 ! G4 ?) z" C" U4 R1 A/ L6 s
set A_i to 0
, Q5 R; M% Q' m clone 1 load to P_induction
! V/ J0 H8 G: J* z5 F wait for A_time sec! }5 g! X. j: y2 e4 g. K9 K% c
end+ Y+ X; W' U! A6 ?( C `6 a# d
end% f, j) l2 B/ W0 P1 ]1 l
: }/ [# A' F& s; c: {( A: z nbegin P_induction arriving
0 |# S1 ?& z- S: m$ J3 b Q if A_induct=1 then clone 1 load to P_pick1
7 G6 R! o* F0 }- g/ @; R3 x* ]+ L else if A_induct=2 then clone 1 load to P_pick2
# G. l6 {: s" o5 n else clone 1 load to P_pick3$ x- e3 x: {! Z
end0 v2 Y3 R& g0 X
2 E( _5 b7 w4 u% Q& o# ^! ~
begin P_pick1 arriving6 b1 y' i# C6 L# j, T5 w
set A_i to 16 ]$ P* ^' F! D: J. u8 R. r9 v
move into Q_induct10 x4 K. ]: ~( @3 ^/ _0 S
move into pickaisle.induct1
% m3 n, \7 J$ n5 [) e; {! ~( h while A_i<=30 do begin
7 X K* j8 i" b7 D* _6 w- o- S9 n; p travel to pickaisle.con(A_i)+ l9 C5 z; [ }8 G2 a; q# n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) K2 u q4 ], V
else wait for 10 sec1 Z% ?! `4 y! i4 u% l4 \2 L6 @$ {
if A_i=A_leave then send to die- X* S1 A+ q+ }. I1 c) p" ~' [" X
else inc A_i by 1' ?0 t' V$ z% n+ f; i
end9 n* ^6 g, [) I8 Y3 }
end3 S! S5 u6 q+ [8 g
4 N, e2 P* o& }( {0 rbegin P_pick2 arriving
8 P; E) b+ y" y* } set A_i to 11: i5 Q7 u6 K) b* d
move into Q_induct2
4 X0 ~) ^$ m. w) Z+ A move into pickaisle.induct2( F; r8 A; W5 y
while A_i<=30 do begin
4 D0 V; g9 Y! b0 C9 V. s' G- ~& Q travel to pickaisle.con(A_i)
/ k/ _4 I0 R: t7 m' l' J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec B x5 o0 X0 P6 c, C# f
else wait for 10 sec- M* d6 E; A# }; z; ?2 ^
if A_i=A_leave then send to die1 q( }2 S/ s' v" n' v. G. m9 j- J
else inc A_i by 1$ \( E& n% _: \. w
end
/ E, [. n* ^# e: a1 g- G8 Yend+ Q# I: ]$ A5 g! n* x
+ A7 Q; Q2 ~4 g! y1 S) P
begin P_pick3 arriving
4 c G, n M8 |' v* E$ e" B- B set A_i to 216 Y' A* m- {0 r2 ?( S8 p( u
move into Q_induct3
7 e! m0 a9 w& J) p move into pickaisle.induct3
* j& S3 K2 ~; s. x$ d3 T( V7 O8 f while A_i<=30 do begin9 Q+ Q- }6 j, z$ g, I/ }( [9 T6 K
travel to pickaisle.con(A_i)
& y) F" Q" g; v, A% p2 i, P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 W1 d# ]9 u5 n4 w
else wait for 10 sec& O3 X+ @0 l6 c
if A_i=A_leave then send to die
8 u, Z( D" Y# J8 p6 h else inc A_i by 10 c7 {" @4 ^, r* w( e0 ~' z
end
+ ?' r( Z2 T5 ^5 kend |
最佳答案
查看完整内容
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,其它按你的 ...
|