|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- m" v4 e u+ o4 j5 O6 d- z$ J0 [4 `6 X. b0 h% V' s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ i$ q/ ~* S7 y, Y% {% _! N" q
6 o3 K1 }: o, h! T1 A/ }
begin P_read arriving
- R' e6 N( B6 H; _$ a1 i6 h while 1=1 do begin
5 e ]5 @. ]: q2 x2 r. n+ z read A_tote from "data.txt" with delimiter "\n"
# \# r+ [% w) L8 C7 F read A_time from "data.txt" with delimiter "\n"
/ {, i/ h7 @' e; c. r& V% T/ \ read A_leave from "data.txt" with delimiter "\n"% V- U" S# I: a( k' @3 @* P; ~
read A_picks from "data.txt" with delimiter "\n"2 T- p) B$ t* I5 y, e. p
set load type to A_tote1 M0 t; Z) W$ s8 E
if A_tote="tote 1" then set A_induct to 1$ o) R4 s$ ]4 I
else if A_tote="tote 2" then set A_induct to 2
4 c$ u1 q% ~9 c" l: v9 D- H else set A_induct to 3 0 r" U+ S) P! B9 l0 v& v
set A_i to 02 P% { a# u" Z- w! {. \6 V0 _; J
clone 1 load to P_induction
' c' A0 [. { l W. D wait for A_time sec
# n' i7 P/ k8 H end
9 \2 A$ J. t& Iend
" u, A0 }8 C0 W' ]0 j7 m: j5 e( U( S$ t' ?
begin P_induction arriving
4 M; X1 e/ `6 i, Z. V( e. L if A_induct=1 then clone 1 load to P_pick17 D6 k1 R5 C2 [. D5 K, S
else if A_induct=2 then clone 1 load to P_pick2
/ T w- m7 f+ ~ else clone 1 load to P_pick3" a) ]' w, a& D- \) m
end
4 ]9 H0 c& y( r( A% E
/ }; i- n/ R7 \begin P_pick1 arriving# ?( E) j; Q# g
set A_i to 1( r2 A+ y( F. X
move into Q_induct1$ R, L7 x) |# o+ @ _
move into pickaisle.induct10 h( v( U3 ?( m' W6 N
while A_i<=30 do begin
8 v6 h$ D' v5 D' m. P7 \1 {: S travel to pickaisle.con(A_i)7 d' c2 v; y7 k2 u6 h K0 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 T; B( R1 c ^ Y: z0 H else wait for 10 sec
* h% s: q! m: l if A_i=A_leave then send to die
$ [6 H* v9 o& X0 ^' G* k else inc A_i by 1
( R% J1 M6 \# i0 \9 i2 x end+ V4 j/ r" I \. J* E# A
end3 ?& P$ T3 g& R& ^" k
! p# T( e/ r* O3 m: X2 ?0 u+ V
begin P_pick2 arriving
) }1 X4 C7 Y& h set A_i to 11
( D% T0 J* Z, z- c, ~4 _ move into Q_induct2
- j7 n0 A! T. c0 |; C4 F move into pickaisle.induct2
8 U# w" P( [: T( T+ H while A_i<=30 do begin9 R0 E L0 o) Q8 k8 o# ]
travel to pickaisle.con(A_i), D7 i" o0 B) F9 [# J% a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" }( J# w h* j
else wait for 10 sec" K$ ^: ]4 ?) o9 G- q( E6 q; w
if A_i=A_leave then send to die
! {& o4 a1 S; d3 e ? else inc A_i by 1
- i7 G8 c( M0 N1 M2 Z: \ end
- u' l+ F2 J# g. S' tend
) q) `' M: ?( p8 F, M# ^8 Y1 ]% ^4 D: ~" z1 U
begin P_pick3 arriving# s# |) y$ {6 v9 W
set A_i to 21! K, ~' K5 G @" \: u
move into Q_induct3 E( O& _6 w* T( R/ ]3 j
move into pickaisle.induct3
+ f( e4 ?0 b$ v( ^6 M4 ^9 K while A_i<=30 do begin
+ y) u4 f! B2 I. g0 F travel to pickaisle.con(A_i)+ x' c9 a* y2 ?3 _' G3 c; @9 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% L9 u& m! a9 }' O& U
else wait for 10 sec
6 x& `8 C8 h0 }4 ]% _( F if A_i=A_leave then send to die
$ D, ]6 k! g2 V5 s. N$ F- J else inc A_i by 1
; f6 R7 @) P6 r6 Z end
; x. o( _# |- L; Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|