|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 g; T0 P8 l6 Z( g1 w
1 U4 o6 d" B: L7 E0 m我的问题是,在每个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中的数值,不知道会不会有什么不妥。; V; S8 E4 i# ~. ?
1 R; F7 C. q& Y5 |9 X% r& kbegin P_read arriving
' A4 i }) k, m9 C while 1=1 do begin& _/ B, R2 q: Z- g- K
read A_tote from "data.txt" with delimiter "\n") a' t# x D4 p4 E2 {5 e
read A_time from "data.txt" with delimiter "\n"
# r6 Q: t1 G+ {) C read A_leave from "data.txt" with delimiter "\n"
! L" ]' J6 d4 c$ `, G0 _ read A_picks from "data.txt" with delimiter "\n"
& Q7 ^1 _$ Q2 g4 i$ q set load type to A_tote( \* c, c! x6 C- b
if A_tote="tote 1" then set A_induct to 1
" T8 v. M5 |% W, M/ E- _7 k; v9 c else if A_tote="tote 2" then set A_induct to 2. u/ @+ k' e4 b
else set A_induct to 3 / f, C/ m* l8 u' X# h9 ^' E
set A_i to 0
5 H# ^ E" U! ]9 b8 B1 `5 H8 h, _! ?! K clone 1 load to P_induction4 v( ~! u: O1 A! T; y" z
wait for A_time sec% [0 ]% n, I& g& N% c9 |
end
) n4 }: I& k. b. ?+ yend
4 [ b: S2 ~; N- |( ]. j* r, i A% `" e7 {4 a& {
begin P_induction arriving0 o5 I4 H" l$ V8 E& T: n+ d/ t$ x' C
if A_induct=1 then clone 1 load to P_pick15 _. M+ d( _8 c3 U T
else if A_induct=2 then clone 1 load to P_pick2
G4 ~4 l3 ~, p" ` else clone 1 load to P_pick3
( l) \) O* [; j5 ?) a5 r; s6 r+ lend3 ]% c) j% h1 a
1 o8 F/ {+ K. J! Q# d6 s% Lbegin P_pick1 arriving- ^; v a$ W' ^/ u k; T
set A_i to 18 C9 g" p4 {1 e; }+ x: u X
move into Q_induct1& h; P6 V7 |# C, F: Y& {$ _
move into pickaisle.induct1
/ [4 y- V6 J: k% y2 Y% H5 Q while A_i<=30 do begin
# R, {2 K$ ~# L2 {) W$ A* b travel to pickaisle.con(A_i)
* C I& v3 E$ G+ \/ d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Q: E* r+ j4 P1 `" T: b/ L! m else wait for 10 sec
: S7 y9 m1 A1 f if A_i=A_leave then send to die5 O n+ s! m. Z
else inc A_i by 1
4 G- W! r! g' |* C! t e1 n end
& E" L6 m$ c# _5 W+ iend3 Y( L( p# }2 P
# x( Q2 c0 X% e+ g4 nbegin P_pick2 arriving! G# |5 u" F, Z5 m- z
set A_i to 11. w6 P0 R3 Z" ~# l6 j& z
move into Q_induct2! N% A+ X8 F. S
move into pickaisle.induct2( M9 [+ Q4 i- g( w4 E
while A_i<=30 do begin
" F$ W% W; ]+ }: c2 i travel to pickaisle.con(A_i)
9 w2 @3 O9 t& p/ _. A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& k" T6 R" G! B }$ ?
else wait for 10 sec: B8 L0 b& { I( g; ?" f( y
if A_i=A_leave then send to die* s9 ]* E( d/ p; D2 N8 P7 v
else inc A_i by 1
* z& s+ b. l3 A5 R P; ?! j end+ e% {# G; I- _5 e
end. g) B. ?% h* C+ S. R/ ~
: s1 {+ `# a1 D8 P
begin P_pick3 arriving( t/ T# w: ]0 a- c4 D+ L) d; n
set A_i to 21
/ K' [5 X1 o0 {5 \8 e0 | move into Q_induct30 B. z! g, c: q; @/ w- o! W: J
move into pickaisle.induct3. }( O( x* t1 q. ]7 ~
while A_i<=30 do begin; a4 O& |3 x: ~/ n& X+ C/ S
travel to pickaisle.con(A_i)
/ G) v& L, f) t2 V+ W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! Y1 A% a }! j3 d8 K
else wait for 10 sec; C. y* m8 u2 q8 t+ `
if A_i=A_leave then send to die
2 [% [4 U4 j! S( P else inc A_i by 1+ D0 u4 g6 t% Z7 ` a9 |8 F
end
, ?9 I7 k7 |8 q( H$ f: A6 qend |
最佳答案
查看完整内容
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,其它按你的 ...
|