|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# W% @3 C; B; s
: ?+ ]' L. W0 d0 r; J4 ^
我的问题是,在每个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 H; y8 ^& S8 {# v) r9 D8 H" Z: A6 |1 M9 y
begin P_read arriving
" M) ^! m" r. U- `0 C5 R while 1=1 do begin
1 ~4 G: I! b8 P0 j5 Q' A) G" E read A_tote from "data.txt" with delimiter "\n"
1 I: h3 ?& n% G2 M! }( n- l- d read A_time from "data.txt" with delimiter "\n"- V# r6 s7 F) F
read A_leave from "data.txt" with delimiter "\n"" W/ `7 J2 l( T: A Z
read A_picks from "data.txt" with delimiter "\n"6 I& O% R& Z( g$ c& B3 n7 i
set load type to A_tote- Z$ l7 f+ W/ U- j Q! h4 t
if A_tote="tote 1" then set A_induct to 12 X) P# w6 A" f( T' D
else if A_tote="tote 2" then set A_induct to 2
" M1 H R0 Q- T( u9 A, ` else set A_induct to 3 + D+ l/ T/ k; o+ C, l* K4 }
set A_i to 0( P) U+ n; x0 Q7 h, x0 ~$ I
clone 1 load to P_induction' `5 a: o6 X5 o4 T, `* w
wait for A_time sec
: ?4 t, b* X+ F' f \ end% I# X1 Q) H& Y7 Y& H+ t2 w
end+ H4 p0 z; {! j
, V3 ]- c$ ?4 O5 M' l q
begin P_induction arriving
. S% z) B# b- Z( u+ T7 X- x9 k if A_induct=1 then clone 1 load to P_pick1$ p3 m- N6 L* S, ^3 s: b
else if A_induct=2 then clone 1 load to P_pick2
7 B( [, e5 ^8 o( f1 ~% N else clone 1 load to P_pick3
4 R9 L) M0 `: s' c3 @end4 s- s; N( U8 K$ O
1 c, ~( f" x5 w( \0 Y- vbegin P_pick1 arriving
/ w0 ^- C/ Q& ]: g5 j set A_i to 1: O/ t) ]4 K" k
move into Q_induct1) S: Y: k: Y4 ?" C) a [
move into pickaisle.induct1
9 H8 A0 U# t4 z* E( x: s0 A9 G3 L while A_i<=30 do begin
. E1 [/ O6 v1 m, T2 t4 Q travel to pickaisle.con(A_i)* f2 ~8 b- r0 J0 ^+ w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: {, f5 A2 J4 `+ y else wait for 10 sec- ?# h% A6 E$ X6 o1 d
if A_i=A_leave then send to die& ~, H6 H1 v q% @4 q i( h) e
else inc A_i by 19 I+ Y2 r7 U. h# @* b. p
end
) j* K8 s& z+ e; X9 u( k) _end' v# A- j3 ]) S. U8 r
" b' x; A8 t+ K' H+ J
begin P_pick2 arriving' o7 s6 `. p4 i7 a7 C' V1 R
set A_i to 11; Y4 y: {+ q! F7 k+ N( N, m$ |1 D
move into Q_induct2
: r( _6 K5 L1 V1 q4 r y2 u move into pickaisle.induct2
3 W) O1 ?% |% [6 f* o) v K5 A while A_i<=30 do begin
9 \% ?% A7 z& V' D+ } travel to pickaisle.con(A_i)
1 }: X( v O- G# e9 e: c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ]3 J* H; K9 v. M else wait for 10 sec
7 u6 o* ]& ^9 k4 Q b if A_i=A_leave then send to die
/ ?9 R3 U8 r# _ else inc A_i by 1! i4 Z! l5 b4 F) n
end
- m+ }) m- `4 C# T N3 }5 q" }end2 X b! p9 [' j8 I
" q' M! }3 t D. mbegin P_pick3 arriving
- i* Y5 x) d6 O/ F/ Q. b# v+ U) S set A_i to 21/ g& c" @8 x- u$ Y
move into Q_induct31 x# D) {% r M/ _' q, R
move into pickaisle.induct3- u3 S5 e& m/ A/ f
while A_i<=30 do begin
; a5 R' \! K% K I8 O4 w travel to pickaisle.con(A_i)
; |8 S( j5 N/ F: P( m2 y4 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ }/ \7 i( L' c+ z' | w1 X( v. n else wait for 10 sec( _- K; I7 W4 U1 o# T0 J3 W0 G% `
if A_i=A_leave then send to die
, A- m1 _1 L2 f else inc A_i by 17 X8 m$ o5 |3 _. d( }
end
/ b0 u3 s2 h5 b9 t$ @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,其它按你的 ...
|