|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ C% r) }: s/ t9 T
$ a7 G, r* l( |0 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) w; w$ t, z: A' K
6 f( ]# l5 a0 R2 L7 n; j
begin P_read arriving* h3 J( J. P! t( {; C. D
while 1=1 do begin
! t6 l" {! z' j+ Z# H read A_tote from "data.txt" with delimiter "\n"
1 t+ m* O; c4 P" y2 _ read A_time from "data.txt" with delimiter "\n"
: {( R3 ^ k6 B+ n1 B- k8 ] read A_leave from "data.txt" with delimiter "\n"3 f4 q( y9 A2 X
read A_picks from "data.txt" with delimiter "\n"/ f% X, U" h1 U7 e7 G
set load type to A_tote2 X, g) E9 ?) j: G
if A_tote="tote 1" then set A_induct to 1
/ u- D- C% }) u8 N5 x( M! Z else if A_tote="tote 2" then set A_induct to 2 p9 H _3 ~* W. i) x) L) z
else set A_induct to 3
4 l* b! {- M- C% u set A_i to 0( F, O7 {3 f! N& e& i
clone 1 load to P_induction
; `6 q; T; V" \9 z9 j" D3 A1 e wait for A_time sec
; s* G0 Q& O& p2 W end
( P8 w8 {& m7 L2 \2 ]' eend
4 q& ^$ N3 R" x+ P9 _, n, e( Z1 V' \- y' ?0 d, b5 T; U$ A: y) Y* k c
begin P_induction arriving
& ~8 r8 F. R/ q# o9 Y" { if A_induct=1 then clone 1 load to P_pick1
, J! N- D6 ^9 M: K else if A_induct=2 then clone 1 load to P_pick2
* O( \$ t3 O D3 P1 s else clone 1 load to P_pick37 i& x$ f( I- Y( T3 m
end& u9 d: x3 l' `" T; Q4 q
2 s6 S' r- s( a5 S' r- y" R( h
begin P_pick1 arriving
+ \& Y5 \, s7 t0 |& X set A_i to 18 G& z, X, _$ J
move into Q_induct1
( P6 } G) h" O: K9 l move into pickaisle.induct1; V% Q$ d, \" L' Y% e
while A_i<=30 do begin; C F7 n$ a l/ w
travel to pickaisle.con(A_i)
. V7 j% }/ {2 g! ~, p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f3 Y( p& W; `# C/ ~- F4 A. | else wait for 10 sec% t, ~" U1 z# E) Q
if A_i=A_leave then send to die
4 ^+ j) H* Z% I9 @% G7 Z3 W else inc A_i by 1
3 z \) Z) p. n% `& S, `0 S end. l% `7 A. L/ v- ~: J
end
( L0 Q4 F# n6 W+ y. x+ U0 ~. U/ Z0 I& X9 V
begin P_pick2 arriving
. Q, F# g d& h( g$ e set A_i to 11$ K& ~- x. [5 K3 D* Z4 n |- h# J
move into Q_induct2
% f: m6 e$ C$ _ move into pickaisle.induct2
- u5 a+ L1 w, y, e/ {9 d while A_i<=30 do begin
: x {2 G$ y4 O1 ?% \% K travel to pickaisle.con(A_i)
8 f2 N6 K0 S- h8 ^! ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, }: k& S1 C$ O$ H
else wait for 10 sec
- l4 A' G: C& W5 J' M if A_i=A_leave then send to die
! P1 P/ c+ {' B7 i else inc A_i by 1
9 D( t; O- v* k9 v7 T8 ^7 i end
2 @" r* {7 v9 gend, z6 |, T% e1 [# k: w9 c2 P
% P& `$ e( {& O8 L. h$ }
begin P_pick3 arriving: V" T$ L% u' {
set A_i to 21
! P' h' w; ^6 r0 a( n3 K move into Q_induct3 W G. _+ F! D# ?# A! t( C
move into pickaisle.induct3
" m& Z, P" e. }5 Q+ l5 Q- t while A_i<=30 do begin- C0 o- m( V" q9 v$ o& m5 l
travel to pickaisle.con(A_i)" d- n/ P. }3 x1 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: Q' M; i+ j9 A2 k1 ? else wait for 10 sec
6 A: s. |. ?( @0 S, V/ U2 z if A_i=A_leave then send to die
. k% R( m% w3 D* } else inc A_i by 1; R. H2 m3 q! R: w. a% g
end& a3 n' l6 J v5 L
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,其它按你的 ...
|