|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. j. D$ D8 f2 O) D, z) T* f9 Y* J, |7 w- F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) C8 _$ B7 p/ r2 ^. _, j+ y* j
1 T# J: I4 ?$ e, B$ E4 ~
begin P_read arriving' q" H f/ H& G# \
while 1=1 do begin. S3 P4 n2 s2 E- L1 M1 R
read A_tote from "data.txt" with delimiter "\n"
# E7 S# M% d* j# ]3 u read A_time from "data.txt" with delimiter "\n"
3 z# r0 Z6 |1 r3 T6 `2 U read A_leave from "data.txt" with delimiter "\n"4 x& |' V G! h+ y1 L4 Z" ^! h
read A_picks from "data.txt" with delimiter "\n"
; [$ M/ s7 a$ [ X v# q/ S# J set load type to A_tote
8 o. j7 u' H) b% x if A_tote="tote 1" then set A_induct to 1
2 I$ @4 K9 l& P. M7 o+ P- i else if A_tote="tote 2" then set A_induct to 2
0 o- T+ m& Q6 L& n0 J else set A_induct to 3 7 J! A N2 y4 O2 A) f) C
set A_i to 0
8 z+ ^' l% Q) b/ W& Q- t( ~$ O clone 1 load to P_induction% W! a3 F# ?. c- \1 k b( |/ [
wait for A_time sec
& |" f4 b, D% G+ V end6 W8 [. ~/ U8 V U% ?7 D
end! r5 _- L! U; c1 h, a
; l6 j( \; |5 b- W3 r. z( v
begin P_induction arriving
3 g2 u0 c9 D$ d' i; N Q# G# v: c if A_induct=1 then clone 1 load to P_pick10 o# o" ~+ g e3 _1 |- }% h, _
else if A_induct=2 then clone 1 load to P_pick2
4 K4 @8 D: r5 Y8 N" V/ l else clone 1 load to P_pick3# n2 r# E% i& `
end% ^0 T0 @) c. h) h+ p3 m4 o
/ ^7 I y0 ]) lbegin P_pick1 arriving0 v7 y y4 _" l0 Q5 J& a ?( r$ e" v
set A_i to 1
' p1 q" u; v2 O move into Q_induct1
2 X1 v! k/ T0 K+ C3 p move into pickaisle.induct1
+ A- a0 d7 m" t while A_i<=30 do begin
0 `+ ^. ?. ^& H6 V travel to pickaisle.con(A_i) x1 c& l8 f3 G8 j: ?. }3 q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ C8 A& K/ g" D( J* C
else wait for 10 sec8 t" |% y/ {4 m0 c0 Y( o/ H
if A_i=A_leave then send to die
/ v2 w2 ^3 w! D' J) g+ `0 f/ {3 {9 c% w else inc A_i by 1
( o2 H2 e4 V8 b8 Q+ [8 H9 N6 ` end
5 [6 W4 ^; m' u% T. ^2 x; Z4 J5 Pend
$ [5 l$ ~% O6 s% m
# Z8 n4 L& R9 ~: O% m& y; c# Bbegin P_pick2 arriving
. n5 _9 X( b" U+ R set A_i to 115 m# v% ?6 ~$ x
move into Q_induct2( ^7 j1 j* F. E7 g N
move into pickaisle.induct2
" T( V8 x; B2 M3 m/ D/ u while A_i<=30 do begin; r! N6 E4 `9 J4 f; }7 J e! Y9 L7 a
travel to pickaisle.con(A_i)
$ P' C; O" c: z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 X: h# m- ^: ^* ^% [0 L
else wait for 10 sec
3 \# h& [+ }8 b: L& x6 r if A_i=A_leave then send to die
5 a% ~( e" F' u! T! ]9 X/ k5 `1 }& A else inc A_i by 16 {* w8 W% e0 ?7 N" i. |; C
end
9 G1 E6 `; P0 i; Zend
$ E% D( g8 o1 ?' e2 ?! g1 f5 \9 u0 |2 B; W- ?, e2 r, ?$ E
begin P_pick3 arriving8 I& W* Q7 v' J. N1 u# |5 J
set A_i to 213 s! C; e8 n# p' G) C" m
move into Q_induct3
2 ^& s. ?* I- g& C, _/ Z( j( Z, m move into pickaisle.induct3
# z; `8 s! ]0 x' h3 M while A_i<=30 do begin
! r: U( S' P0 \1 e$ P travel to pickaisle.con(A_i)
9 i9 a6 L+ N0 p, H" ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; l0 j; [# A: P" i( @6 b5 Z, m, I
else wait for 10 sec5 f+ D$ u2 o( r& F& a8 I
if A_i=A_leave then send to die; t# e) i% o- Y& C7 n2 E
else inc A_i by 1
/ ~( I- t O1 D+ Q. j end
( F5 Y; ?% m9 l" Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|