|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 w1 d1 I" y+ r3 a! }- S
% {" ]. c8 \2 W$ Z) p i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; t8 Q3 v, H q Y, ]. H! F
: Q0 F. J& ?2 |4 l! ]6 o
begin P_read arriving
# z" V9 p& _; ^( O while 1=1 do begin
' u! y/ e0 a p( \ read A_tote from "data.txt" with delimiter "\n"
3 N. J% a: {- a& j1 t& o, } read A_time from "data.txt" with delimiter "\n"; a! t& q9 K; N/ Q
read A_leave from "data.txt" with delimiter "\n"
! L/ R* I3 r) }6 ^- x" |0 J! [ read A_picks from "data.txt" with delimiter "\n"
+ {; u0 e9 f7 D) O' ?6 l set load type to A_tote) r9 G! C1 ?+ O$ Q$ Q, }1 R5 R
if A_tote="tote 1" then set A_induct to 1
/ `/ a0 l8 w. x! P else if A_tote="tote 2" then set A_induct to 2
% B3 o1 K4 W1 h& Y7 _ else set A_induct to 3
3 J8 A8 k5 l2 O" `7 l set A_i to 0. m6 L0 O/ Q7 @" u
clone 1 load to P_induction
$ u- \% }& H; ~' x3 k8 F1 C wait for A_time sec5 c* R! O8 q( f! ^( Q |& H
end
3 f& V5 F* w- x' M0 F7 d8 E" Hend1 C2 i' s8 N$ @ X% w! M. V; O
/ P% @$ u# g9 G
begin P_induction arriving/ H: O2 B* A7 J% d- |
if A_induct=1 then clone 1 load to P_pick11 L2 D/ O0 k8 N9 b+ n9 H
else if A_induct=2 then clone 1 load to P_pick2
1 D7 f6 ?& m n6 {% X else clone 1 load to P_pick3
$ u% A) o: d4 \- r S/ }end7 [ h- p7 m( h- V
; E/ n) i; `+ ?) `6 [- S
begin P_pick1 arriving
& ~7 n8 k z- r& ?5 P set A_i to 1) L/ @# [, @* s; Q" }7 ~6 d
move into Q_induct1
$ Z1 o" }4 w) z& ]* Q' M; D& c2 x2 i; n move into pickaisle.induct17 q5 e# W1 n. m9 l0 m
while A_i<=30 do begin6 `2 Q+ d/ C% z; Q9 h+ @6 @
travel to pickaisle.con(A_i)# T1 T0 g9 d1 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* G" l- _% {% A
else wait for 10 sec
0 n8 O$ S1 h" f. b! p if A_i=A_leave then send to die
! }5 e: ]# G( r0 V; @% x" U( E) V else inc A_i by 1
$ b2 P! ]% Q# p4 { end
% u3 G1 U! @) N2 Z/ L- w4 Y! o+ }% Cend+ ?$ e' q3 a! {; X. o6 V# k
" c# v* @8 V) P2 v/ L
begin P_pick2 arriving
5 c$ }- l* a9 r4 ?; ] set A_i to 11/ {# D. Y+ G. i, w2 o: d0 n
move into Q_induct2
+ t6 Z8 Q0 M. ~* ?0 K move into pickaisle.induct2+ l) J) z1 |! A" H8 M# T
while A_i<=30 do begin
4 |1 h" f4 g# m0 r' O) T travel to pickaisle.con(A_i)6 v6 S, l$ @" i" e1 `9 i$ i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec c* B, `7 x5 R( b, l4 k6 i
else wait for 10 sec
5 @ ~' a# d% p% B r* [ if A_i=A_leave then send to die
- _6 Y$ [* i8 F6 T else inc A_i by 1) I6 ~! ^2 l1 [6 H/ k; e2 ^3 K
end
- s) F$ a7 K; \" qend
' _& g, e: B* t4 }. T4 W$ v/ v: U0 A, T! _) @( e
begin P_pick3 arriving
- B0 ^* x4 ?& u3 U" y set A_i to 21
) t+ I7 P4 E7 V2 y move into Q_induct3/ M4 D: K' t) m2 o' n2 r$ P
move into pickaisle.induct3
( Q5 d5 G( n: n+ G9 e& r% ]2 [+ u6 U; m while A_i<=30 do begin3 C! k- b! [4 b. T* r* `1 A8 i
travel to pickaisle.con(A_i)
d2 v; o! L& b) B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) O. X1 e! S# a' k8 U. s( ~3 y
else wait for 10 sec w: n: j0 @: m7 |
if A_i=A_leave then send to die/ h7 o( I( @ h1 W: I5 W. x8 q
else inc A_i by 1' r$ I) K* [% e, y8 h
end7 Y. u0 L3 j! J
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,其它按你的 ...
|