|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 b" Q @0 U4 W6 C0 _6 z, @
5 v$ e3 `& i: m6 Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。% P( ] v, W+ F" B
1 \ q! E6 U! Q& p' ^; r! Q: T* ?begin P_read arriving" Y4 x9 I: _! h7 A3 y3 v5 y
while 1=1 do begin7 O* }# W7 _: E3 y4 q3 W- N
read A_tote from "data.txt" with delimiter "\n"6 m: @# B$ d6 d9 N; j x
read A_time from "data.txt" with delimiter "\n"
7 r. T2 ?- v T8 K. H read A_leave from "data.txt" with delimiter "\n"# g. }* i+ R& B y
read A_picks from "data.txt" with delimiter "\n"3 k* {8 L7 C& V/ x. w! t3 b
set load type to A_tote
: P# G* i9 E7 h7 A" L if A_tote="tote 1" then set A_induct to 1
f' D V$ ]2 [, j else if A_tote="tote 2" then set A_induct to 2
T# e5 y5 z) T8 V$ b' J) X8 s else set A_induct to 3 . C* R" Q9 v4 G- q) Q$ B/ {
set A_i to 0
! ]5 E$ l1 H* V! W6 @ clone 1 load to P_induction
( t- ^* ^6 v0 v$ I4 |3 l wait for A_time sec% ?/ V2 I+ K5 {3 A8 l" S
end# E+ S/ c6 ^6 O. f" Y
end
, M( w/ O2 f; B0 L, _" N( Y
_7 t& }: p/ a) I% Obegin P_induction arriving
7 r/ r& W9 N) l+ p if A_induct=1 then clone 1 load to P_pick1' G7 j8 ]5 T# M: @6 A
else if A_induct=2 then clone 1 load to P_pick2
& {% h( a0 q9 V6 i6 t O5 a3 | else clone 1 load to P_pick3
) S" F: B! W! `* P: _end
1 {2 u7 J/ G: f/ w# a' y' g+ V+ |. y% M% S+ c7 z' `. m
begin P_pick1 arriving- ?; c7 ?/ X& b+ S: L* e
set A_i to 1. t# s9 ?9 J- s# d# r& R7 g& J% ^
move into Q_induct1
1 j" n: f+ \) z4 l4 ~ H* j x move into pickaisle.induct1
$ H( b; K# ~' l" J5 Y while A_i<=30 do begin
& N" K) H5 G9 x travel to pickaisle.con(A_i)
. n$ h- }6 L. o$ |* S$ F. `, Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 w" m( ^6 E* x. R else wait for 10 sec
7 [" U" I) q) n1 T if A_i=A_leave then send to die( D! F$ [8 H3 g
else inc A_i by 1$ q6 g$ j# }9 ^4 G
end
; I1 C3 k2 S ?1 [end7 p: U: Q6 q: u7 J2 P
/ L# L" w0 H8 y1 N/ y
begin P_pick2 arriving
8 E1 J. A4 F( q c: O set A_i to 114 j& m& G7 }7 w! J
move into Q_induct2- l/ r/ x- N. q/ V" g0 F
move into pickaisle.induct2& o0 _* Z! u! C* \1 B' Q0 R# w* I
while A_i<=30 do begin/ U! \9 g9 z; M9 H
travel to pickaisle.con(A_i)" ^5 @9 E8 C5 ~! p3 e( z& w9 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 R) ~: |. {% G2 t0 g1 c else wait for 10 sec
0 }- e8 E6 Q# h if A_i=A_leave then send to die
) ^, S# o K. V9 Q3 t( M else inc A_i by 1' Y1 a- L2 W' m5 G+ r$ }
end. V: t: p$ W/ y: Q3 U
end
$ g- P: c- Q" U6 \; |4 o* @; y$ \( s" y% Q$ h& W1 b
begin P_pick3 arriving
5 B' J: A6 k8 {7 j& j set A_i to 218 U {+ z" l* @, p" _" W* G% V
move into Q_induct3
5 ~2 C" q2 `$ X move into pickaisle.induct3$ b% h" N6 i, `7 l g( [
while A_i<=30 do begin
* l1 f6 E- }, T6 ]: B travel to pickaisle.con(A_i) c" ?$ ?. J5 K: }, ]6 i6 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 W3 R, l! N" {1 Q+ h2 P
else wait for 10 sec: p3 c; S! u6 }+ N
if A_i=A_leave then send to die
/ o+ M, u% a9 ~4 o Y8 w+ u else inc A_i by 1, |9 T: i4 W2 Q% A) @
end' c7 ^' K( i: K! e# f8 s' i1 f. f
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,其它按你的 ...
|