|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 _2 p# @) W& Y* w
1 e F8 |" D/ \- T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ Y" H2 l- H1 l: a( {7 w: s/ Q
$ X2 X7 H: f; e. k* P& Ybegin P_read arriving
( D( c% E: V x while 1=1 do begin6 l1 x5 v% p' p; x& N
read A_tote from "data.txt" with delimiter "\n"" t3 f% v1 i: G! Q9 J6 f' l
read A_time from "data.txt" with delimiter "\n"
; e2 E+ F1 D0 h ] read A_leave from "data.txt" with delimiter "\n"
( S7 R$ s1 s! y/ D read A_picks from "data.txt" with delimiter "\n"
0 a7 J) v" M, J0 r, n set load type to A_tote, Y. e8 A* g2 V; p: b
if A_tote="tote 1" then set A_induct to 15 H' a4 X6 `. {- ]- T$ u
else if A_tote="tote 2" then set A_induct to 28 e* P( [0 V. r: W3 A
else set A_induct to 3 5 v; @) q' |& E2 |
set A_i to 0
9 C- G; U* b$ ?8 A# z clone 1 load to P_induction. S! ]2 x T5 @* W% j( y/ x
wait for A_time sec
: X: ?; O1 L* A5 u0 @ v end
# D, o* A( S" o5 ?end
7 Y5 ]& g$ b- V; I+ y$ |8 o* t" b F$ _( W; n* \: \
begin P_induction arriving
6 N2 H3 ^$ I- n: u$ h if A_induct=1 then clone 1 load to P_pick1
: |) ~: g( t0 U3 _ else if A_induct=2 then clone 1 load to P_pick27 ^% U. W9 w" R' r" ^
else clone 1 load to P_pick37 D& P+ m/ x: S* T$ S
end9 P1 H) g% L$ D# e5 w$ r. k
# S2 n- F( G5 p( {. o0 v
begin P_pick1 arriving& M5 ]* [! R' `: `9 M; ]" v
set A_i to 1$ f5 x, o# T7 l/ C: h" K
move into Q_induct1
1 ~1 Z6 F5 J8 L- n: B) l$ e7 W move into pickaisle.induct17 M/ f+ J. x8 ~" S* s0 K/ p% s1 c C4 J
while A_i<=30 do begin; P7 Y \/ b' {( Q- o! H6 S
travel to pickaisle.con(A_i)
& b) _0 u6 I* z2 ~4 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- W& r% Y8 s3 D; C
else wait for 10 sec( {' \) _; m' r( h
if A_i=A_leave then send to die& v! q, X# U* P- [$ V
else inc A_i by 1
; P3 [3 l5 J( U/ k; w, C end1 T+ d/ V5 c' T( |5 {
end
8 x, t9 `# t# W7 I, O1 i( l7 J/ p @2 K
begin P_pick2 arriving
6 X9 ~9 ~( `5 m. ?: m* |9 i, z8 [5 { set A_i to 11 m+ q: o4 P, V) p. y0 Z7 }0 _
move into Q_induct2
3 z0 [5 `' G0 \6 G" D move into pickaisle.induct2( @4 n8 _* x& R1 J2 y
while A_i<=30 do begin
$ X0 E A' t; S5 x8 o' L travel to pickaisle.con(A_i)1 P' T7 {; n S9 F# N- J" L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 g4 T0 p5 m( Y% i3 _$ t$ Y/ Y else wait for 10 sec
; D- E: J% Y' U8 e7 p2 C if A_i=A_leave then send to die* W4 S1 x, z# b4 {2 p
else inc A_i by 1
* S- k& E& O: N3 H* a- u end: ^4 b9 z' |7 w; h: y1 ^ K
end
4 W9 J$ C% {2 M$ R; f, D8 {% q% G9 {9 T! Z2 k' `$ h
begin P_pick3 arriving$ t9 q2 y# \# @6 z
set A_i to 21
+ \& h9 S m; Z" h' B6 w$ q move into Q_induct3, D7 C% Q6 u6 t; g9 ]- [7 O# G5 ~
move into pickaisle.induct3
9 `% Q" r$ \( ^; Z& }& Z; c while A_i<=30 do begin7 ?, J! [! T' u4 E3 |, T
travel to pickaisle.con(A_i)
9 v- y( H c3 X: r: I1 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ?! }: O; o$ T# ]7 I
else wait for 10 sec+ a5 m `3 x6 b, U( }- c
if A_i=A_leave then send to die1 `( X8 {, m7 k; s1 A
else inc A_i by 1
' f& @# t! ~, D8 ` end
" X( X7 [, G* ]3 ~8 r) nend |
最佳答案
查看完整内容
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,其它按你的 ...
|