|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 M3 J9 _; \6 ^" Z6 Z8 f7 S' d( W" g1 a$ n6 b. Z6 |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ j; s/ t( y9 A! B
1 g% `, r& Z' R
begin P_read arriving% W' N9 m0 `: s- o' I$ j+ e9 y% g! ~
while 1=1 do begin
* `8 d B4 }' o read A_tote from "data.txt" with delimiter "\n"
* Z: O- \* k( f) C read A_time from "data.txt" with delimiter "\n" W/ w2 Y" u6 z6 n" n9 `
read A_leave from "data.txt" with delimiter "\n"
r; F/ T$ v4 s( F* h; ]( l read A_picks from "data.txt" with delimiter "\n"
! D6 ~, n$ O/ U/ V2 T set load type to A_tote6 Y1 y5 R: a5 ~/ [
if A_tote="tote 1" then set A_induct to 1
7 k b% g. f: e2 p' g- K0 B6 C else if A_tote="tote 2" then set A_induct to 2
9 A* ?8 e$ d2 y) z9 n. w8 Q else set A_induct to 3
2 o- p, Y* n! P9 g set A_i to 0
4 ]' H, ?1 k9 F7 G0 `- l6 s, I! K clone 1 load to P_induction
5 R3 ]$ n+ y4 g wait for A_time sec
1 _) }# \! g# L' X end
, d& H% m8 L. j2 G1 iend/ z: S# w! l; Y
/ w9 N9 J: G5 U! t. V; A! rbegin P_induction arriving
$ Z/ C9 m3 x( }! _5 k; | if A_induct=1 then clone 1 load to P_pick1
0 h V+ d) l5 E; S8 N; X else if A_induct=2 then clone 1 load to P_pick2
% V, H) d# h9 k% ^) v' p; k1 ^ else clone 1 load to P_pick3
1 y6 q1 {+ z b0 t& s; }) ?end8 m) f/ R4 k$ D, P
}0 W4 e& o' ~& o& ?' P* Q
begin P_pick1 arriving4 S2 A2 T; I$ Z
set A_i to 1
, y8 d5 a/ q! ^ h$ d: D$ F( N move into Q_induct14 ]$ P+ f- Y* |+ f6 m! G" B1 U
move into pickaisle.induct1' I& k f) a E+ J
while A_i<=30 do begin
/ \ P- g4 N5 a: W( @1 g! m$ z travel to pickaisle.con(A_i) m" _' p4 @, o( q0 Y9 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X2 ^* X3 ?* y6 A. { else wait for 10 sec, [: t, A& C2 A/ g
if A_i=A_leave then send to die( w3 M, J3 x2 T: D% {- J
else inc A_i by 1
$ g( i( V3 C Z. Z8 t* S end# }2 M/ O' i" j% a4 t
end
$ g q, v- a3 t2 Q' W0 m9 X5 b0 }- X/ {, m1 _6 B. C
begin P_pick2 arriving
9 Z: I7 J5 [: x set A_i to 11* S9 E$ Q4 C/ P) j; d# f; }1 H
move into Q_induct2
0 ?' d" h; z2 K5 T. I+ M/ \ move into pickaisle.induct2! @: F3 t! G i* r/ b/ E
while A_i<=30 do begin
7 K* R& f( T7 _' H travel to pickaisle.con(A_i)
3 F/ K7 V0 G" |5 p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 x+ i0 [! U& o& F
else wait for 10 sec( v5 A: E$ }, N' b
if A_i=A_leave then send to die: b4 o- X/ e ]2 y/ ~* x
else inc A_i by 1
5 e6 n5 Q5 [! U- [7 i) f end- y- ~3 g+ d# v5 \8 \5 a; l8 q
end7 Z. E! F8 b1 p5 {+ y: |! m
# |9 v. z, H3 ]* y
begin P_pick3 arriving6 B/ q9 i( U6 ?+ y7 ^
set A_i to 21
9 R$ }, s3 |. L% K move into Q_induct35 d3 q( h" U& H) [& @" s% T
move into pickaisle.induct3
: o+ A4 P) K* d* q- ~ while A_i<=30 do begin/ [ Y1 Y% C9 ~$ a; E& D
travel to pickaisle.con(A_i)
& i: v" G, a$ O- N( l" Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 |8 d; t2 x4 x else wait for 10 sec
1 T" H: n# M1 s) r if A_i=A_leave then send to die8 [& G$ \, [' _. g) b3 E
else inc A_i by 1/ c2 ?/ v5 Y" D( T0 O/ f5 ?1 k
end
$ M% ?- a. [3 e- m/ }. Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|