|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
L9 _7 v9 u0 [9 }. B" O+ a3 b% ?0 P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ e8 G$ O2 B' Y1 q& ~7 c, O/ L- \6 d8 [' u- K
begin P_read arriving; G7 H: D" o. @4 K& O
while 1=1 do begin9 I g2 s& O. _! I- ]1 _5 ?; {
read A_tote from "data.txt" with delimiter "\n"
" u6 ]7 W9 I- @" E- e read A_time from "data.txt" with delimiter "\n"; N' x& P& U8 V0 D, t0 X! m
read A_leave from "data.txt" with delimiter "\n"
* x$ c/ u+ ~+ S read A_picks from "data.txt" with delimiter "\n", @. h6 v1 x6 H- C
set load type to A_tote
, J; Y; Z* p- [% G3 L if A_tote="tote 1" then set A_induct to 17 g, a) I9 E8 s; M0 f T) ~0 |
else if A_tote="tote 2" then set A_induct to 2
1 M: g2 x- g4 p' o, K else set A_induct to 3
0 O! o5 o( ? ` set A_i to 0
) p6 @+ r. \, x! |( z& l, W7 e clone 1 load to P_induction
1 F2 H* K& x" C6 _2 f a wait for A_time sec+ f3 v; {3 B( [0 q8 z
end
! C- S6 |7 a2 N% o5 ?. }7 Cend/ U" N$ x; ?4 `) d, }; F- @
9 q$ P \; L. c; h* r* O
begin P_induction arriving
: z2 Y" I$ M8 w, X- k5 J if A_induct=1 then clone 1 load to P_pick1) b0 `7 e4 y% l- }. [9 W
else if A_induct=2 then clone 1 load to P_pick23 X; F4 I( m0 m( {/ i) a' V
else clone 1 load to P_pick3
* m% c2 p6 }1 |4 m& Fend
) }0 \( b% P3 q% V! x/ M e% o; A
5 r7 C* y' I3 p: |6 Abegin P_pick1 arriving. l" f4 D) H% x) p2 T5 \; L x
set A_i to 1
9 p; W6 e' q) p* V" _: p move into Q_induct1/ _& A+ X/ D5 D
move into pickaisle.induct1
( C- I- U" c! L7 A3 c while A_i<=30 do begin
4 I, t4 O2 Q2 q1 h. t3 o \ travel to pickaisle.con(A_i)8 a+ f6 h9 @! x, |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; T1 ~1 X6 i, v# k; U+ x
else wait for 10 sec
2 p: |; x& L( d2 ^3 _/ B7 Q3 M+ V if A_i=A_leave then send to die. {$ d- Q9 j0 V. T3 _8 |
else inc A_i by 15 M U) C/ I1 O/ J+ Q' U- V) i7 E
end
. P& @6 @* Z, `end0 m! i9 D- B9 o2 D7 J+ C$ j/ s
2 r* ^8 w3 H y4 S
begin P_pick2 arriving! F, I* T4 i5 v
set A_i to 11& L4 z! R/ L& x% a8 q+ S
move into Q_induct2
R2 y: B E% i/ P; M+ { move into pickaisle.induct2
) P/ _3 N/ O* X$ C7 p9 _ while A_i<=30 do begin
. v6 E J5 D& G/ }, L: E travel to pickaisle.con(A_i)6 E( X# g$ d4 D9 l5 w" m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 `1 C+ T: o% `& I: j0 `0 t4 U
else wait for 10 sec# v; D2 @/ X, ?# E
if A_i=A_leave then send to die3 l/ B: |8 |2 \$ t$ p* Z
else inc A_i by 1
5 N3 ^7 T& x. p end* @+ V) R3 P4 O1 F" l
end! Z: f$ N, r+ S* ]. i. x
4 E6 B3 H$ u3 X% g7 {/ r, U0 ]$ Wbegin P_pick3 arriving5 L% a! J& V% @% V% V5 t* d; |
set A_i to 21! s* m9 s# {/ V
move into Q_induct3
+ C, D$ ^8 o7 K# m& J move into pickaisle.induct35 u- s8 x' b4 p+ l
while A_i<=30 do begin
, W3 \6 o- A0 {" \, F* {9 R1 p travel to pickaisle.con(A_i)
: q% \+ J. w' T" R) ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) _) x, O8 g1 o. \ else wait for 10 sec4 t8 W7 n3 V+ H" B
if A_i=A_leave then send to die7 e; |4 ?5 u: D! p2 q
else inc A_i by 1
7 j. i [$ ?5 D, |* P end
& ~7 q- {3 f2 i" ?* |3 Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|