|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 n/ c; y) S. E9 D8 f! F$ `
- \0 g5 T$ W, 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中的数值,不知道会不会有什么不妥。. T C: D4 E {6 A+ O7 E
# ^4 f$ q2 ~+ M$ D6 h g
begin P_read arriving5 X8 A( q( f4 w9 F) M
while 1=1 do begin
" h# {, r" h2 l# ]* V8 d- E- ` read A_tote from "data.txt" with delimiter "\n"
& n% S1 C6 p+ o read A_time from "data.txt" with delimiter "\n"4 f: @ A$ m$ D$ W9 `
read A_leave from "data.txt" with delimiter "\n"
$ ?5 I8 I+ p8 r, W; C" V read A_picks from "data.txt" with delimiter "\n"
g5 d8 B8 i6 p! b0 u set load type to A_tote
! Z3 E$ e8 s3 \+ l% B if A_tote="tote 1" then set A_induct to 1
R1 n, f. z8 m else if A_tote="tote 2" then set A_induct to 2
* l. V* I5 X j3 [ else set A_induct to 3 m8 p, \- D7 O* t+ k; C
set A_i to 0
5 |/ J" Y% y5 R8 B4 P# \ clone 1 load to P_induction0 a2 X! z2 e- j; q) a. |' f
wait for A_time sec c$ A" [- Q, C3 D# x
end' d% p' S3 Z: ?
end7 ?& F o L: H( ^6 f* [' V
2 V3 H; A# h' }$ ?& ]begin P_induction arriving2 I f* }' u0 j$ o! }, `
if A_induct=1 then clone 1 load to P_pick12 H0 g0 v; G; N! }& I; B; z1 C
else if A_induct=2 then clone 1 load to P_pick2
5 }( r ?6 s; y9 u' K else clone 1 load to P_pick3. Z/ V( ~6 ~# v# h6 E9 {, S
end! E( `; [0 f2 h: S) r
9 R* N+ U( X$ e7 `+ D, j2 Qbegin P_pick1 arriving
$ S6 W' J' M% x! R6 p4 N3 w set A_i to 1
4 w# h$ }: T; e/ Q: E" o5 M: @7 w2 T move into Q_induct1/ P- c/ D; s$ e- W9 }6 Q3 z) o
move into pickaisle.induct1
3 ?# r2 l( A! ^& p6 w% ] while A_i<=30 do begin5 O3 l6 Y$ W b
travel to pickaisle.con(A_i)
" u4 M5 y0 i% p( e) h. ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ~+ @8 b+ K+ [" A+ q. H else wait for 10 sec
6 B6 c0 W7 T! L if A_i=A_leave then send to die
2 {( \- u& _6 `/ P# V2 @( k$ Y1 Y else inc A_i by 1
/ s: y" r% h8 d: `; _5 R end# Q6 T7 s- a5 Y5 U
end1 w2 F# J/ I" [& N, P
2 R- b, l- y) o" L( `. e rbegin P_pick2 arriving
6 y% G& R+ G$ a( B7 N set A_i to 11
* N7 A0 b2 x3 f. R% V move into Q_induct2
9 G' N8 a0 o; q( L& n move into pickaisle.induct2 ^ T+ g& s; S
while A_i<=30 do begin
3 f! ?* n; m$ p: ~; [ s$ R \& _ travel to pickaisle.con(A_i); F, y# F; U' h# X5 G9 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ?7 a. `" U* J) I k4 N, i6 e
else wait for 10 sec
4 w. ^2 k' f6 K, {1 @/ [ T1 a+ M if A_i=A_leave then send to die, j% l3 x( O8 N$ e; p
else inc A_i by 1
6 z; ^. e% ?# @4 G D' _; E; M, ? e end
5 L; C% P9 z$ l' Y" }end
, O' H1 W/ e$ a+ \' Y# C# x1 G7 b4 K1 J N2 n$ X
begin P_pick3 arriving
- D5 q0 `- Q# k5 U2 y# g set A_i to 21
5 b% T w* S2 m j6 H8 t move into Q_induct3- W4 ?* U. k% ?% I; h Z
move into pickaisle.induct3( b5 Q) N: H# j
while A_i<=30 do begin
# F7 R% y' I, U- H travel to pickaisle.con(A_i)6 T. b% r0 e! O: z/ z& l, G! L/ N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ G) d2 h0 P( i+ i6 z else wait for 10 sec
2 A1 N/ a; _- v) l4 d* W, }" e! I if A_i=A_leave then send to die$ u6 m% x. B! _2 h
else inc A_i by 1
! P0 s# o9 V& y( X# T end
( K- ?% i% [6 f$ Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|