|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 |; Z- ?# ]7 y+ D% k
$ D( M/ U1 R+ U( Q- t 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中的数值,不知道会不会有什么不妥。
& r0 N r( b) u2 y: T
% y6 E. A1 C0 g7 C _/ X) ?begin P_read arriving4 ~1 A( h" f1 U- U. j$ F9 m( g
while 1=1 do begin
; a; \5 m0 P9 ]7 F read A_tote from "data.txt" with delimiter "\n"
" l& Q1 U+ b3 p: ~ read A_time from "data.txt" with delimiter "\n"" ^. D1 V" n" G4 M. Y- b2 K. ^
read A_leave from "data.txt" with delimiter "\n"3 m, F6 M7 d1 g
read A_picks from "data.txt" with delimiter "\n"
4 Y3 z5 p9 R: q* g set load type to A_tote
9 r# S# m: G7 E7 d% J2 F" f. s4 a0 e if A_tote="tote 1" then set A_induct to 17 f2 i) V1 E( K2 a: R7 D, s" h) G$ b
else if A_tote="tote 2" then set A_induct to 2
. c' |$ {) x }5 N' K" l else set A_induct to 3
. B5 B$ {3 K+ _0 w- r set A_i to 0* n9 [7 b+ d' T; l. J; X
clone 1 load to P_induction, }& s) }. b6 H$ h
wait for A_time sec
3 f6 u- W% T3 a3 |# g, } end
\/ S8 M, E, C0 r8 i3 O! Tend o- V$ o/ X5 K" H8 |7 D
3 N0 B q- t. k8 jbegin P_induction arriving
* Y! }" O; K. ~* e0 K4 \ if A_induct=1 then clone 1 load to P_pick1
+ g8 z, }# Q9 p# i7 N else if A_induct=2 then clone 1 load to P_pick2# l9 q* W, J" a1 q2 R9 F
else clone 1 load to P_pick3
, A/ Y. w. c( _& k2 o2 z- eend
& D8 v1 Q) Q" {8 s( R* S n1 Q, L3 D1 H; x
begin P_pick1 arriving& q5 m% P1 V) K1 c. x
set A_i to 1* D! B6 J* k) E6 \- D2 s! q' x
move into Q_induct1! P7 s' V9 Q, b+ ?: `# d
move into pickaisle.induct1
$ X+ x S8 ~' S+ _( E while A_i<=30 do begin5 c9 @: m4 @ A4 q9 _) t8 ~
travel to pickaisle.con(A_i)
& w/ W' y" ~9 q F% u# w- P0 q8 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! G& p) {+ Z1 r/ b
else wait for 10 sec! e6 N+ J# Z: h- J* z
if A_i=A_leave then send to die
. U: t) k2 [# Y5 V6 G) z else inc A_i by 1
" u5 b9 r4 M* p2 H" @ end! Z( d, x- I( a, L! Y) F
end( b( n j+ R) D% U# G3 l
& t% y2 _7 S2 U4 @& ?
begin P_pick2 arriving
" Y; d8 e( M# m, E- ]9 d set A_i to 11
' ] q; j+ t( l5 L9 [ move into Q_induct2
- Y( n: z$ f$ |, p# |+ d3 S+ A move into pickaisle.induct2
2 z% u$ g' \8 m+ c, X( J, T- |; h8 o while A_i<=30 do begin! K; U$ j4 y- ^; q8 }& L. U
travel to pickaisle.con(A_i)5 @% m' _4 Y; V* A/ y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- n/ R# {# B( G& s# r
else wait for 10 sec
) @' j" G* G) }. r( F+ ~+ ~ if A_i=A_leave then send to die9 ^5 Y: h$ i4 x2 F/ g, V+ B7 p
else inc A_i by 1) ]5 I z6 a# E G4 L2 _) z' F- U: o S& K
end
/ Q7 `7 F J( p" `$ n% \end
3 u Y3 V* H+ B. q. H
; |, i7 N1 L9 t: h; E. |/ H: Rbegin P_pick3 arriving
% S2 u! h( C, S( P set A_i to 219 }) h. M) @$ m
move into Q_induct3
; S( c5 s+ z! d1 s& O3 k8 T+ v6 `& U move into pickaisle.induct32 l. y9 N3 f' {9 i. W8 b
while A_i<=30 do begin' m, ?; P! b+ B
travel to pickaisle.con(A_i)* S L9 V* q" D5 c8 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 e0 F8 ~9 J" t else wait for 10 sec
/ a% W% i: c; |2 [; _ if A_i=A_leave then send to die
/ V: U+ \7 m. q! d- G* y else inc A_i by 1
% ]9 e+ k9 _ e- Z8 _* n$ y end0 K+ }- |: d& 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,其它按你的 ...
|