|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 U* n/ v- b. d3 h5 Z1 s
' g- W, \# h# X/ B* W+ ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ q4 r: s4 B8 A# p+ x. Y
0 x! I, N0 @6 f" C `begin P_read arriving0 f- z5 ~* h+ }4 ~6 ~
while 1=1 do begin, K8 P0 c. ~9 U2 { M& Z ?" \, M
read A_tote from "data.txt" with delimiter "\n"
( d2 x( w N4 q* ^8 a5 V2 H) G; j read A_time from "data.txt" with delimiter "\n"6 U. M. _0 ^' O7 T7 {. b
read A_leave from "data.txt" with delimiter "\n"1 ^: c7 H0 s/ ?( C* M9 R: }
read A_picks from "data.txt" with delimiter "\n"9 R( J& E- g- m3 h" h. i
set load type to A_tote7 r' l( b& `" `- T9 z
if A_tote="tote 1" then set A_induct to 14 Z2 `" n. S* W0 V7 [- F9 S9 U; d
else if A_tote="tote 2" then set A_induct to 2
, Z4 r2 t1 c# p2 z else set A_induct to 3
0 P! E3 {/ I$ g: Y( {9 @ g8 o set A_i to 0% F- Y4 {" L, L, S9 t
clone 1 load to P_induction$ {2 Q: ~. A% K% Z/ A* }
wait for A_time sec& i5 b) t. n! y a, k1 J2 R5 o
end: b- I1 }$ s4 Q' F3 y3 f( u) l
end5 X/ l4 M" N0 V8 e9 b
9 @* Q2 g) h1 ]* p3 [. Z8 @3 c) U$ Zbegin P_induction arriving) Z2 [& N$ \* |5 B
if A_induct=1 then clone 1 load to P_pick1: b5 f+ T; B1 D0 P! w
else if A_induct=2 then clone 1 load to P_pick2
* O# z) Z8 l( P9 N* s; Z else clone 1 load to P_pick3
1 h0 ?% _/ [# A) dend
H0 }# A, g6 X" x: F; c6 E' k; y {! s. l
begin P_pick1 arriving6 ^ H5 J, A: b9 V( R0 b
set A_i to 1
7 K4 G2 a& ]; t- k% F; o3 R) w move into Q_induct1
: o' l$ K4 U' K& \ move into pickaisle.induct1% i8 |) ^, i$ J+ d( k
while A_i<=30 do begin
8 I7 y. ^) ?$ R/ _5 @ travel to pickaisle.con(A_i)
% `9 |! b0 A9 H3 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- C$ j' l5 ]& Y: n$ P" w else wait for 10 sec' q- U# l* J5 i; H3 t4 y( ]: L
if A_i=A_leave then send to die, {2 p$ x2 {6 S# z- } x6 b
else inc A_i by 18 m2 r T2 K- W* o& @6 h/ w
end
( k- \( B- c6 P/ s, I0 t. Oend
" E6 I& i9 q/ n6 f4 z( G) A3 V3 H* t
begin P_pick2 arriving
1 s$ {% n7 o2 X$ j V set A_i to 11
( I( J/ t& b$ ~7 V% G: H move into Q_induct2
) Q' L7 g5 D$ _# a move into pickaisle.induct2
3 [2 f& J" G7 p& t5 g1 T while A_i<=30 do begin
7 w( {6 {- G% b( A travel to pickaisle.con(A_i)
" }$ p% A; i6 d' i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! {# G1 \: q2 h6 |6 W3 @
else wait for 10 sec
( W. ?8 `' g# r d2 j if A_i=A_leave then send to die; W+ @8 Q# u; \2 _, F
else inc A_i by 1
W% I# F* S3 H end
( p4 j+ J( Y4 s. N! zend/ O/ n: E8 h% R) P! Z( [
" S9 g. v- \9 Q& e6 vbegin P_pick3 arriving
# u/ o; e; I% T+ A# A5 t. F; ?4 m set A_i to 219 ?3 o1 o1 \/ ^. K& K# T# S
move into Q_induct3- A/ E, S6 u! }6 E9 u: C+ U
move into pickaisle.induct3
5 ?8 X0 n: P R! e+ d while A_i<=30 do begin
+ E7 e7 h+ d# S4 O& K travel to pickaisle.con(A_i)( @7 g, M6 E e. J& h0 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 W; t, w; `+ f' [4 ]6 t, ] else wait for 10 sec
8 r! V& e% j/ s2 P( R$ v if A_i=A_leave then send to die/ u4 ]( O' H) g: P0 F
else inc A_i by 1
- l2 Z- M, Q; K; X3 B- a( e4 i end8 R( V1 z% P% K, j5 Y
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,其它按你的 ...
|