|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 n9 s* D' D3 t3 g
+ _5 f% D9 d O# ~9 V' U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 l9 q: X( k, S/ f9 \
o) I" G' y- z5 c; [
begin P_read arriving
; W0 h3 p8 x; K& C- S while 1=1 do begin
0 U1 X1 ]% n7 } read A_tote from "data.txt" with delimiter "\n"
( Y' w+ s1 g6 w) ? read A_time from "data.txt" with delimiter "\n"" P) t( f; a) | ~- N9 ]
read A_leave from "data.txt" with delimiter "\n"
( d0 [: F& n9 q4 r read A_picks from "data.txt" with delimiter "\n"
: k$ t, a. u2 a/ r, k. J! U set load type to A_tote) t4 Q" Y0 K: U$ a0 w! i, H
if A_tote="tote 1" then set A_induct to 1$ Z+ }) |, S2 L
else if A_tote="tote 2" then set A_induct to 2+ a0 j. z0 A5 R i% U) v ?
else set A_induct to 3
5 n: d: K$ P) N+ u0 p( h/ S set A_i to 00 z/ ~5 r9 m& K) Z4 F! i# g6 l8 t
clone 1 load to P_induction6 O9 Y2 S( e9 Z" U2 o: Z" U
wait for A_time sec
* P' I$ O) ]6 x* G! e4 `9 p1 t1 g end
: h9 m4 W' r1 Yend. ~4 N& @3 K8 q* u
" ?8 M, W7 l; W
begin P_induction arriving5 P. y: q! i8 B, @( q9 g
if A_induct=1 then clone 1 load to P_pick1! }0 Z8 `% d2 Z' @& T6 W4 \
else if A_induct=2 then clone 1 load to P_pick29 S8 n* s5 P+ Q9 P; z0 W7 S& C' Z& z
else clone 1 load to P_pick3
/ I" ^ Z" I& eend: b: J3 b8 J* x6 D2 o# [. T
3 ]; D: [2 H$ O: B
begin P_pick1 arriving
. h4 U1 T: u1 Y" T5 Q9 x6 K) p set A_i to 1
9 a2 Y$ u U. P& k. L# O. X% ] move into Q_induct1
, z+ b. R; {6 j* W0 P' s# V move into pickaisle.induct1' O7 q8 D$ Q9 s# z6 {
while A_i<=30 do begin$ `, `0 M: G, ?* J% W; K9 n
travel to pickaisle.con(A_i)
( ^, @$ l* i8 s5 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: R e; q8 C1 @4 {% W7 A" R else wait for 10 sec
/ p X1 L+ f0 P) {" o if A_i=A_leave then send to die
7 e; M, x& {$ q. ~/ t" ]' c8 x$ P* h else inc A_i by 1
' _+ q( t/ u) E. ?% }8 m" n: n! K end
) N2 z5 _, ]- v" `- tend
; K1 A: {, D8 t& R0 J; \9 {
7 P9 h# Y* f R4 B: E/ S# fbegin P_pick2 arriving
; i6 M8 g8 k" e8 d( p set A_i to 11 z3 J( B$ r% @% j+ I" d
move into Q_induct25 D, t! l1 ^8 P0 x: d9 h/ m0 ~ P& X
move into pickaisle.induct2# l7 c1 ~& ?0 [) r; c
while A_i<=30 do begin, I v3 A+ j7 w% k! ]( m- i
travel to pickaisle.con(A_i)6 \$ ?, |, Z6 B; J& a5 e: s H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 m( W9 {) k, x n% n# ~ else wait for 10 sec0 {0 K( P- k0 n& q
if A_i=A_leave then send to die
$ W i) v4 s. k0 @5 v else inc A_i by 1
& q3 W6 j7 m6 M- _! C end
7 a& O! \' w5 G' j! j$ C, bend& d/ o3 Z' s: w/ c( ?* y
7 D9 u: J) \# \
begin P_pick3 arriving
! c; v( [6 I" K' y, N set A_i to 21
$ d( s" H6 I+ V( f/ ? move into Q_induct3
# @2 J* E# v8 E5 n% _- f' { move into pickaisle.induct3) {8 o w; R0 a8 Z4 S
while A_i<=30 do begin
) v# N$ u% _% ^& ^5 ^' d& X travel to pickaisle.con(A_i)
% V& X- B& t! |# h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P R! R- Y/ x1 C8 w
else wait for 10 sec( j; n8 \9 r' H+ G+ K- u, J
if A_i=A_leave then send to die' n3 E* f2 u5 A d2 m
else inc A_i by 1
: H, K- g; E$ X# n1 o end
2 e U. w0 m8 p6 _6 Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|