|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* H- u1 f6 K$ Z7 A& T5 r/ I5 C: C/ ^. z) B1 H6 J) V& w
我的问题是,在每个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# c9 F+ H/ {/ y: U* {! H: P2 N; r9 m
begin P_read arriving
: X) X- C% ] T: z" m while 1=1 do begin
! Z7 X7 Y. N' O- l0 x2 {3 Q read A_tote from "data.txt" with delimiter "\n"
9 L2 k! A' G! m) b* V; { read A_time from "data.txt" with delimiter "\n"
, { n' R+ F& N% n, c read A_leave from "data.txt" with delimiter "\n"$ ~# E& s; J( S9 o
read A_picks from "data.txt" with delimiter "\n"
: c+ z0 k( C3 E& C5 N' N$ i! m set load type to A_tote
. ~( b& n. P) P4 I' O0 y* K: L if A_tote="tote 1" then set A_induct to 1+ V7 r7 [) K) R7 R
else if A_tote="tote 2" then set A_induct to 25 n- D/ ^9 v1 C9 H U8 Z7 p
else set A_induct to 3
8 x/ y) @! {7 E4 v set A_i to 0
5 E, _# N. X; _* w: b clone 1 load to P_induction
# ~: L! X7 S( d4 V% z; I wait for A_time sec
* i, g) l7 J t) L, E- }& g2 ?( s end
" b5 y- F# d4 I( V/ w, Mend; E7 n* d/ Y+ y. C
0 N/ b3 ]2 c/ q0 B8 Z/ H# i/ F
begin P_induction arriving
$ Q; B. q' Z2 w% V" Y1 `1 R if A_induct=1 then clone 1 load to P_pick1
) {8 U5 u" `- w% O else if A_induct=2 then clone 1 load to P_pick2) M+ ?& k5 P, z. H
else clone 1 load to P_pick34 D; ^$ A- K4 k5 S
end2 c, g. w2 K+ N2 C; Y
- p/ O3 U; w* G) r
begin P_pick1 arriving9 q+ i) [5 m# A4 d# v+ E
set A_i to 13 e" ?* E: S2 d8 ^9 J: J
move into Q_induct1+ O5 N) i9 f6 w, t; x/ R9 F* u
move into pickaisle.induct1! ^' e) A1 o8 T# T
while A_i<=30 do begin& X" f# j* v" r
travel to pickaisle.con(A_i)" e+ z4 f: C8 A5 y, ]5 P9 l9 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ {6 Z9 r4 ]' y0 L- ~
else wait for 10 sec
: Z7 m" e. @# M* t: B% Z if A_i=A_leave then send to die
, N$ Z c+ M, ?. ?$ b6 \2 ]( L- X else inc A_i by 15 @" F `3 J }
end
1 O# c" c: S$ X4 bend' `! S3 t( `# E% Q+ z; C. B
8 i! d: W/ Y% M# B' S/ U6 W+ }begin P_pick2 arriving
% W G& f9 @ f2 Z: E. T0 [4 i0 _* k set A_i to 11; } Z( }& Z& _
move into Q_induct2
, e, P/ E2 e7 B* x R move into pickaisle.induct23 {( I+ }1 i- C, W7 }
while A_i<=30 do begin& n9 G/ y* l7 e7 x" a9 U9 k6 v& e9 B
travel to pickaisle.con(A_i)
" e. |2 V8 ]6 M# O1 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ R3 Z! a, l& r6 F4 {& Z x s else wait for 10 sec; q1 {+ i4 P5 I- E
if A_i=A_leave then send to die- k) f: S6 d; ?3 o; c7 O
else inc A_i by 1- P0 ]( \9 J x4 y6 t
end
: m+ W- h/ A+ D/ ?1 wend+ N: j! u6 U+ m. S
) J) Y, q; }7 D) ]8 Ibegin P_pick3 arriving
% P1 _/ I* R( o* k, o% w set A_i to 21
4 _6 Z8 l+ K: g6 d" m s move into Q_induct3" d3 T: l" W! W0 H
move into pickaisle.induct3+ Y B; e: j) v' ^
while A_i<=30 do begin
: o4 D: N0 q8 a; ^7 ? travel to pickaisle.con(A_i), f2 I, m# f( O4 {/ X! W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 h9 I! G% S+ z9 O) K: Z; r1 E1 Q% ?
else wait for 10 sec; d( x' a2 q2 `3 w9 v
if A_i=A_leave then send to die8 C& T. |( _0 p, r% M; k
else inc A_i by 1. P. A& z5 N/ z! C0 [
end
1 p- r+ B( e' [- G3 Q$ vend |
最佳答案
查看完整内容
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,其它按你的 ...
|