|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& b( |# w6 ~! K* m V' I+ f; x$ ^/ u$ n: w% K6 w3 r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 O7 W5 C8 u$ ^6 P0 {5 S5 q Q, G3 e' r
begin P_read arriving& ~& e- r" C2 w& C& R. k$ ?
while 1=1 do begin4 L2 h" \/ P8 m( S: ~ a" s
read A_tote from "data.txt" with delimiter "\n"1 w) w) _. G5 P @6 c m
read A_time from "data.txt" with delimiter "\n"
2 h1 y4 {1 X+ v read A_leave from "data.txt" with delimiter "\n"2 z& a5 R, d! X& L. `
read A_picks from "data.txt" with delimiter "\n"3 V0 N: P+ E: J: s4 W
set load type to A_tote3 U: |" U9 Y& x5 l5 [5 _
if A_tote="tote 1" then set A_induct to 1
c0 \: i4 C7 @3 F( k else if A_tote="tote 2" then set A_induct to 2
% l9 W& Z- g0 e( w& x2 u else set A_induct to 3 + X# ^! ]3 m1 B1 D9 v( d
set A_i to 0/ u! U4 d6 ^& \; G' T' p
clone 1 load to P_induction4 Y5 n/ I7 g( l: v& |' V
wait for A_time sec
- b1 O* q; r b. ]7 }6 o/ u end
3 g6 a& c* \3 T2 x7 x: |; `; Hend1 U7 j7 f6 S( w% {4 t7 W* j
1 e. t; e. }1 q0 tbegin P_induction arriving
R8 G0 O2 [* { if A_induct=1 then clone 1 load to P_pick1
* u% j4 S5 l6 i4 U1 J else if A_induct=2 then clone 1 load to P_pick2
4 C& M: L5 {2 Y1 A9 r else clone 1 load to P_pick3
7 B5 F, H2 J8 i1 O) T) h4 m' Wend7 \3 T3 q* x$ X; B
& T, K, g# r" g
begin P_pick1 arriving
4 g: E: j& U" L$ G! G' m1 C set A_i to 1 z, v8 {5 S; l4 S Y p- M' O& m
move into Q_induct1. O3 G/ u7 s; w- d
move into pickaisle.induct1
! F1 C& G: B/ g while A_i<=30 do begin
3 s. l( f1 x6 |' P5 S' t. U travel to pickaisle.con(A_i)
2 w O% m1 l% t+ q! g# Q5 W8 p& x6 j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ^+ d3 D. X" W- N+ b else wait for 10 sec
$ S. y1 V5 T3 } H! \3 } if A_i=A_leave then send to die
& P% g6 f+ {' _: @0 N' k else inc A_i by 1
. ^6 V/ n4 {! Z% g end
6 B- k/ I; T5 E' B+ e$ jend" ~: |& _' X! ~' ^; A, @& F
. B2 u3 x- I+ V& nbegin P_pick2 arriving
8 U |/ d4 D; ?# x' n set A_i to 11
# @7 ~# i0 \$ [0 e8 G) D. b move into Q_induct23 ]9 a" h1 {! l! f: H6 l2 d7 k6 H( K0 z
move into pickaisle.induct2 U: S$ ?3 j5 J0 `* w
while A_i<=30 do begin
( R/ J1 p+ h' @' F/ _ travel to pickaisle.con(A_i)
# r7 P) [4 _" \9 N. B/ M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }: A) P" D: E/ u2 W+ G
else wait for 10 sec
8 e! A( Z' j# u! u if A_i=A_leave then send to die, f+ U1 M9 ~2 c H5 [
else inc A_i by 1 i/ f' \! p1 } O# e
end
1 g: B1 o2 p0 x& vend1 _4 t8 C* G6 [6 X$ R
8 h6 w$ _4 H, M4 \8 |begin P_pick3 arriving
% ~; x8 _7 |% ^' T5 M set A_i to 21
7 [* R6 e8 C6 f/ n8 x move into Q_induct3
) V: p0 j& Q P( c move into pickaisle.induct3
7 b/ C) M4 G; h. s3 s$ G while A_i<=30 do begin
! q5 {3 g0 m8 N1 ~3 k% I1 K' h travel to pickaisle.con(A_i)/ e: h8 E% f& Q1 J Z0 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' e8 d& }5 F' ?. F5 n) \ else wait for 10 sec) s$ A( a# |' l% Y
if A_i=A_leave then send to die
3 X! C( q* T0 B0 ` else inc A_i by 1
) e& A4 \2 |! V2 e& C6 W end
v' N" ?* E Q" }$ bend |
最佳答案
查看完整内容
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,其它按你的 ...
|