|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& i- L2 k" q% N* a/ w8 W8 `
! j+ L- J7 [% b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 m' J4 ?8 {) ]
0 V; C! \2 V# W- K2 K* {( Fbegin P_read arriving B5 F5 l5 j6 I; D' d. l+ J
while 1=1 do begin
' {' y. u6 @2 n read A_tote from "data.txt" with delimiter "\n"
8 @4 H; K3 G% L* p# t read A_time from "data.txt" with delimiter "\n"7 u4 B/ A! }+ X7 Z
read A_leave from "data.txt" with delimiter "\n"4 Q) F/ t% n% |
read A_picks from "data.txt" with delimiter "\n"
0 l+ e( Z3 A) h* H set load type to A_tote- ^. ]# \5 \3 D4 P* N" `
if A_tote="tote 1" then set A_induct to 1
2 Q) N& m$ `7 f7 j2 ], r W/ u' Z else if A_tote="tote 2" then set A_induct to 2( i: b1 ?: ?! |* X* C$ f" L
else set A_induct to 3 5 v% C5 {: t8 P; ^2 _$ j$ D1 Q
set A_i to 0) w4 s& d& l' b; J
clone 1 load to P_induction
/ [( v* x- }) s3 I8 b$ Z% j$ E wait for A_time sec0 q( ]/ n$ U N$ {
end9 D6 J* Z. z$ r0 I' i, n; s4 q* G' z' f y
end
% w; ` f ?# ^$ H4 `3 v$ [! c5 c1 M' W* u7 g9 v( g
begin P_induction arriving
/ w( A. o( w5 u' Q( z3 B! ?8 k( F if A_induct=1 then clone 1 load to P_pick1: o9 Q" u$ n/ @, f
else if A_induct=2 then clone 1 load to P_pick20 v+ v7 t; G9 l3 u
else clone 1 load to P_pick3
5 ^# O) Y/ y: ~7 {4 I% Mend! a! _) r1 G/ q% x. N
9 j: G, n& N& l
begin P_pick1 arriving
7 t5 n# m, F6 Y8 S, g2 r set A_i to 14 r0 E/ H5 y4 p" L* K
move into Q_induct1
# }# ]8 S& r# M, Z( K move into pickaisle.induct19 T" M( i: T& D/ k
while A_i<=30 do begin/ b. C0 ^! _* s. y' v) X- y) M
travel to pickaisle.con(A_i). N/ z" O% b0 ~ @/ ^2 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 p: Y4 g! U1 {+ Z; A
else wait for 10 sec; ?3 \: e7 F, y1 l: X
if A_i=A_leave then send to die* B: f. A4 [( C3 A- J. d# r
else inc A_i by 1
9 l+ ^4 r0 W: B f" @ end
2 K1 ]. P }: g9 ~9 @% J% aend, n: [* G" x: `" w
% p6 o4 i1 |& A5 c
begin P_pick2 arriving0 j; C% K2 }4 y+ Z
set A_i to 119 R: q* o# z$ M2 N: g4 R+ N4 c
move into Q_induct2( ^# |/ y) p, F- {" Z! f) T
move into pickaisle.induct2
X9 _8 c- c; y* {( R while A_i<=30 do begin/ T$ a6 C( e, E9 u" n; [/ Q/ P/ I
travel to pickaisle.con(A_i)
0 _ \* k1 ~6 Y6 F6 I! { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 x4 R, z3 |) t! N else wait for 10 sec& g/ g, `3 L2 T
if A_i=A_leave then send to die
# {& V/ ~! L! ]7 E else inc A_i by 1
( H, C2 n- ?0 z/ k end0 B6 D0 u' ^, v- l
end
& h9 ^& _, W/ m* @
/ P' b9 e G6 [$ mbegin P_pick3 arriving
1 c6 V4 C- ]+ ?* u$ x set A_i to 21* i" ] V5 o( U% K+ I1 }& K D
move into Q_induct3
5 a7 p4 [" G4 G$ _! V) I5 n move into pickaisle.induct3
& _ E* K1 r; _4 o- e2 v8 l6 L while A_i<=30 do begin+ i2 {0 D( Z4 S. [( [" P, ^
travel to pickaisle.con(A_i)- M5 l* v; k0 R. Y8 x8 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; F- o0 i8 l$ t$ ]$ N
else wait for 10 sec
4 Z' G% S( V3 l4 \- m6 [ if A_i=A_leave then send to die' r6 E5 X$ u5 C4 t5 O" M
else inc A_i by 1
# n. w6 z) [& w* R, X$ s end6 p, B' o/ b: [
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,其它按你的 ...
|