|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% J# R* T" i, c4 {7 e9 C! \0 f" Y" \4 z0 F k7 c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. v$ S; }0 @. j+ v. ?4 ~( D
; ]8 M9 j9 y: D$ o0 B$ Dbegin P_read arriving: }9 J8 A8 {, C" w8 I' W
while 1=1 do begin8 Q4 ~) ~3 _0 J! V2 x
read A_tote from "data.txt" with delimiter "\n"# \0 m6 P6 f9 M5 ]8 p6 _! i
read A_time from "data.txt" with delimiter "\n"
! }. ]- I* M g& [+ h read A_leave from "data.txt" with delimiter "\n"
$ s, z0 Q0 l9 |5 Y# P7 {9 { read A_picks from "data.txt" with delimiter "\n"# [" e3 {, k% ]6 `. S% I$ `
set load type to A_tote
+ i" m- ]+ j* w& z. Z if A_tote="tote 1" then set A_induct to 1; }; U, C9 ?. m) r" T5 d
else if A_tote="tote 2" then set A_induct to 26 `8 g0 e6 z" H7 d7 F4 z( `/ g
else set A_induct to 3 # c+ _, O1 ?& x2 ]% \) {+ Y
set A_i to 0
9 |0 Z+ G% e! }3 M8 G2 {' J* h clone 1 load to P_induction
9 ]8 z5 N ?& j8 _% Z" d7 _& m0 S wait for A_time sec0 m e7 G1 y; q4 m/ j6 p2 |
end; ]; }+ ^! i, C9 n* B0 b$ p
end! P$ p$ b0 O$ S* {, s( M1 t( f
. Q$ B9 j9 V& i) Y7 ^8 Wbegin P_induction arriving& ]( E1 V8 y9 G' }. `
if A_induct=1 then clone 1 load to P_pick1: \1 \& `# s/ V; K9 z5 ]$ E
else if A_induct=2 then clone 1 load to P_pick2
\2 h# M+ m7 q else clone 1 load to P_pick39 P2 z9 J- y8 ~& C
end
$ A. _- e; d- \2 D7 h* V P# Q% i; z. B" c6 ]# ?+ E4 [! z4 \
begin P_pick1 arriving+ d0 w+ H. u& D- P/ k: a
set A_i to 10 S& P( G, y* l+ i
move into Q_induct1
, P# R- C8 p) {$ C5 {/ W" z- n move into pickaisle.induct14 S8 m9 q$ B8 A# ?+ D! S
while A_i<=30 do begin( ~; q I" K* w3 h2 p
travel to pickaisle.con(A_i); |9 t- k8 S0 R6 F6 [" L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 B; P; _( A0 s( b5 F' ^ else wait for 10 sec& X1 t# b9 V: {; s3 V' G
if A_i=A_leave then send to die
* M# Z6 [# W3 D w else inc A_i by 1) H* @& a% X) m9 @8 h+ {' |2 N
end
; U9 D$ p, [6 ^$ J4 [9 S+ n0 u% [+ mend
. f4 i! ]$ g# a& w, {' B2 L& B4 r) |- g- d' {$ ~9 h/ s3 U' ]7 R
begin P_pick2 arriving
7 Z& Q7 k" S: U1 j" U2 g% f set A_i to 11+ v7 a; R- ?6 _6 v- U4 v' h* P+ i
move into Q_induct2: Y6 |8 d/ W: E0 F' R
move into pickaisle.induct2
. t3 T$ N: ^) y while A_i<=30 do begin
# \( {, B4 C+ H1 J travel to pickaisle.con(A_i)! ?2 n9 I) F4 N' h4 J& N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }* n" \& B9 ?( n% Z
else wait for 10 sec' Z( A# v+ r& V' D- |; z
if A_i=A_leave then send to die4 v& U2 \6 p- [: z) H
else inc A_i by 13 U" i0 r/ X6 J2 h
end
* i0 ^+ N4 s4 {0 rend" W4 h- {2 j6 P! i/ w
. D6 x% ~) z& R0 B
begin P_pick3 arriving9 g: v. r8 ~- k
set A_i to 21
2 ]; _* g/ ?0 T. F, s; |, s$ l move into Q_induct3
* C& |" {3 q% M8 r move into pickaisle.induct30 Q/ @3 Q+ B n
while A_i<=30 do begin- {3 y5 |( b, S
travel to pickaisle.con(A_i)
* {: X0 K$ T. d4 ]/ k* G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 _0 x- ]/ b7 a# C; b' K
else wait for 10 sec7 h! v1 L b4 C7 U8 X0 c& C
if A_i=A_leave then send to die% R& R6 A2 E( w* P- e
else inc A_i by 1
5 U5 x3 B$ O6 P3 R+ p* h end! F* K+ X' t: @: w1 W3 w1 Q M* V
end |
最佳答案
查看完整内容
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,其它按你的 ...
|