|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( b8 A8 Z% ?; i$ M
7 A1 s8 L; U1 {' I4 T% g$ E( } y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 G X. p; ]' C
7 \3 m: v* L3 _begin P_read arriving
' |7 {' ^& ^! [) N& @( b1 l while 1=1 do begin
8 ^8 n* ? ~0 Q, i& h read A_tote from "data.txt" with delimiter "\n"1 G( m4 x; @. M8 Y. d
read A_time from "data.txt" with delimiter "\n"4 _( f% w% M) l
read A_leave from "data.txt" with delimiter "\n"" Z4 H, u( ~5 G- @7 ]" j# F N
read A_picks from "data.txt" with delimiter "\n"
; `4 \* z! N0 D& _2 Q$ z set load type to A_tote7 l! O8 h& N2 }4 E2 ^
if A_tote="tote 1" then set A_induct to 16 y3 N" B! j% f! Z8 _: n
else if A_tote="tote 2" then set A_induct to 2
8 X. w$ ~* N9 w2 i5 \ else set A_induct to 3 4 n+ w9 i9 t/ v
set A_i to 0
) c$ W5 E' D8 |8 k& D( J clone 1 load to P_induction
: x, x5 P1 m. G1 A/ G wait for A_time sec1 Q" A3 _+ i" g" f, w
end
! Y7 U6 p$ R- `3 o7 ~) o0 wend; w) P, }- `- U2 R2 y7 f
8 D: T9 z4 H. `& Y8 i( @begin P_induction arriving
9 e/ w Y T0 e1 |4 X if A_induct=1 then clone 1 load to P_pick1, ?3 H, `2 ]" y0 C' E. H
else if A_induct=2 then clone 1 load to P_pick2
* U, b Z; l. b" K- F else clone 1 load to P_pick3
7 u5 }* o! p; j7 D# @9 }end
, w! Y' a" ~, t" }) U% w9 S- E; A8 K4 Z$ T6 n- I1 `3 G
begin P_pick1 arriving
- @+ \% j1 A& v+ V1 | set A_i to 1
( W u3 V5 [) N% p move into Q_induct1
5 F& z- Y5 \# g1 _$ E2 p move into pickaisle.induct1
- V6 K) I0 |+ _8 R+ w" b while A_i<=30 do begin
$ h1 ^0 m: @" {: F. s travel to pickaisle.con(A_i)
7 H0 E: C, k, K) e. r" {2 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& Q% {" X" [% y" X else wait for 10 sec
0 ^5 |' Q* W5 w7 C4 R if A_i=A_leave then send to die
* s1 T3 @ o4 u& }/ b. s) L else inc A_i by 1+ V8 g. S& D+ ^
end
9 a! C0 R! c# D' K" C, P2 l* Bend
! }% _+ O5 E$ E5 J
) a7 G8 s8 c0 {( [, y2 abegin P_pick2 arriving
8 x% k/ n4 o& m8 ^6 M0 s set A_i to 11
% g: P7 R& `9 u; x0 b1 U move into Q_induct2
! i. K) L( {# y: _- G move into pickaisle.induct2; E; Q1 b$ w- H7 j) `
while A_i<=30 do begin/ |: K* |8 [4 G, {
travel to pickaisle.con(A_i)
7 o \+ Q* {! M( R% b: j( q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 K( _) _& {. v
else wait for 10 sec% s$ i* z! N+ W) d. x, ^; B
if A_i=A_leave then send to die
" i" o! m" E" R( f else inc A_i by 1
2 r! s: b m3 R% u end# l5 }' a* v5 x* q6 e% E1 e( g0 L
end
8 ^# z" f/ h1 V6 N: @, S6 J) G o, P: \# o+ f% o4 Q
begin P_pick3 arriving
2 |8 c5 s4 \- F set A_i to 21
7 }5 G( t# M- O0 v3 V; @5 o6 R move into Q_induct3) N. z" b- l5 X! G# m# d4 }2 ^
move into pickaisle.induct3
: p- w" l5 L4 z, f* L while A_i<=30 do begin/ g0 F/ [# c6 S* H! t* N: F
travel to pickaisle.con(A_i)
* Y# Y2 I8 R; a2 Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {! ~: B7 ]3 ] else wait for 10 sec
2 i1 B; p2 n( ?% @/ b! a if A_i=A_leave then send to die
7 \, r4 M3 P5 ?; i/ ?& P else inc A_i by 17 V# H; j; S6 N" y/ u2 {7 X
end$ @6 @! d4 l$ }( W
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,其它按你的 ...
|