|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. U# H% b4 P) f
6 N, ?) R+ o0 F6 ^' F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 K. M5 k9 ] s. R7 Q4 J1 q1 j2 X6 d+ P
begin P_read arriving
- b- h3 n; _7 l8 t while 1=1 do begin
2 W: j. f( B: y; b read A_tote from "data.txt" with delimiter "\n"2 K, i9 m q/ ~
read A_time from "data.txt" with delimiter "\n"$ U+ }4 P" z$ N4 G3 g
read A_leave from "data.txt" with delimiter "\n"
& v- E/ x1 z8 m: u. Z6 j. u9 J6 X0 s* ] read A_picks from "data.txt" with delimiter "\n"
2 m }) q$ z% G: r$ Z set load type to A_tote
3 Y8 y6 a7 v- l9 F4 h* @ if A_tote="tote 1" then set A_induct to 1% r0 K: o' D4 ]. f
else if A_tote="tote 2" then set A_induct to 24 F% u& [4 f/ e" a/ j2 p2 Y2 U
else set A_induct to 3
6 b2 R j' l1 v/ v: X set A_i to 01 F- r* ? a5 ^) t1 J8 U( }
clone 1 load to P_induction: c/ L4 a) M6 p# N/ V# A0 A+ t- N/ }
wait for A_time sec
' s/ @! x, p3 U, {( C: P end5 W+ c" W6 }' P( z
end
& ]: N3 q: o* K! d; x9 g: y- n9 _' H) f
6 o8 I, M7 e7 s( N4 n1 lbegin P_induction arriving8 X3 q0 N3 B3 i! X9 ?. s
if A_induct=1 then clone 1 load to P_pick10 U/ e6 V% B3 M- {$ a
else if A_induct=2 then clone 1 load to P_pick2
% U/ R0 ~) H+ m8 d& r; w L( S1 f else clone 1 load to P_pick3
* @9 w$ n; S9 {+ M; f+ ]end
# W3 ~/ b& J5 I) G: S% T4 J
2 u+ M. f8 `- C2 ]( k3 lbegin P_pick1 arriving; g2 c( ?( a! w2 i& y' [
set A_i to 1! a0 V# g3 ~& [3 @0 C
move into Q_induct1
$ [' h1 J$ Y1 y& B$ b& Y, U6 |. Q move into pickaisle.induct1& p q' R( e8 b2 B0 \
while A_i<=30 do begin
1 o: k2 B) ]9 C$ O6 @- b travel to pickaisle.con(A_i)/ F3 j8 C8 [: Q g0 |9 @+ A+ i, G/ `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* K, E6 B+ W: u- |
else wait for 10 sec! @" S+ w. ^9 F# P7 t1 k4 \$ h+ H
if A_i=A_leave then send to die/ p" ]7 U; h5 w1 m$ F3 z
else inc A_i by 18 B; T' M/ e1 D
end: U# u5 G% |7 U1 X8 h
end' N9 f' A. w% o" W
; z) h; L+ `0 Ibegin P_pick2 arriving
* o z8 N+ J! z2 _9 M set A_i to 11
+ }" c k& s( @" F) ~. U- F move into Q_induct2
) H& X# _3 ^; k+ d. u move into pickaisle.induct2; F0 F' l: R F' T+ C; k2 @9 t
while A_i<=30 do begin7 v* B# L/ r% W
travel to pickaisle.con(A_i)
: z. y2 ^7 ?' k, q2 C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 x* M( f% c: t' I b% c# ? else wait for 10 sec. o3 a9 X2 ]% }9 `+ v: @/ r- ^# o
if A_i=A_leave then send to die
4 N% b! B7 W: B8 ~$ ?/ z else inc A_i by 1
% F+ S7 d. d' g end
5 n0 D( v( _7 Zend1 Q3 V7 M" A* }: [4 N& A4 e
$ V; |- Z, t0 M: ~+ Jbegin P_pick3 arriving+ _3 C5 V$ Y1 u) b( o% o: w7 m' ^
set A_i to 219 v4 K: w H+ w- I0 C% p: M+ z
move into Q_induct3' o& Y, V. l- Y8 `( T/ T' n& k
move into pickaisle.induct3. t) N( v1 `- P6 _3 v( o/ m
while A_i<=30 do begin
) f- L# g+ `' D z travel to pickaisle.con(A_i)0 z7 s: {8 L9 A* q; w" l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: Y, x r) i# v5 g" i! s else wait for 10 sec
% {6 P- u6 L/ e1 z if A_i=A_leave then send to die
# n4 v& Q0 u' p! a else inc A_i by 1
# @2 K4 N3 q+ a9 ]5 r1 c- P2 q end
2 n+ S( B' }, m: b# q2 c9 g1 O Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|