|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 ~' H5 J( F8 Y$ @- S! z0 J' t2 k8 w9 ~' }
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. B9 d; r' j- D% r3 e9 J
" j1 x- I- E1 G% O Y$ C, Q$ K$ I: xbegin P_read arriving
9 j0 {3 Z$ {& |5 D8 J/ D4 J% w% e while 1=1 do begin# Y8 h8 d& Z, F
read A_tote from "data.txt" with delimiter "\n"4 V$ }3 g, b$ L. Q
read A_time from "data.txt" with delimiter "\n"
7 Y( O' ^8 M) ?( X6 ?: V2 [5 r read A_leave from "data.txt" with delimiter "\n"
& w( T6 \% t/ i0 n read A_picks from "data.txt" with delimiter "\n"
7 Y) c8 x7 c8 Q+ Z" Y set load type to A_tote
( V6 L% |7 u3 b0 o/ U/ t if A_tote="tote 1" then set A_induct to 1
* j( s8 H6 b0 G else if A_tote="tote 2" then set A_induct to 2
9 N: s! S/ a9 { else set A_induct to 3 & U1 M I9 n+ ?. g; Z, Z
set A_i to 0
% K* G4 |" p& m' @3 e( D) p* C clone 1 load to P_induction; }( b' I& r [7 a# [
wait for A_time sec5 w6 A. {* p3 k3 D2 m& z
end
b5 C' }6 k: G7 G2 V+ uend
/ y. `& X+ T& Q/ I( c$ j1 P6 U1 R- x0 n
begin P_induction arriving- I% ^9 ?) O2 R8 H
if A_induct=1 then clone 1 load to P_pick1
) w7 u/ S( i! C/ [) B3 K9 n& e9 B' z else if A_induct=2 then clone 1 load to P_pick2
N+ o$ ^9 j) a% X1 b+ q4 a else clone 1 load to P_pick3
8 M) H' H5 ^( Vend
( v% l8 |, g! R( h2 Y' S G9 `" n/ Z" }( A% t+ b' B
begin P_pick1 arriving
4 H& D& C; I# F set A_i to 1
( F3 O% [. b6 o+ y$ X' I; ]" ]- s5 o move into Q_induct1
9 A4 `1 S5 E* i6 K8 ?. o1 M move into pickaisle.induct17 T$ W- x* q. ]2 Y" y6 B3 m
while A_i<=30 do begin0 p/ V1 K/ R0 h2 C8 o; \
travel to pickaisle.con(A_i)
! ? E7 O% |2 Y3 n: v4 l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 }) O: I. Q6 S! b" L/ u9 L' }) g else wait for 10 sec
9 B p. j. S" e+ M1 e if A_i=A_leave then send to die
+ [* U, A! _/ e( r# J: h else inc A_i by 1
# ^# K+ A4 I+ {% Y. i+ g end
" S- p9 ^9 M4 ^2 kend% Y7 ]. G/ l5 R" M" f _
$ J6 I9 k, H) u' l! |$ W7 dbegin P_pick2 arriving; y" q" L/ m( L+ F W8 J
set A_i to 11
! E6 Q$ e3 E+ x0 o' K) V" b4 ? move into Q_induct20 s3 M, u' @: k/ ~: q
move into pickaisle.induct2
( n0 a; j$ i0 H- n0 K* o while A_i<=30 do begin6 i1 h8 {3 @1 w5 m" |
travel to pickaisle.con(A_i)- [" j n; j% ~ I) K+ }: w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" z4 G* I# E- q$ ~6 W" m, l else wait for 10 sec/ }& E! R! j4 a0 \9 g B
if A_i=A_leave then send to die
; D0 I6 w7 V( l% M2 @) E: z- m else inc A_i by 1
* |9 H( f' i/ g- `1 j0 ^7 i$ n end, X& Q: w* w4 v+ w$ U
end R8 X0 G. m) b) C. u* X/ F) O- A
' f" @/ b1 l) \
begin P_pick3 arriving9 T7 a5 s m: F" s
set A_i to 21
+ o, M' |/ R9 X. J: }" x move into Q_induct3
- Q# h5 v: p9 A k, b move into pickaisle.induct33 X, ^) q8 i- K7 D3 Y
while A_i<=30 do begin7 \3 g3 d% l8 k( c$ |% e
travel to pickaisle.con(A_i)
* k0 {+ {8 U b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( {! F3 n/ X$ K* |7 l# s
else wait for 10 sec
. I: P' M! ]) W; Q+ J if A_i=A_leave then send to die8 u9 Y1 T* T1 C9 J' f/ J
else inc A_i by 1! j' [: V5 V {* R
end* m3 E- P6 L) g+ l& J. V* N$ A
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,其它按你的 ...
|