|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* f9 N# X. \" c/ y: k7 ^8 w4 \& b- P1 T! u* ^: C9 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中的数值,不知道会不会有什么不妥。
4 y$ C8 `* \% M. m
/ X6 f" i D& N K1 o @begin P_read arriving
2 i( t6 L5 j5 Y% y8 _' C; O+ Y, j3 C while 1=1 do begin8 J4 y& e0 p: k% A+ j+ k
read A_tote from "data.txt" with delimiter "\n"7 w+ S3 L# B3 d! I. x; i& X( V# V
read A_time from "data.txt" with delimiter "\n"
+ t$ j" _# h; F( p4 t read A_leave from "data.txt" with delimiter "\n"8 N) B2 D7 E) x' ~
read A_picks from "data.txt" with delimiter "\n"
: @( B; e" W; k/ `4 y- n set load type to A_tote/ i$ b- e3 R5 D& i' A7 M
if A_tote="tote 1" then set A_induct to 1
6 d7 {6 p7 @9 e" | else if A_tote="tote 2" then set A_induct to 2
0 k/ S: G9 I! j0 x else set A_induct to 3 1 ]8 T& p3 P: P0 z' `9 T
set A_i to 08 _% u' Q' b* M, p
clone 1 load to P_induction& t) n! o* s s. Y M
wait for A_time sec$ @' P- r" {+ \" o- R0 i! q& k
end/ e* W1 v/ `0 E" v" w
end( t, S% u$ Z6 l3 Y) g7 Q
& K* ~( B# o, h3 T- z' b
begin P_induction arriving
6 @+ Q+ S% b" G; |. |1 _ if A_induct=1 then clone 1 load to P_pick1
1 c [, y) A+ X5 u' J9 w2 u else if A_induct=2 then clone 1 load to P_pick2( y! L& ^/ }) Z2 F) \ m& h4 W% L7 X
else clone 1 load to P_pick3
( Q e& i) x/ [& h' cend, G6 g2 A+ y: m: j* b
, j7 O2 Z' N" a. m# P* }& }' P
begin P_pick1 arriving, O9 q c8 z+ [9 i
set A_i to 1: E$ s, o8 K9 h& Y% j3 s/ X8 l
move into Q_induct1
) M1 z) h) \3 c- v) E6 S move into pickaisle.induct1, e1 v, `% R7 P# O9 k3 P# i
while A_i<=30 do begin3 T- V; Y. m: {9 H9 W3 W
travel to pickaisle.con(A_i)7 k* @4 ]5 K- F0 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ p# Z+ z$ w; V
else wait for 10 sec
" {) c+ \' T/ u* y0 t if A_i=A_leave then send to die
6 a0 F! y( i7 M7 m! [ else inc A_i by 1" ~# d, J2 k) ~$ G( ~, f
end
, T. B" m2 S1 ~end
! K6 H' d% a, i
- c( j0 i& s6 Q* j! j* Q* Xbegin P_pick2 arriving
$ b2 U* R* a4 d1 j* x set A_i to 11
; C0 E% c O% { move into Q_induct2
* Y+ l. G/ `/ N+ z9 n, i move into pickaisle.induct2( y5 h) c# g; l. Q1 `
while A_i<=30 do begin% {4 \# Y- M/ F1 T! u
travel to pickaisle.con(A_i)
+ T+ O7 R8 }/ [# I5 i0 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* u& E5 | \6 o8 ^/ c" r
else wait for 10 sec; ?9 {5 i& n( m5 g/ J: l3 H. Q
if A_i=A_leave then send to die8 l; q, B4 ~% N
else inc A_i by 10 J" \5 x% K* z
end
& {" b( d+ r5 H( g9 F0 Iend: z5 V6 v4 e# W- O$ z" i) Y' u
0 N+ S' ^( Y5 h# g% }7 X4 gbegin P_pick3 arriving
8 _$ X/ Z: k n4 G4 }( x6 | set A_i to 21. Y& I: t) h \) G3 c' C
move into Q_induct3
1 \4 n: j: d1 j: N. N move into pickaisle.induct3
! e/ F/ }' s* S- b" h4 t2 f7 F ] while A_i<=30 do begin5 M+ \$ m3 L5 q6 } }1 k
travel to pickaisle.con(A_i)6 |2 E2 Y: J' K; I ^1 n$ y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec P) L1 l- L& | v2 g8 a1 ^/ J
else wait for 10 sec
( n+ X/ ~ t; H+ n if A_i=A_leave then send to die& s, K, Y5 p+ p& k
else inc A_i by 11 _/ e B0 X8 @* z5 s
end
3 S1 C3 H* Q: x- K1 o3 Rend |
最佳答案
查看完整内容
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,其它按你的 ...
|