|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, ~ m/ c! I3 S4 x' }5 [2 G% p( K
4 {; f' B0 o4 `* w7 V- S我的问题是,在每个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中的数值,不知道会不会有什么不妥。, h$ v. G4 O. q, Z
; r1 E% j" J1 i1 o
begin P_read arriving' a1 o; X0 ]9 l( G) X
while 1=1 do begin
) b0 F1 ~+ r) S: H/ { read A_tote from "data.txt" with delimiter "\n"
3 N( R* @3 L! p! F read A_time from "data.txt" with delimiter "\n"
+ O9 D3 L$ f2 Q% f' i read A_leave from "data.txt" with delimiter "\n"% d7 [& u; e" x
read A_picks from "data.txt" with delimiter "\n"% _* M' a0 j3 X
set load type to A_tote
7 t6 P- l* A: J: m8 R3 T# A if A_tote="tote 1" then set A_induct to 1
! G8 v' }2 w" e5 T9 o0 ] else if A_tote="tote 2" then set A_induct to 2
! v" g& U) n( K else set A_induct to 3
" @/ e6 J* ?$ i z$ o set A_i to 0- I# ~* @& q2 Q4 e* U
clone 1 load to P_induction% i! d6 i0 ~, z5 ^6 i
wait for A_time sec
$ H( c/ W: U; }; l* ?4 Y; s end8 P9 E' I* k: _* ]6 a/ Z
end. ?; }7 m7 I+ z8 Z5 }
( q. `) ~+ i# p" \begin P_induction arriving. l" h# O* a5 o5 v5 ]
if A_induct=1 then clone 1 load to P_pick1
* R' Y( x/ K& Q O else if A_induct=2 then clone 1 load to P_pick2
% g# l! O7 j. H6 K- C9 q# s else clone 1 load to P_pick3
`- F& r& l- a0 F5 yend2 ]8 J2 A3 H+ k) [8 d3 u
/ [3 W' @- f8 D8 b
begin P_pick1 arriving& Z; g. G. E$ D- O: b
set A_i to 1
% f- I2 w0 u' n7 }. Q+ x& r move into Q_induct1
9 p% q0 N0 {/ }# y4 u: O3 T5 K move into pickaisle.induct1
5 T1 m: r k I0 d- w9 U4 i while A_i<=30 do begin
) U- H/ w7 s/ d \2 ? travel to pickaisle.con(A_i)6 | `! Y% T: s! ?) |2 N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' B+ m: j( U1 Z" t* w i else wait for 10 sec, M+ F; U: Z9 _" ^: u
if A_i=A_leave then send to die0 I2 L G7 f; Z3 `' l
else inc A_i by 12 M/ H; v( ^# g6 V
end
! [0 o+ ]" v: P9 O; W/ Xend! T) x, E4 [$ D$ l; l
' P# t" e! O; u0 \" e3 ?2 k: e% Z
begin P_pick2 arriving
( y0 U% N4 G7 O+ C# w* _- x: i set A_i to 117 J9 T( n- L% T5 m3 o
move into Q_induct2
3 l+ a3 m z6 s6 l move into pickaisle.induct2
7 ?% l7 \) g7 e1 Y. P) x/ o: v while A_i<=30 do begin) l6 U4 r/ @+ k% B
travel to pickaisle.con(A_i)
$ E* w9 U4 Z) U+ g" `- _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& h, W! I7 V6 ]. k1 e
else wait for 10 sec
3 c5 h0 }1 v9 A* y if A_i=A_leave then send to die2 r: h% z5 J) a2 X/ w
else inc A_i by 1, B3 i! j6 q1 b+ L4 v& A+ `" D
end
6 h9 c- j5 H+ `) d9 V% rend- W, w$ Z5 {2 K6 F6 [# {$ }
: \6 z6 }8 @9 T2 abegin P_pick3 arriving
' T" D; c$ m, F: @& e) k set A_i to 21
6 Q, A! g( C5 |( a move into Q_induct3
' D3 i: _" i8 a# a8 E8 ~: n& | move into pickaisle.induct30 O3 [' y+ c' P5 d+ m9 J' z
while A_i<=30 do begin& i0 f5 [7 Y8 n% a6 @& ]
travel to pickaisle.con(A_i)
; i0 ]6 `- A- h* L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. s0 U3 s& j- q' B
else wait for 10 sec) L8 i% S% \4 a Z' a
if A_i=A_leave then send to die8 d, w2 d8 [: C% \7 @
else inc A_i by 18 K$ S) `0 G, N d% Z: h+ A- I
end: r \8 [7 F) Q3 Z
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,其它按你的 ...
|