|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 {8 I& y, o9 u, O; x0 X
5 l5 e$ N f. B" \1 q( |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. T4 F ?) }. Z6 t& J& R' o B& F0 R6 }1 Z9 a \
begin P_read arriving
9 h& N- t/ r) b: C while 1=1 do begin
i* u( C8 i r) c+ e read A_tote from "data.txt" with delimiter "\n"+ ~* q+ V. E4 o* j9 `, }
read A_time from "data.txt" with delimiter "\n"
u2 x' t l! ~0 ]5 J read A_leave from "data.txt" with delimiter "\n"8 k" J5 T$ T' `8 B! G, f
read A_picks from "data.txt" with delimiter "\n"
" W# l6 Z" d" L% f. Q! q' x% v set load type to A_tote: R/ o; L1 k6 {/ m+ m! W( [2 W
if A_tote="tote 1" then set A_induct to 1
1 \1 o; U) L! N, V; L( B8 p( F else if A_tote="tote 2" then set A_induct to 2
+ E9 b5 m L0 |5 n6 U else set A_induct to 3 0 q6 t% W# `: a2 i0 B. K7 z
set A_i to 0: m! ~. B1 @* B8 p! F- T5 H! U8 x
clone 1 load to P_induction# [ G: D/ F6 t! s, e
wait for A_time sec; v& O! B0 B* K% D8 q
end
( Y% ]& @9 N8 W" f" ~( D. @end; P2 j; v2 h7 K/ r5 R# h, W5 i+ B
( h. P9 B, a |' Q2 F/ Vbegin P_induction arriving# o6 ~) l' X, D4 D& k" S1 w
if A_induct=1 then clone 1 load to P_pick1
: c5 p% u. c% {1 ?5 s else if A_induct=2 then clone 1 load to P_pick2
`5 X+ F3 i' T7 d3 [- C$ X else clone 1 load to P_pick3
5 v& K8 Q4 w4 Z$ G: o* A2 c1 I* Mend; e) Q F& I ?% ?
2 }, [) |5 I: ?$ S5 b* W7 |. N7 Qbegin P_pick1 arriving
) x3 w) _: ]( V% K4 b* K set A_i to 1* Z) k+ O e9 J. J* Y# N6 c; Q' i
move into Q_induct1: f4 W2 w6 c& S+ L
move into pickaisle.induct1
' s6 M* f* r: S while A_i<=30 do begin8 ]) V7 t! p* v1 ^" m
travel to pickaisle.con(A_i)' C8 n( l2 N& t. K0 H$ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ e. l1 f( V0 M- Q; h0 m* n else wait for 10 sec
A8 C2 p. T) t: o if A_i=A_leave then send to die" R2 h7 H9 T" K3 A/ q" Q
else inc A_i by 1
4 g0 l3 f- t, w6 m) u end* E1 t( L8 p( t0 U
end; h+ k6 \/ D& E% C0 m" H; g4 N0 v
3 I# M9 h. V& n! [) z7 |2 S
begin P_pick2 arriving
: C& o5 j0 }$ B set A_i to 11; z3 I$ f8 F! I! P; u
move into Q_induct2
9 T$ _- d" u" O) X; u7 y% G) o8 N7 c% m move into pickaisle.induct2
! S1 V' Z( h8 T8 ~0 M& f* d while A_i<=30 do begin
3 j( i" p& Z9 I travel to pickaisle.con(A_i)
' M: m. G+ D; L6 m* |6 }3 g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' Z- L# p, L/ h6 D6 P0 l) P. q else wait for 10 sec' K$ l# Y R8 ?+ R) D8 I
if A_i=A_leave then send to die3 ?3 V3 Z; A5 B* H7 X$ f
else inc A_i by 1
5 c4 o$ |8 b" `- { end
8 j4 z( g$ l% ?) X0 \6 q1 x; Send- D& `$ r% U, q% ], P% j
6 f5 g; F, M2 z; W: @! E# e1 Y
begin P_pick3 arriving) }: n- n7 ^5 `
set A_i to 21
! R: I: K& \. y A0 T move into Q_induct37 ~" q+ k) J, v; [5 _7 w
move into pickaisle.induct3
s- Y6 c/ q% N' O while A_i<=30 do begin
8 O& ]3 l4 L$ X8 y7 t5 n4 B travel to pickaisle.con(A_i)
) `2 N- ? c8 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 d: V; s3 O8 y' Q! P( v$ o else wait for 10 sec
1 E. u7 H) @, T, C9 V' ^8 |+ ^ if A_i=A_leave then send to die
4 \8 L- c* |$ ? else inc A_i by 1, E) ~7 p& o; T, L* v
end
& R! g! t. \6 |$ @2 ~' V6 R, Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|