|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) S' _$ m! e# J# x! {
4 a* _/ b- W( H* R0 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 |- c- W: M% ^8 P1 H& I
* ]8 u% q+ v; ?8 _5 Hbegin P_read arriving
. T0 Q m" X$ x8 s3 \; v while 1=1 do begin
+ i6 V6 D$ H' z/ [. L) o read A_tote from "data.txt" with delimiter "\n", f! N! r9 n/ q) m$ w: b9 }0 `" g
read A_time from "data.txt" with delimiter "\n"
/ e1 g' p3 B' {6 g read A_leave from "data.txt" with delimiter "\n"
5 D8 Y: H8 n! D6 ? read A_picks from "data.txt" with delimiter "\n"
8 r; `/ z$ r- H& L6 W0 N$ i: ? set load type to A_tote9 @; Q% U1 Q6 f- w1 k
if A_tote="tote 1" then set A_induct to 1
% d$ A0 M# l6 T else if A_tote="tote 2" then set A_induct to 2
8 ` I* l E; l2 z+ c else set A_induct to 3 3 K) f. h' x/ h' f7 |
set A_i to 0
( ?5 {) }$ N i: i( z. o4 ^, `% N clone 1 load to P_induction
. ~8 Y& F/ ^: F& D8 y% @0 Z wait for A_time sec
) f, F" `# @, D# x$ }# K! i3 R8 t, m9 L4 F end
& {8 k2 i3 M' _3 oend
3 s; p6 c. k' X% J C9 Y4 T( F. o' Q
begin P_induction arriving6 \/ h! }; o$ z, U% A5 o- \% y. a
if A_induct=1 then clone 1 load to P_pick1
9 \- f4 j/ u; n$ L5 I8 d else if A_induct=2 then clone 1 load to P_pick2( M4 P% x! ^. h( z3 `
else clone 1 load to P_pick3
7 e2 `& J+ k1 Q9 M( N d. @- `end
8 ?4 Q: G K) v% B
, h. S% p+ o; x4 Z" Ebegin P_pick1 arriving
& a/ K/ M( e5 u7 s set A_i to 1 ?% j0 Z6 S9 [# A1 S6 J9 I! Y
move into Q_induct1
' \. {% y2 e, B: u7 v move into pickaisle.induct1, C7 Y- g+ j, V" {% _- u
while A_i<=30 do begin
9 T% O6 Q7 ~8 g; C travel to pickaisle.con(A_i)
3 v& P, I6 ]6 z& l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {) l3 T( B# e) J0 ]# r+ T, w else wait for 10 sec1 I3 L$ `5 z: Y1 H
if A_i=A_leave then send to die. G" A* `! e( k" e6 M: C
else inc A_i by 18 A: y8 B# k7 y6 S" W1 g
end
( o* c; m$ U0 U6 G9 E& S* rend
* `9 ?+ F, Y4 E( J4 o$ @, {* W
2 W+ v" A( {6 [' ~$ ]' lbegin P_pick2 arriving
# t. c% L7 P) z& l set A_i to 11' z! k9 l5 [/ {' T% Q7 t
move into Q_induct2$ J+ @$ i, d# j* q
move into pickaisle.induct2
6 b$ ?1 d% T. h$ E; T4 z while A_i<=30 do begin
7 y Y, P, q' D travel to pickaisle.con(A_i)
& I6 l. x8 {/ d, T3 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
i1 _& _- D! m2 A6 b5 |. ` else wait for 10 sec
: i' g* a& u( ?3 Q! n if A_i=A_leave then send to die
6 ~. \: o/ u! k9 Y0 y# r4 s else inc A_i by 1* M0 H# C& z* E- [' g; P4 u) c' `
end
! Y) ^2 @% s% N2 [5 c0 ?$ q8 \5 S2 Pend
* l7 [6 T& a5 b9 N: l8 j. n& Z$ w
begin P_pick3 arriving
" H& G* T, O* R& m* L/ n set A_i to 21
. W. D( h4 [- Q move into Q_induct3
7 e+ Q4 Y0 a }$ U/ g move into pickaisle.induct3
) f& f5 i0 u: }4 E, l; h while A_i<=30 do begin/ E, W0 F% s0 K' U# H9 k( e9 E
travel to pickaisle.con(A_i)7 H0 p# h& ^1 `" h4 H- G3 t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( }7 p4 v6 Y/ F' m0 b& ]4 C5 H else wait for 10 sec
8 [' Z* c) A+ |$ {' l7 a$ f" v: K if A_i=A_leave then send to die
2 f# G2 [' S9 W S) a9 s! s else inc A_i by 1; q( J7 r0 ?6 Q/ D- S# o4 M
end
) Z( ]" W' ?* aend |
最佳答案
查看完整内容
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,其它按你的 ...
|