|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- t, P( l' M z4 r
5 V2 y g. S5 `: C9 A; [9 b我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ `1 i' s: i4 X# @; b9 t; J; ?: M' z5 T; j7 W7 b7 x- x5 t+ A
begin P_read arriving& o9 n s0 ~, f* E
while 1=1 do begin' W4 I! B0 p8 K( P
read A_tote from "data.txt" with delimiter "\n"9 y: r0 l6 M" o
read A_time from "data.txt" with delimiter "\n"
1 k/ a8 f, N2 [6 a read A_leave from "data.txt" with delimiter "\n". `5 F4 a. V2 e- d5 b3 ]& F( }
read A_picks from "data.txt" with delimiter "\n", W! u. _2 ~. J. {+ Y( m5 o
set load type to A_tote
" x1 s" s8 \: }$ l$ i if A_tote="tote 1" then set A_induct to 13 K/ E- q: ~8 t5 [* M
else if A_tote="tote 2" then set A_induct to 2
: ?; U. o; T1 @) Z- n5 X5 ` else set A_induct to 3 & W% c/ e Q- ^. L% d/ Y
set A_i to 0# H; H( f. r" m
clone 1 load to P_induction8 o5 j* [( ~( M% w
wait for A_time sec3 e3 K2 o; j: u# F
end
/ M5 L _6 ]3 t& o: M! mend
/ M6 i0 a9 _3 l+ L4 b' p4 r9 t$ c. n) ]
begin P_induction arriving: @ U- p0 A" f6 ?2 m% @8 q
if A_induct=1 then clone 1 load to P_pick12 Q: P _8 {; K2 t& T' E
else if A_induct=2 then clone 1 load to P_pick2
( T2 v( j2 f* G; l else clone 1 load to P_pick3
( r, w: e3 t/ Y9 u6 g* r2 ]: i8 ?end# e% J& j7 x) |& C, d; U* n7 B
. C% X& G4 X& z/ `- N
begin P_pick1 arriving* {6 R& |/ H( m
set A_i to 1
0 s( z+ |8 \3 } move into Q_induct1
$ y1 y. ]0 g0 M) f move into pickaisle.induct16 Y9 P" v+ Y9 P* m
while A_i<=30 do begin
6 ~. W/ b4 h6 @1 K: B! [ travel to pickaisle.con(A_i)# P, Q% K! p) h. k) V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. F+ B# D# V: v0 N+ o! j else wait for 10 sec! P0 J( i1 V! d$ |% n
if A_i=A_leave then send to die
& E$ Z" T# e9 g6 L/ k+ H% h8 Z! ` else inc A_i by 1 L, N4 @6 M8 k8 \. S' s) r
end
6 I4 o: r! u; `: a8 O# y3 dend: i1 N8 n& F6 D6 t
! C: Z# c3 Q& b) Y3 U N$ O4 `
begin P_pick2 arriving7 E9 S3 m4 i4 r( W$ T% A% {# F0 V
set A_i to 11
2 g- F8 I( x! ^( B move into Q_induct2
" |! @4 ?: }) A3 u move into pickaisle.induct2
; c, G/ ?. m: M9 ` while A_i<=30 do begin, A2 H1 t( F" y+ o! P
travel to pickaisle.con(A_i)
0 b" @3 n% J' F4 Z7 X2 A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. D- C+ h7 T2 ?: G
else wait for 10 sec
7 M$ f2 P$ q( l6 m* F if A_i=A_leave then send to die
8 u7 T B1 N/ i. b else inc A_i by 1
$ K) i% o( h J1 }# [ end5 {; ~, g% D' w
end
* h# b1 S$ U% j1 B7 X: ]7 e( z/ v8 P! q# P, U
begin P_pick3 arriving
. b! d8 [% U6 P4 a4 o; n3 J set A_i to 21
F- t5 {2 N" ^4 r" ? move into Q_induct3; _: T+ T6 J T" Q6 \
move into pickaisle.induct38 N( X7 p( x' B: K
while A_i<=30 do begin
0 v: r6 }. W9 D+ `4 P, @5 f8 ` travel to pickaisle.con(A_i)
$ l$ X! K$ I' T& K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; z9 L) h- X: z% S else wait for 10 sec+ i6 [" I# C, W$ c0 m- u
if A_i=A_leave then send to die
- u0 i) t, t# Z' }9 F else inc A_i by 1
9 T% B: M. }$ o3 P5 F end
6 ~8 d, A0 H0 ?7 p( j; M! Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|