|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- W! r( \: d3 H3 i9 r8 v" r5 A- r5 q, |; Q( t! A% }/ B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, W1 s* P& ^$ H* U4 `: }& D. U# f6 i
begin P_read arriving P) n5 p0 v+ r9 i# U) e
while 1=1 do begin( F. V: n: }% f$ R: J
read A_tote from "data.txt" with delimiter "\n"- @* n2 H( ], j" Y
read A_time from "data.txt" with delimiter "\n"
# Q2 [( W8 L4 q7 S* i read A_leave from "data.txt" with delimiter "\n"( g# j, R+ j4 z" s: f
read A_picks from "data.txt" with delimiter "\n"
+ ~: x9 {( e8 n: x8 W& X set load type to A_tote: S8 I5 p; U$ m/ _! W! I6 P
if A_tote="tote 1" then set A_induct to 1' ?: J; w$ ]' W# o& d1 ~6 e0 n5 B# y
else if A_tote="tote 2" then set A_induct to 2
G( u9 }0 C" Q- V, V( P else set A_induct to 3 & n) _& s: ]) P8 l2 f' @; V+ x, E
set A_i to 04 q6 b: D. e( O& v- m6 P. t
clone 1 load to P_induction" l5 M& @; D) |
wait for A_time sec9 O9 @# m/ M3 Y0 K" c/ l
end1 ^1 o9 I, W, S2 d
end' ^- a- d/ e8 }2 l6 k
2 H n U. h5 M8 K8 k- @
begin P_induction arriving
+ m* ?$ F/ Y" E4 g5 G. e' @ if A_induct=1 then clone 1 load to P_pick1
3 N7 u" w8 h) b: S# M9 Y0 { else if A_induct=2 then clone 1 load to P_pick2' I3 T- {/ C. s- X+ b. D% t
else clone 1 load to P_pick37 \8 J& T- |8 \$ u
end+ p9 s) V# T) i& H' t3 f+ o
|0 R, Z) c0 f2 H7 W, Xbegin P_pick1 arriving: O- d/ y2 Q+ K' w
set A_i to 1
% ?! P( a3 m/ `- N2 T+ Q move into Q_induct13 I6 H6 m5 \: n, q& A
move into pickaisle.induct16 u5 r+ r( ^3 q4 ^7 D
while A_i<=30 do begin
6 E4 U2 S, H' T travel to pickaisle.con(A_i)
" G& q+ r1 E$ z' U& N/ d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; n* u& {& \% W3 f
else wait for 10 sec
$ r% `2 k K: f6 [ if A_i=A_leave then send to die
, ]9 H4 X3 ?% h( U else inc A_i by 17 _ t) k- p, W2 f* H* J+ C
end
0 a# k' B$ ]" d) D+ t! ~end
O4 Z3 b+ F5 ? q$ r+ P& E
5 E6 y4 F$ f8 q, }! P; V9 C" Tbegin P_pick2 arriving
. H- v; L5 {8 D# m: m1 z set A_i to 11
+ V% Z( V/ Q j2 Q$ L6 c* s. A move into Q_induct2: o/ X2 e8 b. i) Y9 y! z" D" Q
move into pickaisle.induct2
& c4 j0 z/ V: V. F V while A_i<=30 do begin2 m; a8 P5 F: f+ S
travel to pickaisle.con(A_i)5 C' |. }4 U( R2 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 O2 Z' Q- ~0 m& I' W
else wait for 10 sec9 v6 W; u1 f ?- L# i' Z
if A_i=A_leave then send to die+ w9 Y$ K3 P4 |3 k; p+ i0 O
else inc A_i by 1
; G; G+ n P2 _/ L1 k+ G" K end
% K$ d: F$ v2 H& D" S Mend7 K" p- R$ W) {5 w0 Z0 s
1 t9 K9 p+ y+ z* j) Gbegin P_pick3 arriving
' [, k5 ?5 \4 A! `% T set A_i to 21
9 Y) f1 `/ y2 X k" B. ^) p: e/ S move into Q_induct3
m/ M! x- N" I: H3 R move into pickaisle.induct38 @: J8 s' r/ ]
while A_i<=30 do begin
* O* B; s/ ~- Y, W* w travel to pickaisle.con(A_i)" ]3 d* i% Z1 X# }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. [. b$ j' M! e0 R% C7 b+ w& ] else wait for 10 sec
0 ?0 z) B1 ~7 ?( x if A_i=A_leave then send to die
' j" O; Z7 j- _+ g7 v( E" q else inc A_i by 1
" D) x! |; I' U end
; B1 f' x) D6 `. T2 xend |
最佳答案
查看完整内容
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,其它按你的 ...
|