|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& N2 B$ T4 S1 a1 f
4 `& c$ Q/ I1 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- x2 `* t1 \' p! b; ]( c" }2 n; H2 B1 N$ ^% d" F7 p$ _3 D
begin P_read arriving( `2 o+ H; H; @! Y* I; v" {# \
while 1=1 do begin& j# c( N/ d& O$ A4 M3 d
read A_tote from "data.txt" with delimiter "\n"4 P8 y6 M$ I/ z1 Z( R
read A_time from "data.txt" with delimiter "\n"
$ b4 s* d. V& I read A_leave from "data.txt" with delimiter "\n"5 T* n9 {$ B8 @+ K/ g6 J5 M
read A_picks from "data.txt" with delimiter "\n"9 a' g: P& o+ @4 R, W( ~$ T
set load type to A_tote
7 ]% p. o+ d" p( P0 _8 ?, M# e if A_tote="tote 1" then set A_induct to 1
9 g+ k: }2 j/ h% A7 d2 |& H7 r else if A_tote="tote 2" then set A_induct to 2
+ t, ^1 ]$ c2 B! V4 F8 X5 x1 L" V/ Q else set A_induct to 3 ; E5 D( U5 z2 F$ D6 F
set A_i to 0
( M" W1 ?4 L" b, q- e% f( f5 O0 s clone 1 load to P_induction
1 z0 p" M; W% M+ ?6 i wait for A_time sec
" _2 ?0 O2 J0 ~6 A- ~ end
* q5 [0 f, i5 T) t Lend: _& V' a) M; u( X* m
/ g* p* H1 @+ @1 \begin P_induction arriving
/ }8 a7 }% a; \& X# h3 l7 u' r- S2 z if A_induct=1 then clone 1 load to P_pick1/ x$ N9 h8 `1 G$ V9 U
else if A_induct=2 then clone 1 load to P_pick2
9 L8 I! @: j) ?# u8 h9 l else clone 1 load to P_pick3; l; E( k; c) N' `
end
' c& W1 s3 k1 p' E& }
0 P& b; ]5 m% u, O8 C5 X6 gbegin P_pick1 arriving
/ p' ]/ a6 K/ |, }/ ^ set A_i to 17 q2 N0 g5 h- J% t: x* R
move into Q_induct1
4 P- U) J" H# ]# E; L v! [ move into pickaisle.induct1
- p! z9 A1 R" V7 i: G while A_i<=30 do begin( a5 t$ W, j( W/ _, O
travel to pickaisle.con(A_i)3 i9 b1 ?/ T3 n4 M0 }% I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 F/ W* G9 U; }: j' C
else wait for 10 sec5 a) d6 T9 T% d; `( g
if A_i=A_leave then send to die
$ v$ y2 {' x7 R0 G# z4 @ else inc A_i by 1
# [; z* y* Y, k" x end
! I5 [) Q0 b H8 i. @0 iend0 r* l& c% k; b3 a2 |7 `6 N6 n' k
, l% m! p( ]5 h5 f" I- |; c. Ubegin P_pick2 arriving
" B1 b5 |; c$ t5 Z' |8 C set A_i to 11% N8 o c+ }/ u7 }0 h" w: B
move into Q_induct2
8 y8 E& L9 X# D5 s9 x4 F move into pickaisle.induct29 n% O2 ~1 j4 S7 y+ Q
while A_i<=30 do begin
! T V$ P. B( X travel to pickaisle.con(A_i)( U& \; D; Q3 f; I' c) f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j2 d3 ?7 c4 P# X+ z3 i/ S
else wait for 10 sec8 Y$ ~) H5 w; l& ]& x8 U8 Q/ Y# m5 X
if A_i=A_leave then send to die
$ U$ L8 J2 V& [( i. W) g9 A else inc A_i by 1
9 t$ R) ], h2 ?2 h' k end
& }, E. @( k9 ?7 B- Vend
+ h# C# h3 x) H. z: [' s B' {) L( \, n# S
begin P_pick3 arriving
2 u4 f/ e+ M: [ set A_i to 21
; ~/ p/ C5 i; s+ ^: ? move into Q_induct3- U6 k5 H3 w. O E; k3 @
move into pickaisle.induct3
, |$ U$ I0 m1 s3 f* C while A_i<=30 do begin
) B& P. n) q; M travel to pickaisle.con(A_i)
; X: r% J; m5 f3 e6 k& S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 m$ `0 @. n0 B# n4 _3 O7 w. ^- S
else wait for 10 sec
# w. r$ v& y# L7 ]( Q" J if A_i=A_leave then send to die, q" [! t; ^% F, m1 c7 n
else inc A_i by 11 N) ^, [6 R/ k- ^
end
6 m4 I* t. C) Y) g" e S% c, E+ N# ^. ]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,其它按你的 ...
|