|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! ^% E- w. ?& L! M, B( |
# B7 N: A8 Y" z" S0 X, e4 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中的数值,不知道会不会有什么不妥。 k- G9 j. m1 O/ l
+ e( Y& j: J) o7 I" h2 ? [
begin P_read arriving1 l0 j3 _% o& @5 i1 v9 k4 c1 _% M
while 1=1 do begin
6 ]! t9 `5 l4 T) n) ] read A_tote from "data.txt" with delimiter "\n"
$ i4 {: i2 O9 {* C3 C6 U l, G read A_time from "data.txt" with delimiter "\n"
3 a) u+ [ d" G; ~3 J read A_leave from "data.txt" with delimiter "\n"$ ? U# ^+ Q9 d4 z
read A_picks from "data.txt" with delimiter "\n"8 L7 n' P2 w' {: C
set load type to A_tote k* M. `1 J L$ [8 B5 c
if A_tote="tote 1" then set A_induct to 1
1 E4 v: g+ x* t8 V- R3 z( B else if A_tote="tote 2" then set A_induct to 2
7 @& j/ Z# [ i' e: L/ t9 ] else set A_induct to 3 - y8 V2 E/ ^: l: v. f4 E' G; K
set A_i to 0' T* ^, f1 M z: i) m1 w) f+ y
clone 1 load to P_induction3 }) d9 p/ v: K1 s! b# g$ m4 C
wait for A_time sec7 ~3 T1 i5 v' G7 F
end% } i, B& j( V) [- w8 }
end" {3 L' G3 n$ c" d& u
& G9 i0 S2 W+ bbegin P_induction arriving
& ~# `! s( d. ]% D5 s if A_induct=1 then clone 1 load to P_pick1+ D" S( ~1 K8 g5 [
else if A_induct=2 then clone 1 load to P_pick2; [! O! o! C3 {' u, @; N
else clone 1 load to P_pick3
6 }: W' s/ {) t O( t+ vend; [4 K( T0 R& S
9 \# I5 z. O' B9 H
begin P_pick1 arriving
c3 A E( ]2 C: B set A_i to 1
l! h7 v' e$ ?# A1 z1 P% `( L move into Q_induct1
+ V- h2 |5 \& t move into pickaisle.induct14 D3 w( y* U1 l
while A_i<=30 do begin: a8 R: |7 H2 X
travel to pickaisle.con(A_i)
1 E4 q* Y( [/ i7 v- C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T+ U) {1 w: a
else wait for 10 sec
- }: y6 A G/ v4 M3 J if A_i=A_leave then send to die5 X4 Y0 O+ ]# a) P
else inc A_i by 1
r* \% ~% o& \1 M1 o end
) K/ }$ F& `' {1 \4 _, Gend
; O8 D4 r/ l' O5 _8 ]: T: ^$ f# I) }/ k: P) G! R& ~* `( L0 \
begin P_pick2 arriving
; Z1 ^# G8 ^/ [! F, ? set A_i to 11* F5 F, T- u& s
move into Q_induct26 M+ y7 B4 z. M. E
move into pickaisle.induct2' j4 B7 P& e$ N. f P4 Q
while A_i<=30 do begin2 S, K5 Q, ~4 D, \8 G
travel to pickaisle.con(A_i)6 }4 v: [% g# [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ?1 H8 X& |! G6 p else wait for 10 sec" I# T* H" \# o
if A_i=A_leave then send to die
/ u( ~+ J) X0 Q" B else inc A_i by 18 g% x) X2 {+ q
end8 w/ F9 p$ G$ R& y6 n
end+ ?) C! K6 j; [
2 q$ }" ?. i1 p) ~: lbegin P_pick3 arriving
8 {) F& B" h/ k' |6 k$ I0 x set A_i to 21- l8 v4 c p- x# A2 @3 W
move into Q_induct3
0 X/ b6 A- L0 ^ move into pickaisle.induct3# x0 l; ~ U1 b: w5 w
while A_i<=30 do begin# w1 b) W, g. {% A
travel to pickaisle.con(A_i)
$ p, O9 x& \$ b9 Q+ \# Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- J6 Y2 o! g& m! C( u; | else wait for 10 sec0 x: o! I! I! p& i
if A_i=A_leave then send to die
9 p# P( C0 n% F V; e else inc A_i by 14 f5 m, W/ k3 Q, m" S( J! L ]3 E- X
end
3 [& f; Z5 H" Z: A) ]( C/ L, @3 Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|