|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 |4 I+ z" u/ ]/ X: i" i$ e7 ~- }
+ }; k% t! v" [% P X$ z2 t1 K我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 g: H; o$ B0 `7 m/ v" Y. ?# b
G* z, a4 K( v0 I
begin P_read arriving, e+ V4 e$ F4 h' M- n: @' |; i) Y
while 1=1 do begin" |& D' R, X; y
read A_tote from "data.txt" with delimiter "\n"
8 l$ j$ e3 W$ L; d read A_time from "data.txt" with delimiter "\n"
2 u4 {( P& L/ v' @9 |) J read A_leave from "data.txt" with delimiter "\n"
) a: F' {, ]. o5 u read A_picks from "data.txt" with delimiter "\n"
, x3 V* U8 O2 f X( w9 } set load type to A_tote
* t6 h4 B$ I% @) H3 V if A_tote="tote 1" then set A_induct to 1
2 x2 P7 O0 L. I) i- h; ^4 l) Q) q else if A_tote="tote 2" then set A_induct to 2
3 t) R! ]. g0 p1 r9 X" O else set A_induct to 3 5 }# a4 L. W* S8 r' q. W
set A_i to 0
1 u9 g- f" J4 ], N% t4 h! s/ K0 m clone 1 load to P_induction
9 R+ @2 [8 k2 X+ O& s! u, Q1 {* _ wait for A_time sec
8 Q0 s7 z- W4 Z$ C6 } end* b* \4 t! Z" C, L
end' ]3 {/ C4 h4 i( [5 U
3 t( ~2 ] Y7 h# L4 \+ ^, Cbegin P_induction arriving4 D' P& x* H: F2 y! |
if A_induct=1 then clone 1 load to P_pick1
3 B' ?9 y) J' u1 y8 D else if A_induct=2 then clone 1 load to P_pick2" p) s2 c4 k6 |9 n+ d
else clone 1 load to P_pick3. c. S6 P8 i( u. o6 X3 p- ~
end5 G) S- P. o3 J& c! P
$ m$ d( l- e- q0 q) X1 }7 p& o/ t1 n
begin P_pick1 arriving
) a1 v' N, p9 D% y' y set A_i to 1$ F, D y1 g# R0 L2 }
move into Q_induct1: V6 v- z5 P7 ~8 k# t5 |4 ~. i
move into pickaisle.induct1: k3 d0 X5 W. `
while A_i<=30 do begin
- m% `- J% }+ s travel to pickaisle.con(A_i)
) C; @8 Q3 A" J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" |7 o0 S: B! D
else wait for 10 sec. }% k5 @ j+ a# H
if A_i=A_leave then send to die3 _" p9 K3 V/ Z
else inc A_i by 1) `* s- ?/ Z {% Y' o% b
end
3 B6 j+ J) _/ ?2 @0 W! rend9 v5 @1 P* J7 h: B
7 e. ^7 C) b2 O& ?, ^begin P_pick2 arriving
7 j4 O! n! n! M& X- t. ` set A_i to 11
5 R! \. M" K$ t. k move into Q_induct2+ |5 M: t* F' p, d9 V
move into pickaisle.induct2 Q2 m. U C6 e4 z5 }
while A_i<=30 do begin/ j u4 L/ {& T5 V$ a8 }* P4 V
travel to pickaisle.con(A_i)
% Q) ?# v) S, ]/ [6 h- R& Y5 X* h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c2 ]" I. L8 S% W3 R3 R2 F
else wait for 10 sec$ F! l6 ~3 Q3 T) f. {1 h/ C8 W$ ^
if A_i=A_leave then send to die8 I3 J @- W: F$ \
else inc A_i by 1( a9 s! z+ ~, h/ [
end
8 K4 u' I8 y9 Fend9 F* W; a% O% K2 _9 R5 Q# N
, Q% A( P$ y- G! D. J4 u+ |begin P_pick3 arriving! |* J3 \* i& X5 t
set A_i to 216 o% `- \+ U( `
move into Q_induct3
% L) d F6 o: d2 O move into pickaisle.induct3
& i6 r( | Y+ \2 l: k$ S" v) ~ while A_i<=30 do begin
( u& \0 Q& G5 X- E( | u& M9 X travel to pickaisle.con(A_i)
( n2 `$ M7 e/ {. z3 z" b7 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 x V0 s- Q7 g2 S$ r: V% n% ^4 _ else wait for 10 sec- P6 R. r6 c9 v- Y
if A_i=A_leave then send to die0 I% D6 C; K2 i1 l# o/ b
else inc A_i by 1
) f% s3 U, N) Y% m- ]7 m end
5 O& n' X6 W; j3 }* 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,其它按你的 ...
|