|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. u$ `* y% D) Z
- |+ T. c( Z" \% D0 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 ^% j. B1 x* y, |; V
' x/ p/ O: @) T& Mbegin P_read arriving
; ^/ k' q2 Y9 N+ N5 K- B while 1=1 do begin
- q5 X; l& d! a5 | read A_tote from "data.txt" with delimiter "\n"- i0 E$ e1 l* k" ~
read A_time from "data.txt" with delimiter "\n"+ P8 u: j" Y- E. j$ G
read A_leave from "data.txt" with delimiter "\n"
4 Q; X3 p& l1 n' _- l+ @4 G) Q read A_picks from "data.txt" with delimiter "\n"4 h5 O) h, S& ^6 ?- d& c" i; Y
set load type to A_tote
- G" T) Q: r( b- B if A_tote="tote 1" then set A_induct to 1
/ K, [! ?* d* v4 O else if A_tote="tote 2" then set A_induct to 2
9 r- @1 b/ ?" w1 [1 k& z else set A_induct to 3 ) r- z4 K( d- z) |8 d
set A_i to 07 i- e" _" j. W1 c
clone 1 load to P_induction
- ~& S8 o- l" m$ ` wait for A_time sec! a0 X7 F; t$ X, E: e% `4 z
end
6 `% o8 U4 x# [0 d( t- pend7 b7 `& K, v+ E' d! m1 ?
4 {; z% \2 o- Z! z; l' X" E6 gbegin P_induction arriving; U* g* g& W7 b! \) R! D8 d) q& G
if A_induct=1 then clone 1 load to P_pick1& i2 h$ Q; q$ E' W, Z: I8 `
else if A_induct=2 then clone 1 load to P_pick2) C: D/ t* R2 t4 d, K
else clone 1 load to P_pick3! |& V" v {8 k
end
( S) H- t6 N A- x) `% v
2 ^" R# o9 L8 I% a+ I Z8 }0 ubegin P_pick1 arriving
; P. N; q& K0 l, D1 C2 E- | ~6 b4 |* d set A_i to 1
* s4 _- M& c8 C- B move into Q_induct1
`: N8 [% F& Z. m move into pickaisle.induct1$ o9 k) l% c L# s, i
while A_i<=30 do begin# }' K: R* y. q4 g
travel to pickaisle.con(A_i)
8 t/ b4 }. d: u* o( w/ ^: D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# F7 M0 ?3 c7 W Z' W( E3 D
else wait for 10 sec
; s) S5 H- ^7 R' H1 h if A_i=A_leave then send to die
- I# ~3 u k: t; U8 F1 L else inc A_i by 1
: t" s+ C8 Q; }7 |/ X- U8 {5 x$ G end
0 Y6 x2 G7 O+ k, X2 _3 oend5 V, f. ?# f$ m9 S2 e
0 y4 T" F/ O5 R( L( M% L0 [begin P_pick2 arriving
8 x/ ~9 f S% q6 G& a; y set A_i to 11
. i) X4 g q! u M move into Q_induct2
4 y4 ^, O8 E" R( B; B$ Q( D# ` move into pickaisle.induct2' J2 J9 H+ N% U d5 ^1 ~9 V4 C3 d! [
while A_i<=30 do begin
7 D" A1 Q, D& K" `/ x, G |" ~- { travel to pickaisle.con(A_i)4 {% \6 r" V. H- S3 v% w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) O5 V. l" F4 m3 n3 U8 O else wait for 10 sec
$ A2 W }* M* N+ G3 | if A_i=A_leave then send to die
7 B# ~# o8 Z+ R( d* e6 U3 F9 ^; o else inc A_i by 15 p* `$ Q" p2 b2 j+ Q& x& U
end. z, |6 w" s! }9 r3 _* j+ a# \% h
end
1 v0 K8 J* n- w6 `' d p2 y& e6 x7 N9 ?2 \$ N4 p) G3 S
begin P_pick3 arriving7 ^4 _: D& E* n9 I2 ^
set A_i to 21; f% n/ A0 u. E6 ~, s
move into Q_induct35 R# z) G( v ^& b$ s
move into pickaisle.induct30 n3 O* I, D! W% }
while A_i<=30 do begin
7 R+ U1 {, z* t travel to pickaisle.con(A_i)* [2 N+ B6 A* @; M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 R& N. |+ @- u8 L else wait for 10 sec
! H5 B" U' x2 ^) }, K if A_i=A_leave then send to die
5 ]4 S" b4 a5 F6 M+ y6 ~% e else inc A_i by 11 P2 g9 _7 c9 e! h9 J% y
end z& l; R1 h6 u' b
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,其它按你的 ...
|