|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Z: R6 w2 q7 r. K6 ^
( w/ i6 v( p9 g6 n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 G. l5 s" b9 y# s4 n
1 c. G3 X5 R4 y7 Q+ qbegin P_read arriving, P" g8 G b) z% K6 m( P
while 1=1 do begin+ H4 R. |7 g8 o' S9 C2 K
read A_tote from "data.txt" with delimiter "\n"
" h/ i! W, R# g2 }" d read A_time from "data.txt" with delimiter "\n"" j" P u2 r1 O7 ^7 m
read A_leave from "data.txt" with delimiter "\n"2 R! ^$ `2 J# I# D' g
read A_picks from "data.txt" with delimiter "\n"
' a8 o2 K# ~9 Q2 U- J set load type to A_tote
, ^; F. ?8 R/ H7 P if A_tote="tote 1" then set A_induct to 1
0 `9 _3 O* \8 q. c8 c1 e* m1 R else if A_tote="tote 2" then set A_induct to 2" {* b9 h. R7 B) x
else set A_induct to 3
2 c0 G0 U4 ~7 d0 I- q6 G0 b set A_i to 0
e# x2 A3 s% ]; s& Z* R6 S clone 1 load to P_induction; [( ]5 {* h( ~% v1 s0 u
wait for A_time sec5 [3 u- U" {0 |# J0 S) w
end3 u- x2 u3 C6 x: A% i8 t9 y: y, p6 i
end& M! O' z6 S, U1 F& m( O) ^
6 X# {6 X1 [! h; rbegin P_induction arriving9 d2 O& M0 g3 ]2 P( C9 |
if A_induct=1 then clone 1 load to P_pick1
. ^1 ]* m/ q- D, r5 U# F) U ~) A else if A_induct=2 then clone 1 load to P_pick2
3 R$ r3 J5 P5 Q: X else clone 1 load to P_pick3/ D5 I; U+ x& ?' }6 t& G
end3 F6 \, {4 | p0 E0 Y
$ Y6 i7 o1 f' _- H B, kbegin P_pick1 arriving
& W( E7 M8 [. Y set A_i to 1+ o4 C) R* f c5 B' \, O! t. F; ]0 {
move into Q_induct17 u) s8 ]" ]6 h/ s
move into pickaisle.induct1# t6 w4 f% P1 ?) t
while A_i<=30 do begin
0 }- d% d: _ a1 t; N! C travel to pickaisle.con(A_i)9 ?* x2 T* D1 M+ Z, n. B8 w3 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
`0 a- x P( v2 T4 U else wait for 10 sec! v* R. c' ]) D; A/ G" r7 h- I
if A_i=A_leave then send to die6 [' d( }6 E- u: z( B) V
else inc A_i by 1: e& C# P# A3 |2 b r; q( q: |
end
" l% e/ Q; k, _end: M1 {& h$ R7 Q( y8 W1 B f
9 ?( E2 C! S' Y* j+ d( {* a Vbegin P_pick2 arriving2 Y" K" S6 l) r4 h' o0 @+ ^
set A_i to 11; E1 x; H1 Q( \5 v! W
move into Q_induct2# C* H* n7 d! G
move into pickaisle.induct2
2 [% \& ?% p5 i9 B9 i) s* h while A_i<=30 do begin! v k, e e" ^) p; P! ~" f
travel to pickaisle.con(A_i)
6 p, E& F5 b6 u$ f, I! _: }/ S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X( X1 i8 R7 W! X" q; U
else wait for 10 sec
0 Y1 f3 W; G! u if A_i=A_leave then send to die
2 o1 u0 m! |( n* ?* S$ S( V else inc A_i by 1! ]( ?- j/ k+ ~6 e9 A' Y
end: q- B7 T; f5 p R! w+ a( ~( _
end, ^& f1 u& B5 M+ h, s) B
7 B' M5 p& m( I& ~- L
begin P_pick3 arriving P* x, S' P c) ?5 g D
set A_i to 21. q/ s9 t9 T$ J# S! y' [
move into Q_induct3 R3 S. p3 J8 D- K3 K- n1 n
move into pickaisle.induct3
" k3 A8 U, j, K5 ~+ b while A_i<=30 do begin: P' ]. [$ P3 F9 n+ Q* t. s
travel to pickaisle.con(A_i)
4 `6 a6 M; ^: `+ V! @5 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, L1 Y* m5 \ |' K. n; |" p else wait for 10 sec
! ~9 r, c% S0 G4 g+ j4 h$ _ if A_i=A_leave then send to die- @! p T* P" ~$ B; r$ A+ A
else inc A_i by 1, H& [8 D. m) \! q: _7 M, B
end& k+ k# Z( a _" k$ C9 \
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,其它按你的 ...
|