|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! }& Y% P: Z5 ?# J( J" O! }( V
4 Q; w0 D8 O) j; P5 a& E" N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" H4 ]" r* _0 |2 c6 W: S5 }) N% f7 [. l
begin P_read arriving
+ w4 u5 o0 s/ o: Y6 g* t* p while 1=1 do begin. P4 @* l2 d* X5 O' v
read A_tote from "data.txt" with delimiter "\n"( B& [% }3 P. j$ {
read A_time from "data.txt" with delimiter "\n"; i t0 `3 w( g/ {8 H ? E
read A_leave from "data.txt" with delimiter "\n", l1 y' Z/ @( F% U
read A_picks from "data.txt" with delimiter "\n"+ c# d3 k) n, j
set load type to A_tote
; J( x+ O& H0 ` if A_tote="tote 1" then set A_induct to 1
6 U- t' S5 P1 o6 `- o+ i else if A_tote="tote 2" then set A_induct to 2
( T) g7 ?+ Y, B else set A_induct to 3
2 ]6 T$ H/ g9 _& T8 S set A_i to 0
3 \4 @9 y* y x" f6 T clone 1 load to P_induction( r6 @; y4 v2 w2 S! m% G
wait for A_time sec" ~! b+ ?# ~6 ]+ Q0 m3 z9 D
end
3 I; K! l2 E9 w) b' l8 y( B: gend
( C k& j5 `7 F2 }) L/ x4 _8 [1 B
3 q- l1 o1 N0 j, h8 ~& c2 ]( |begin P_induction arriving3 {4 h/ M1 M" n
if A_induct=1 then clone 1 load to P_pick1; r' s( a+ V2 z5 r/ B" `
else if A_induct=2 then clone 1 load to P_pick2% D* u* Z, l: |4 `" T5 F
else clone 1 load to P_pick3( h$ j, ]) ]) Y' g2 d9 ^0 n* Z
end
3 x4 }/ \# Q' @; Y1 x3 H+ u/ X0 ~
' T$ @0 k$ g9 X& v! Y. K7 abegin P_pick1 arriving" `+ [* H% p2 X
set A_i to 1
, t8 k5 a" u7 r' z, p move into Q_induct14 f2 H" @5 A/ P
move into pickaisle.induct1' t2 `9 e: U; w$ w
while A_i<=30 do begin
6 B) z( f6 M0 U" U travel to pickaisle.con(A_i)$ i+ L: G* A- a8 ~, y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) C% o& ]( q7 @
else wait for 10 sec; F2 N" v9 q% ? d- G
if A_i=A_leave then send to die0 x7 @- a0 v# G6 i6 s- H% W/ Z; p
else inc A_i by 1' I, |' h- w* ?; t% p
end
0 _; l* F5 x* _: d$ I" i4 _end, ?. l) e! i9 @+ W8 l7 b' D
+ W( R. K' w+ N3 f/ [) Qbegin P_pick2 arriving/ o% c/ o7 X5 V$ G3 u
set A_i to 113 k, g& R9 J0 x1 F
move into Q_induct2
4 ]9 f: o [" y& i move into pickaisle.induct2
% S# L" q- z4 p while A_i<=30 do begin
: N* b- m% n0 {, Q4 g) z- M; }% | travel to pickaisle.con(A_i)
8 {5 K0 u5 T# ~- w, [: P; F2 ?, q8 Z) K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ^$ j/ M) Y* R: N5 H6 \! d0 n
else wait for 10 sec
- h; d. I2 d# T! \& W. U if A_i=A_leave then send to die# _ V; k# }1 a' u) B: B
else inc A_i by 14 l3 l0 A9 g8 U1 h1 K
end
& z$ t! B. T4 s D# Kend1 e. }+ O3 K, a+ M" l( s0 y+ n: K
! Y+ T; Y7 `9 g% | bbegin P_pick3 arriving' q8 R( ~1 h6 c. U5 B5 r
set A_i to 21
! n7 r7 y' P* U+ n' x5 Z6 T% G8 q6 B move into Q_induct3/ b9 D$ a' O \' z4 |4 y+ V+ E
move into pickaisle.induct3
/ ?0 Q0 J) v$ p6 D, V5 p, ? while A_i<=30 do begin8 Q- ?3 l; y% [7 h% S
travel to pickaisle.con(A_i)
& ^! ^/ G( r, }6 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! s& f6 i6 d [% l else wait for 10 sec
4 u" C9 ~) Q( Z. c if A_i=A_leave then send to die! N+ P% w% Q4 E' K5 m% Q3 u" G
else inc A_i by 16 P- H, Q, P: R- ]( u
end" }2 V8 Z1 [+ w: c3 S. y* x
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,其它按你的 ...
|