|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 Q" {1 D& U t
8 v3 k ~: T5 l9 \& ~+ H7 V5 i% r我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 ^& t: N- {4 G! t) a
' U8 Q( [1 g- A) j9 a5 r2 F9 x
begin P_read arriving
U2 A3 }5 A% {# g while 1=1 do begin) t. H6 J; B% e. G/ J9 B% [1 }
read A_tote from "data.txt" with delimiter "\n"
- K0 l! Y1 r, P2 f @/ `+ \ read A_time from "data.txt" with delimiter "\n"
7 ?8 U( P9 R( b read A_leave from "data.txt" with delimiter "\n"' Q \0 C; l U( p& c7 @. `9 [1 b
read A_picks from "data.txt" with delimiter "\n"
, T2 V' Z7 C9 I& r. T: s. ` set load type to A_tote) K! g; N9 |0 S! C2 Y
if A_tote="tote 1" then set A_induct to 1
8 h" R: t( m+ S! f( @ else if A_tote="tote 2" then set A_induct to 2
3 ]9 Q1 I; @. P d9 U else set A_induct to 3
! w! g% k" M! d$ T set A_i to 0
+ i) C) T6 g& `5 v1 `! n, @ clone 1 load to P_induction
7 b. W: C& Y8 {4 t wait for A_time sec9 t* f8 B$ H- Y1 r4 i( ^( V
end$ X0 w Y! C4 ~5 M& L' ^
end. l: B- s- k1 V! H/ N7 V5 U+ I) c' |' d
; k8 F m! S9 y6 @1 U& K8 {
begin P_induction arriving p. Q( _! I4 V1 I ^5 M
if A_induct=1 then clone 1 load to P_pick1, Y. X+ E0 J& x3 `; `
else if A_induct=2 then clone 1 load to P_pick2
, l' X9 x- x4 ^& X3 t' G else clone 1 load to P_pick3
/ H) K$ s; U Cend
+ V$ {1 }% U. m# o& i) `% w
4 q6 l" n `) a% `9 s# p2 I, abegin P_pick1 arriving- ]& J; g v B( w5 }$ |8 |
set A_i to 1
4 v. J1 f0 h0 W# r5 Z' x* @: F* E move into Q_induct1% ?$ K9 I- Y. X8 E( r
move into pickaisle.induct1
4 d1 b* n/ _9 ?( _6 l) r: N7 _$ ~" ^- R while A_i<=30 do begin% z0 M4 i7 T6 r# i5 q, @+ {
travel to pickaisle.con(A_i)
6 E# R( H; y7 A: N5 l; \% Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 W+ N3 u- W' a, n else wait for 10 sec
m5 D5 P) L* |, r! S" I if A_i=A_leave then send to die
- G/ j' t4 i) o; G& A else inc A_i by 1* d8 E4 w8 }3 g
end4 \5 S7 A" Y6 r& ~2 b
end
, Q& y: Y' J. _; T
2 s+ l7 J! W# P. I, U0 R1 [begin P_pick2 arriving
' B1 n2 c0 m% Z* d/ T6 q set A_i to 11: }: a' J6 n. q+ r, z
move into Q_induct2
. r' o. h0 d9 }& q# H move into pickaisle.induct25 `7 o" A* c, P
while A_i<=30 do begin% W, p4 j, @" L( f( q
travel to pickaisle.con(A_i)% V+ U2 L8 g& G2 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G7 Y1 R4 t a# o( R& G% F: x: Y else wait for 10 sec
5 \! g$ L* [! U( O1 v" ~- O- j% v if A_i=A_leave then send to die
W0 j9 [2 d1 X: [* A( Y3 w/ J else inc A_i by 1% l) R F1 x! ^" M
end
0 r5 U: b6 c% j9 K6 gend/ N" ^! v0 c4 G$ o0 e
. f6 y7 q# \ p3 |! w( e/ S( p) ]begin P_pick3 arriving+ t/ U, X, ~& @8 M+ n4 k# |+ c1 K
set A_i to 21
; I( C! N- i/ y! @ move into Q_induct3
( L3 R& V4 ? n9 b move into pickaisle.induct3 O8 I# X( q# B" T5 N+ V$ X$ p
while A_i<=30 do begin
" p; m+ O4 E$ I7 k( T! ? travel to pickaisle.con(A_i)
; ` s5 r! {% a$ y2 T5 j: g, T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 s7 `7 B2 \4 F
else wait for 10 sec
6 W) u# r4 Q1 j( I4 n, F if A_i=A_leave then send to die# z% W- L" I9 `
else inc A_i by 17 H v9 t4 r2 \
end5 \* i. p0 t4 t, T9 _+ u* G0 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,其它按你的 ...
|