|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 i- `4 `+ m1 M0 r8 J0 q( ~
' T) D; s v. W& C0 ^) ~* 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中的数值,不知道会不会有什么不妥。- R& k8 @) A% E$ k2 c: Y
& r- H* t2 X0 i! D8 I! l
begin P_read arriving
z1 e) x: f) Z& G; t while 1=1 do begin) U8 D) ~; p' A R- }+ B
read A_tote from "data.txt" with delimiter "\n"
5 K: a1 @. ?" `' [' x, W6 R read A_time from "data.txt" with delimiter "\n"5 K9 Q. l! M$ D8 q; i9 e1 Y
read A_leave from "data.txt" with delimiter "\n"
$ w# F; U; @* r, u! ^" d+ L read A_picks from "data.txt" with delimiter "\n"! ~0 D$ _+ n$ o }. _2 O9 r# H
set load type to A_tote
5 E2 | |' h- G5 c( V5 T if A_tote="tote 1" then set A_induct to 1
7 @) C; r0 s, l5 c, N1 _; r1 l- L else if A_tote="tote 2" then set A_induct to 28 H( |) s/ v9 z+ t1 Z# U4 ?
else set A_induct to 3
+ `+ v& ]! N( M8 g% j set A_i to 0
- X0 Q3 r; x2 M' L6 S6 B8 o5 [2 Z clone 1 load to P_induction) J' ?1 L. ^; J/ p5 K) e) }$ `
wait for A_time sec3 D( l5 Q: q" e# I3 l
end
. H& D" U/ B$ i i8 }end
1 Z, d* H+ l) E0 r
y! \0 ^. ?8 Fbegin P_induction arriving
, J3 Q* T' z ~4 u" e' k if A_induct=1 then clone 1 load to P_pick1
. I4 V% ?8 a1 X# P5 Y8 w% { else if A_induct=2 then clone 1 load to P_pick22 ^ i( a- N" \( A: y+ E8 k
else clone 1 load to P_pick3( p% M' F- |% X& ?/ t
end- M9 V2 s) B7 J9 C V; U+ s
! V, ^* ^2 c+ n0 h7 Ubegin P_pick1 arriving- k2 k# e0 i9 h6 R! ^- K" k% f
set A_i to 14 C: p5 m) }3 X8 Y1 n: W
move into Q_induct1
" q& p% z9 p9 q3 q move into pickaisle.induct1
8 ^' O- Z3 [, v+ q+ {% } while A_i<=30 do begin
0 F: F2 b' ]2 O' U3 |5 i travel to pickaisle.con(A_i)7 _4 V! `* U% Q8 r- P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ k* z/ N- h' f1 e: c; u
else wait for 10 sec
" o) q9 D8 V4 w" i! ` if A_i=A_leave then send to die- Q- P. s- R; |" B; T) K
else inc A_i by 13 r0 W1 Q; @9 Q- a' t0 v* I3 k
end2 s5 u7 s2 Z# N& p) n
end+ g4 p- Y+ |. |3 r& U5 f
4 m* _# ?) x x2 W, O5 I6 Ebegin P_pick2 arriving" D3 H4 A8 s3 n# H- U$ \( O3 K3 u7 x
set A_i to 11, B9 T9 p) D4 h$ h/ W$ z6 d; K
move into Q_induct2
2 G' O0 x% s/ D. x! d' m move into pickaisle.induct2/ n2 u8 p2 Y/ m9 T: o& ]+ t
while A_i<=30 do begin
1 i1 W1 S/ q& O( a: x8 @8 N travel to pickaisle.con(A_i)
, N% ^: o. [! O" r V" N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 T4 p0 U" i4 `2 K2 I) f else wait for 10 sec \! F. ^2 @+ J
if A_i=A_leave then send to die
; o/ }3 ?; y! b else inc A_i by 1/ D I) K T3 t( j, L
end
0 ~: C, c' _. R1 V& D3 ^6 k+ L) U- uend) W4 M" [+ O* f. ^2 v
9 i0 m! {" f6 S4 Q+ O
begin P_pick3 arriving7 W$ f# A, p7 @9 O/ B6 V% V1 l
set A_i to 21
. ^/ R6 d0 {1 Z# c0 M) v move into Q_induct35 o( k8 s' | y
move into pickaisle.induct39 A" p% F& `3 j1 F
while A_i<=30 do begin
' B; z, M; k7 }; L( B6 } travel to pickaisle.con(A_i)$ H/ @) [# r A8 j; X' P: K+ S6 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 K# w [9 U. ]& i7 u8 M* f* i0 f
else wait for 10 sec5 ?( _* |; Z l0 t8 ~; t9 ~
if A_i=A_leave then send to die
9 L& H- ~% V7 ~4 E1 i% D else inc A_i by 1
+ I$ _8 g. `( n! H! W$ K( Y( l end2 k, c9 F. j5 R, b8 w( W
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,其它按你的 ...
|