|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) d" t& ?* z% K4 [) Z
- l* E/ i$ D) p5 n+ U* S: G' Q0 a' u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ R1 P( F( R. V$ T8 l# w* l* P% x% c; h$ Y
begin P_read arriving: R$ t" l" i: ]3 b' X9 \* z8 d( e; b
while 1=1 do begin
% k0 l$ w& O9 x0 L& ` read A_tote from "data.txt" with delimiter "\n"& P9 J: @6 s* V0 F s- }
read A_time from "data.txt" with delimiter "\n"
9 C( c N5 r$ G c read A_leave from "data.txt" with delimiter "\n"& s, U' ~( |" ]
read A_picks from "data.txt" with delimiter "\n"; ^! M. }1 L4 p& u4 G7 t# f
set load type to A_tote
6 L' M; m, C' X9 {' v% H0 g2 D if A_tote="tote 1" then set A_induct to 17 Q7 j/ S1 Q* f
else if A_tote="tote 2" then set A_induct to 21 M4 S& B5 r' t
else set A_induct to 3 3 s" R I0 B: `% i
set A_i to 0
; [' m6 a. n9 X. X clone 1 load to P_induction1 Y/ _! Q( W4 M) d6 t
wait for A_time sec
( o$ D! s' @3 W( g7 C' `0 r& ` end$ z+ q8 ]! k0 o: @( {/ e
end
( B/ D1 R5 n* A$ L! h$ a- ~
) U4 `8 u0 x& Nbegin P_induction arriving
& V9 W" C" W) V% B C0 }& o if A_induct=1 then clone 1 load to P_pick1
/ c" ? ~9 Z& l" ?/ h else if A_induct=2 then clone 1 load to P_pick2; E w& ]& F8 V' ?) c! g. Y: H4 d+ z3 L
else clone 1 load to P_pick3
* \# ?2 L% d0 U; A7 y. ?- @- _$ Yend
1 I" F; x! V9 C- ^0 s. _- @- P7 h/ s6 B* ]2 G
begin P_pick1 arriving
- M% s% ?' x% p# ` set A_i to 1
: h( _. |1 @$ ] move into Q_induct1, _2 c1 H& C: V0 t0 k/ ]# s; r. @
move into pickaisle.induct16 p: f$ j. _ L% L1 Z# t, w9 K
while A_i<=30 do begin( y- q2 C- x- N! w( V
travel to pickaisle.con(A_i)
3 H6 q2 {& i X+ Q0 _+ o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. g) Q+ H8 Z3 n$ q' I. g1 C
else wait for 10 sec
, ]. R1 R; P* P/ W, c- l if A_i=A_leave then send to die; M! |1 f; l4 a1 w" C1 D e& { ?9 [
else inc A_i by 11 T% [5 s$ B, s- }5 w
end9 ]4 i7 ] d, L+ A* ]& ^8 n
end* F. X3 \" o- D. p
% _3 {" l. X, K! k7 Z5 ?begin P_pick2 arriving
4 p7 C1 W' o6 u# A8 y9 v/ C \ set A_i to 112 L( F9 S0 l8 e1 [
move into Q_induct22 p8 |1 x& X" _0 a. [4 z
move into pickaisle.induct2) G0 j2 C; y# B; R
while A_i<=30 do begin3 w0 _' N3 Q1 G
travel to pickaisle.con(A_i), R2 n5 e; }1 H% k, l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% w4 V; r& [6 q else wait for 10 sec
2 a7 C4 O c/ J- e4 a X1 U0 r# ^- A if A_i=A_leave then send to die
* g& o; i( B, F0 x3 G( I, x) n else inc A_i by 1
1 M) G* M1 E$ y& ?0 t end
0 u, i8 e6 B; T% q7 Iend3 n! j' A1 i. I$ O$ s' ]
$ z% ~" E" ^2 ]8 z, Q+ q8 v& Wbegin P_pick3 arriving+ h* h$ B. T& [& ], @
set A_i to 21
( O, s6 R5 [- ^3 S move into Q_induct3' e% ^3 W1 O$ \) S' _# L7 q9 F. _
move into pickaisle.induct3
" e- n- p5 D$ n. ]: m while A_i<=30 do begin B$ k3 M$ j Y5 {
travel to pickaisle.con(A_i)/ Y4 S9 z8 b" J; f" X0 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# C2 Q- f; P ^1 ^! \1 Z else wait for 10 sec
# A9 p& r9 J5 P& F if A_i=A_leave then send to die
" K# t: H! a# o5 c else inc A_i by 1$ Z' s6 @, Z) D3 k) n! S# } f5 V
end. b0 a' p6 E* 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,其它按你的 ...
|