|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ ?" x! y! ?9 F( P: ~+ a
" X0 a) O }3 O) Q* I/ |我的问题是,在每个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+ F$ Z0 w3 i
! |/ e6 @7 }/ X$ D& _begin P_read arriving
3 {/ y; B. ~ O$ U9 h* J while 1=1 do begin+ Q6 b8 W% V6 m8 c, M
read A_tote from "data.txt" with delimiter "\n"
/ p; J! K6 }# l$ Z4 a read A_time from "data.txt" with delimiter "\n"
: X B( h' p( l9 P+ U2 h; g4 A read A_leave from "data.txt" with delimiter "\n"
( r4 D2 U' h" E4 L: y8 Y read A_picks from "data.txt" with delimiter "\n"
% U' N$ u+ h! y: c set load type to A_tote
. W- m2 C- v1 W" g2 g/ n if A_tote="tote 1" then set A_induct to 1( C6 e6 w# o+ ?. O2 r
else if A_tote="tote 2" then set A_induct to 2
3 X! r; a3 y; l* n) k* \+ v else set A_induct to 3
( c, h: D8 o1 D6 Z3 w) b+ A) y( m set A_i to 0
& M) Y7 z( \; O1 |7 M clone 1 load to P_induction; _8 S8 z/ o# ^& P* E! n2 E
wait for A_time sec
" p- p- t. e6 Y5 Z- A' } g7 Q end4 b1 Q1 H1 C" d% r* `5 h' b6 [, ^
end
0 \; Q/ Q# C5 A9 c7 }; G
/ {/ [/ M$ E0 hbegin P_induction arriving. e) j( z- Y; }. B& j( h
if A_induct=1 then clone 1 load to P_pick12 Q q8 l: i5 w% X6 ]/ ?( a2 k
else if A_induct=2 then clone 1 load to P_pick25 C t. f% _" k; ?/ g
else clone 1 load to P_pick3
5 o0 I' r) }/ w( m) X2 A, N% [end
; V/ V4 n& ]5 M9 ^: E6 m0 I' w0 r) l5 d: ^. Z
begin P_pick1 arriving5 q! Y& B& T: K6 O# z
set A_i to 1
/ p" D9 I4 d; m$ C& g2 q$ z move into Q_induct1
0 S2 R) c9 n6 z. B d9 y move into pickaisle.induct1
7 J- h. _8 j' C. U while A_i<=30 do begin
+ G* w, B# T; ~ travel to pickaisle.con(A_i)
- b3 Y4 y+ o4 n$ A& [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% p* G" r0 l* ?8 N; Q1 Q else wait for 10 sec
% Z+ N2 J3 G2 A3 ] if A_i=A_leave then send to die8 c! Z# V( `5 ]8 {9 L( J
else inc A_i by 1: _# H1 L$ j8 i/ O! E( G
end h( w# Z, {! |/ l- c% ^" v) M, ]
end
! t/ X& ]* a" c9 P# i( _) k" b
4 U* j! y# |, qbegin P_pick2 arriving
: w7 @1 ?5 H8 l9 ?- u+ o6 }5 |" K8 F set A_i to 11& W6 s k/ A, L, N1 }' G
move into Q_induct2
0 i2 n5 Y; k V8 ?( z7 V6 ? move into pickaisle.induct2% r! A( O' `) v* S, i/ y
while A_i<=30 do begin
% Q: d% l: E _ @ travel to pickaisle.con(A_i)
! @4 O: @" U7 |1 }3 R6 u3 T) e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 o* d+ c* b3 X" p/ e else wait for 10 sec/ J! s( A( q( l, n
if A_i=A_leave then send to die
- M3 E+ B; U- M) w m else inc A_i by 1+ k q) t; q8 D* [& j# Z
end8 l. V5 N+ ~6 R, U' T1 \
end
- x2 q. m* K* S- g0 g! e5 b' j0 z2 O8 l) i" h0 Z0 a( K
begin P_pick3 arriving
" s7 t2 M- j5 t0 r set A_i to 21
8 g/ _' c/ a5 v: R/ ?1 ~ move into Q_induct3
4 c, G" _$ z7 V0 \5 s move into pickaisle.induct3# L% \ Y* h/ F+ h0 O# f
while A_i<=30 do begin) S3 y8 R$ S( D) W2 J
travel to pickaisle.con(A_i)2 R6 C1 M1 T$ r1 q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 m' D* |* R7 W9 V' i$ O. c$ p else wait for 10 sec7 l8 {6 r& U: b: h7 C3 y
if A_i=A_leave then send to die
* l+ T* M5 {+ }1 P' t, S$ Q else inc A_i by 1
7 {; e3 F( m) b1 \( r end4 b0 { \ J) i4 ? I
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,其它按你的 ...
|