|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- \. K5 `' ^2 h! V$ K0 X
7 ~, W8 e# x5 l+ q" X% _4 R$ U我的问题是,在每个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中的数值,不知道会不会有什么不妥。. o% Y3 Z4 P1 m! e9 a3 b" H
8 e9 V$ s" c% \, d
begin P_read arriving
% q/ a% J% e' I& o O! J while 1=1 do begin
5 t& j+ I' S' M' d u read A_tote from "data.txt" with delimiter "\n"2 T( p7 ]! M. K9 H/ g
read A_time from "data.txt" with delimiter "\n"3 T# K% ~/ K* N3 ^) @( P
read A_leave from "data.txt" with delimiter "\n"
o& p+ I. ^( F$ N read A_picks from "data.txt" with delimiter "\n"
& ?, d0 i! @2 R( U9 e. T% g set load type to A_tote, p. E6 N4 u5 U4 I8 ~5 b
if A_tote="tote 1" then set A_induct to 1
& i" v; F t6 J1 z: d3 P else if A_tote="tote 2" then set A_induct to 24 ^. V/ p1 |$ l# @( Z o/ I1 i4 a
else set A_induct to 3 # B- a% f# ]9 u6 T2 j
set A_i to 0
. s `( G# e$ d m* Z0 l3 [ ^* | clone 1 load to P_induction8 S, s) {9 p6 L" v& E$ X5 u, e
wait for A_time sec
7 d7 |2 {. A& T% L end# B9 T- N9 g% _- G! s
end
, W( Y# q1 ^: q# o( D% |
! z, ^/ V! x1 [7 N- k- a) K( R( Ybegin P_induction arriving0 q: D4 y& e' V/ h4 u( \% q( U
if A_induct=1 then clone 1 load to P_pick1+ T( x7 P* ]* N, b& g( V
else if A_induct=2 then clone 1 load to P_pick2
# k) t" D' ~, d1 K4 s: N) T5 K else clone 1 load to P_pick3
. W9 h% L2 I/ I8 |* m9 Gend) L, R2 W' I: W, \5 {
a! M2 {$ q/ `
begin P_pick1 arriving
+ h2 N/ Z4 O8 Q$ K6 z+ K) K* ~ set A_i to 1% o a+ h, A% J+ Y: k
move into Q_induct1
8 ?/ Y" h. Z j: C0 a move into pickaisle.induct17 Z1 k. v4 G0 _, N" s8 L9 ]4 C$ P% {
while A_i<=30 do begin
2 z3 l2 R- C+ D travel to pickaisle.con(A_i)
D% j; s! w i* a. ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- G" t* F8 ]- `' U6 j8 \( `) ?; D2 U
else wait for 10 sec4 }% R4 D" n" V2 n2 f' V* u" f
if A_i=A_leave then send to die: i1 @8 d" k( m$ u! x2 n
else inc A_i by 1
0 i" z$ H. P5 k# Z" g2 [! o end6 c/ d8 `! }- m' h5 G
end
( ^: D/ W% s' S4 i. p9 G# K. n* [4 \& |% p& v% X2 |
begin P_pick2 arriving7 w5 B: [3 f5 m6 M; [5 x P
set A_i to 11
0 s* c* p" ?( Y. ] move into Q_induct2
2 J- p7 O6 S- K R. ^$ W9 z move into pickaisle.induct2
% g' _. \ f# o8 B" h1 c; E; Q while A_i<=30 do begin& G4 {- K9 {& G9 q! S( W
travel to pickaisle.con(A_i)- v: s1 k7 m* |, m, m* i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, K6 H% M# o5 ~+ L2 q2 h
else wait for 10 sec" C- | k' _+ s
if A_i=A_leave then send to die. v' q7 Z6 H7 n( v7 w
else inc A_i by 19 z- C1 n z4 f0 [# Z7 Z) y" P; K
end7 {8 H2 R! o, b$ s/ [ C2 u
end H4 q+ y$ \; [2 J6 {( L+ I
4 n0 Z8 C4 H! |- h4 [& ^4 F
begin P_pick3 arriving( Q' D& W6 Y8 w" w2 c
set A_i to 21& B# g: I& {# X+ X' W$ t' S
move into Q_induct30 k* a8 A. m0 z
move into pickaisle.induct3- t& S5 m$ ~$ z X6 x" _- u( U
while A_i<=30 do begin
! F/ |6 M/ W$ Z0 |) L- `( p% Z travel to pickaisle.con(A_i)0 m4 i; v4 ], W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ i$ H7 P8 v- i' Y" P, ]( s
else wait for 10 sec
0 i1 c/ p0 I, D. |- c, m- i if A_i=A_leave then send to die- p! l# o8 A1 ~7 Q) N* |$ ~
else inc A_i by 16 ]; J- p1 s; ~- z" z
end
1 ^# [* Y6 J5 h% A( G% ?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,其它按你的 ...
|