|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ n+ {8 @1 E( G' M- S' j
: H% o! J& ]! ~% M& c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% t1 r8 k& F0 e& R: s; s
$ ?& d- z9 C9 mbegin P_read arriving
" P s1 R% h" @$ N3 g9 d while 1=1 do begin
4 i) h: ]7 @6 j, y* x read A_tote from "data.txt" with delimiter "\n"
4 }: Z4 D: ~9 W5 B3 v* O# ^" v% z read A_time from "data.txt" with delimiter "\n"9 R, p6 E$ [9 Y9 ], I
read A_leave from "data.txt" with delimiter "\n"8 m- A/ z' z' j( A9 E
read A_picks from "data.txt" with delimiter "\n"* B5 L2 Z7 \1 P% O4 v. c
set load type to A_tote
3 _0 K& t3 a* z1 L- L2 \8 O2 f if A_tote="tote 1" then set A_induct to 1
E( J+ T7 t. b% a7 p5 j+ l: Q else if A_tote="tote 2" then set A_induct to 2
9 G5 u! G$ I1 s else set A_induct to 3
$ A, \6 v- \, J4 V( H: \ ~ set A_i to 0
' Q* {$ R2 d, C1 R1 Z: P, C9 M clone 1 load to P_induction: s2 ~$ \( W$ O' {) r( i
wait for A_time sec
* i. R8 {( I! s end
# G( S) ^: C. Fend
& B; f8 Y% c; m2 X+ v* |2 A0 H( Q
begin P_induction arriving& K* I+ M4 @" C+ W- @+ }
if A_induct=1 then clone 1 load to P_pick1
0 l: g+ D% |0 {1 Q else if A_induct=2 then clone 1 load to P_pick2
4 ]0 A1 f2 L6 ?. p/ F* ^& n4 ~ else clone 1 load to P_pick3
. l( G1 o* a1 C- Send0 z$ ~; R, ~: p J$ D3 d
7 H5 S9 g4 K3 G0 J3 d, Sbegin P_pick1 arriving
2 u) c F! S+ w' Z" g0 C# Q# v set A_i to 1& v, i) \) Z: _/ z/ G
move into Q_induct1
9 f9 B1 p* [) ?% c2 H0 M move into pickaisle.induct14 r) @1 r2 _2 u" F- F. R* C, y9 I* R
while A_i<=30 do begin
, }" L5 v$ l! ~ travel to pickaisle.con(A_i)
, Q6 c( X0 v. w$ g, ?+ Q" Y$ |, v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 h% P. o7 X Y7 ~. u else wait for 10 sec
. N! Z+ V) Z/ V3 U, e7 n# E% V+ U if A_i=A_leave then send to die
5 R0 M. ~8 e. b2 o% C else inc A_i by 1
: i( I+ k0 p2 p6 c end
( T: U D2 K1 p% dend
. }) J1 Y" w5 c+ \; @' t9 D
0 g+ Z4 i9 K" sbegin P_pick2 arriving
e+ I) h9 Y; K4 Q R+ G/ j set A_i to 11( u7 U. Y. k5 m, t: Q, O, G
move into Q_induct2
. a- J) t# j5 O# ]* @ move into pickaisle.induct20 r1 {0 V, w1 L( e( X9 _4 J9 P
while A_i<=30 do begin
% w# f" g+ \0 l# Y7 S travel to pickaisle.con(A_i)
5 {# y5 g* n8 }4 a9 \5 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) I7 A5 g# v3 I8 t
else wait for 10 sec
! t% @7 ^9 I& D ], O% Z6 @0 ] if A_i=A_leave then send to die5 k" Z$ t T8 p) N- K Y/ b
else inc A_i by 1
' e- B: q1 [: I& h- T( w end
# _4 o. |6 K, ~2 U+ | g2 ]5 R0 ?9 Mend
/ \. S9 ?* _& T! D& D5 t- B" E! @
, B# y, g0 G8 b+ t& ^$ X0 {8 M8 gbegin P_pick3 arriving0 n v' ]5 t9 ~: o5 x
set A_i to 21% e* s1 A3 C1 `" i
move into Q_induct3( k9 `3 h! Z \/ s* i8 J, X
move into pickaisle.induct3$ ^" w6 X( a7 T d5 M% \- U
while A_i<=30 do begin
/ k/ J$ l. P8 g. ] travel to pickaisle.con(A_i)
. H' B" H, |+ x, b5 ~/ t: W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, h5 n3 x/ L7 j& ~6 |' V% w4 L else wait for 10 sec; `+ G& |+ ] [% v% j: v+ I$ L
if A_i=A_leave then send to die
1 J" E+ g0 e% P/ Z' c/ q2 |: ? else inc A_i by 1
+ h4 v# X+ B1 e& N end6 j+ y( l5 V% F3 j
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,其它按你的 ...
|