|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 {8 I/ C5 j( i) r1 {# ^3 v% b- N
' U( C) c! y9 E) m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 z% x) S' `- P( @
& Q* Y1 s; {4 V+ |# D! t- {' w, kbegin P_read arriving5 i! d& }6 c" s3 x7 Q5 \* a1 N/ X
while 1=1 do begin$ \7 x4 r8 c5 i; U$ A) \
read A_tote from "data.txt" with delimiter "\n"3 _- v# H* _5 |, F
read A_time from "data.txt" with delimiter "\n"
+ e2 b4 L7 Q4 H! \* q read A_leave from "data.txt" with delimiter "\n"2 y# W: E3 i0 P/ M- `
read A_picks from "data.txt" with delimiter "\n"
7 C: H- Y( z* g set load type to A_tote% u! z& O* R, E9 h" s
if A_tote="tote 1" then set A_induct to 1
. D' B% z" I) F2 V5 s else if A_tote="tote 2" then set A_induct to 2
. F) R5 W' j3 f$ |9 u! Z/ D else set A_induct to 3
. C8 J: Y7 k2 n* x. f6 c set A_i to 0
: {# n% ]1 m! Z+ A% A% s& L clone 1 load to P_induction
& y7 f M' r1 H+ [- a8 U$ t( u wait for A_time sec
5 f# C. b1 d; I" ] end
: W2 C8 c3 j: J5 H5 N+ lend
/ Y; L+ s. L: _+ t4 n+ N2 a3 R6 O$ B# U7 N' l
begin P_induction arriving
1 S( P; ^1 M% m- \1 _5 w if A_induct=1 then clone 1 load to P_pick19 U$ W7 W6 C2 W. h9 E7 b
else if A_induct=2 then clone 1 load to P_pick2
1 l, k3 N6 {" K: \ else clone 1 load to P_pick3
# |1 p7 `/ G7 V% Dend( [% l9 s7 e4 X" Z5 }
4 x' ~ W7 @+ [% D
begin P_pick1 arriving* }) g7 O/ y) K( B0 ^
set A_i to 1
; c1 r/ e3 W! {- H+ ]6 b move into Q_induct1
7 C) W: m* Q- c9 M! Q move into pickaisle.induct1
& e( T% @- Y3 w. ^! Y" } while A_i<=30 do begin
4 z2 E) c$ C% ^6 ]7 s9 t6 w& C! W& V travel to pickaisle.con(A_i)- g/ d; |- q. o5 e' b, O4 A# i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 u e* c6 m7 ^$ `7 }' a else wait for 10 sec2 c) d9 ^" w/ T$ B, e
if A_i=A_leave then send to die
) D+ F6 M8 e( ?* E$ G1 g6 F else inc A_i by 1- Y) Q* H0 E7 q, i7 A) C( O
end7 o e, | x5 b( B! l7 [
end
+ a) Y, T* R c3 \' t) D: L! Q' I+ ^' S# T( |5 D4 d- ~
begin P_pick2 arriving9 [% t* i( E. Y% e
set A_i to 11. J5 z) T/ h! {2 }6 }- k) e
move into Q_induct2) t& ?- [# c- c& k [2 g0 L, P4 v* Q; u
move into pickaisle.induct2" T3 i3 H- o! y7 Q# ?
while A_i<=30 do begin
8 b8 M' f( e5 L7 W/ x, k travel to pickaisle.con(A_i)# Z1 H% y. i6 P4 g" ?' m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 p) e( d# K- x' T6 d8 b# h
else wait for 10 sec
' U) I" k8 S/ T9 N8 Y1 O) y' X- a4 P if A_i=A_leave then send to die
, o2 C9 \ W5 ^: X: j: ?3 i9 D8 l else inc A_i by 1" c# C* |- g T! F. Z, m
end- c! S. }& m; B. h% j3 |. J% _
end2 y& j2 t6 z% Y- }% ~
) l: S. b: T) \) j# `begin P_pick3 arriving
% O0 J- P/ S* g V: V; A set A_i to 21
9 Y- Q* e, j- e* G move into Q_induct3
0 F4 X. j8 u8 T3 D move into pickaisle.induct3
, Z. O2 d) L. u% e0 M& X1 ~* @ while A_i<=30 do begin
+ ?) k) n. X3 j' V5 w- N2 F travel to pickaisle.con(A_i)
1 R' c* \4 X& y9 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ^3 ?/ P3 W6 W8 @2 y; ~! R3 l' E% U
else wait for 10 sec
J3 N) p; _# t: h( Z; P if A_i=A_leave then send to die% ] d. |7 h1 R1 f I
else inc A_i by 1
( G3 J7 p4 Q5 K+ @0 \ z- d% e end
1 w5 l) k2 v! \8 C( Q3 F$ rend |
最佳答案
查看完整内容
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,其它按你的 ...
|