|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ C( L. ]2 G) q; k$ q8 K% r9 @4 B" Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 i3 `$ C, A: v. C7 i9 o* i5 ^
6 {- Y: \( R. v! i4 D* `begin P_read arriving
( A/ X2 ?4 ?8 f+ P" K while 1=1 do begin7 P8 y% h5 S) T
read A_tote from "data.txt" with delimiter "\n"' N" ~) |* ~7 u2 N( v2 x
read A_time from "data.txt" with delimiter "\n"" P3 a8 @5 c. s: p( H
read A_leave from "data.txt" with delimiter "\n"
6 y* q% a+ X( n) J, ]+ C read A_picks from "data.txt" with delimiter "\n"3 ^+ A1 R v' o. A: d0 {
set load type to A_tote. x1 l: O% i- h x. Q
if A_tote="tote 1" then set A_induct to 19 G$ n" X* ~ i9 a
else if A_tote="tote 2" then set A_induct to 2
/ H. b, I8 L" m3 j else set A_induct to 3 7 h5 x( j4 B$ C) @9 e+ j/ v
set A_i to 0
& d4 L0 n" }7 V; n. U/ V p5 ` clone 1 load to P_induction
* s j% Q% h$ l3 a) | wait for A_time sec7 }( }: @- n) U8 l+ ^: U
end. C7 P e7 s+ V+ V8 N5 a0 S2 L
end
! E- C" G& {$ @, T4 W. ?
0 k! w! j/ U" B/ Mbegin P_induction arriving' f4 a: B) e( q5 ~2 H
if A_induct=1 then clone 1 load to P_pick1
. Z( c' C: C) w& M( i8 s2 p else if A_induct=2 then clone 1 load to P_pick2
; _3 t4 {6 V$ R- K! H% Y, o else clone 1 load to P_pick3
! ]7 n6 \+ @ Q2 g }9 b5 N4 y8 M+ }end( J6 T, ^* _, @8 [% E& A% k5 k
- @3 d4 }; [: B. a' @6 k, H
begin P_pick1 arriving- \7 r# b$ J* m% I/ p- c: _
set A_i to 1: O9 k) c+ T% Q% [6 U% m3 A8 L v
move into Q_induct1
; X7 J; ~: y3 f1 ~ move into pickaisle.induct1
/ Y, m6 L4 B. I; Z. V2 n0 i: y while A_i<=30 do begin
7 |4 d' o, N- h# R& {. l5 T travel to pickaisle.con(A_i)
$ c" e# ~9 p/ Y: y/ L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R8 m( B; z0 J else wait for 10 sec
B O: Z; z. [. q; w if A_i=A_leave then send to die* U. g4 c! h5 y, P, q: M; w/ `
else inc A_i by 1
/ B: H: d' q9 W8 _+ M% I8 m end
) O% G2 g# K! e, O2 Z" yend2 O' O+ S, W# _9 r; B; c: u
L% I: ~7 ?9 O& h8 J8 vbegin P_pick2 arriving
) u: x- z9 W3 R+ s" X. R set A_i to 11
- y# r1 Z% b |6 k move into Q_induct2
/ V4 ?' j6 k2 n( d2 F- U% ? move into pickaisle.induct2
2 u' {% o+ D+ u. K while A_i<=30 do begin+ g* O0 x8 Q/ ?" ?& Z- [2 ~
travel to pickaisle.con(A_i)5 } I/ ]0 O3 ^" P! F5 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
C. @- }$ V3 k0 }. y: B S else wait for 10 sec
' T {9 \* H! [3 E4 F A: U if A_i=A_leave then send to die
0 L v% P; S K0 M( n4 U0 e } else inc A_i by 1$ U' m5 k! u' c( B6 a. r- P
end0 X) G& a1 v3 f2 w( J
end
" s0 v- \2 G% s. C; d) ?. ?( S& L- [$ Q3 t
begin P_pick3 arriving
5 O* Q4 w& f/ _5 l set A_i to 21/ N" P) W% V; I9 t5 i/ V- E
move into Q_induct3
0 d5 N1 {& {/ |; y: P move into pickaisle.induct3" K4 t5 ?0 G7 v8 i1 W L
while A_i<=30 do begin
0 g) N3 L u ]& r travel to pickaisle.con(A_i)
U! v( F# g5 t7 `5 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q0 L* Q4 E. `3 J( C% x5 @ else wait for 10 sec9 l+ g: U/ n) c, S. o, s2 u
if A_i=A_leave then send to die
! H; ~2 q" b# C' a0 R else inc A_i by 1
8 }+ q2 q {( s end
! g* _5 n& |5 k0 E2 A! {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,其它按你的 ...
|