|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 @/ W# t( b$ n4 r; e
* W! I* j: C6 L; E( r; r我的问题是,在每个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" I( E6 S* a9 `2 N# [. W/ o3 s
) [) v' p5 @* A1 ^. Cbegin P_read arriving% u4 i/ V% u5 X$ v
while 1=1 do begin
, ?5 J9 w5 h; f) D9 m read A_tote from "data.txt" with delimiter "\n"
, y# u7 m+ M, q! c" K- } read A_time from "data.txt" with delimiter "\n". X. \% F" P* y
read A_leave from "data.txt" with delimiter "\n"
) k" N9 V# |. _8 s5 {- j) s read A_picks from "data.txt" with delimiter "\n"
+ u5 P8 {) s, }# D5 ?7 y set load type to A_tote: I" t, o* w. d8 o* `, @
if A_tote="tote 1" then set A_induct to 1, `) l" f, b' w/ E2 x6 C
else if A_tote="tote 2" then set A_induct to 2
' l7 g. G4 n% O else set A_induct to 3 ) ?8 z1 T" F. R' G9 j$ R# h3 M
set A_i to 0$ o7 g. n2 y0 b+ O
clone 1 load to P_induction, N _3 s8 A3 C$ w) l! r* x
wait for A_time sec" }/ j/ U# g- z& g; h1 r6 I
end. g; ^0 M' n8 t& ]& X: ~9 J$ G
end
. v U6 L4 h5 a: \( U! M' L
6 C! A) Q4 u# M7 T6 b& sbegin P_induction arriving' z0 s3 r4 H$ F$ A' i
if A_induct=1 then clone 1 load to P_pick1
0 L1 _+ u7 M. Y y. }( y0 h else if A_induct=2 then clone 1 load to P_pick2 b1 R" ?; Q3 |3 ?( M
else clone 1 load to P_pick3) t5 l" x( V! \# G5 k
end
1 ~. B- @5 u' f1 K/ r8 w+ T, E" }' e" A) V. v; H% ?
begin P_pick1 arriving! T" A! B* V. ?9 U; D0 W, Q; q
set A_i to 1
) n: a5 [1 b7 P7 @. ]3 B move into Q_induct19 @! z% h$ g& f0 ~& ^3 l4 x6 C
move into pickaisle.induct1% E4 j; x" I: L: p W
while A_i<=30 do begin3 L- ]7 L @" h. L9 {0 z) X- J
travel to pickaisle.con(A_i)$ A. L3 u- q9 J& a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& h1 k) T$ k- R
else wait for 10 sec
0 J1 ^" L- o% T! O( U1 e if A_i=A_leave then send to die
8 d) J- a$ r) B2 o' Q, s else inc A_i by 1
3 S y# H* W6 R end/ r$ O+ \% w o/ r" _
end
6 \* {7 u6 N9 L# m q. b- z; ~3 ]( f- o
begin P_pick2 arriving* e% d* n R; a* I/ o @, V( ^0 w
set A_i to 11% c' k2 _5 Q' G7 x, k
move into Q_induct2
% \9 _' c3 x8 j4 |/ I, z0 q move into pickaisle.induct2! F2 n' a" P+ l/ Z
while A_i<=30 do begin
9 H& V3 a, T# V- b" h travel to pickaisle.con(A_i). b4 D3 L. q; }8 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 E( N/ H. Z0 J* ]# \+ ^9 F
else wait for 10 sec
# m5 O4 E) `' X6 }! q# q$ Z- m8 J+ ? if A_i=A_leave then send to die+ E" ?2 `$ A8 o6 U# [
else inc A_i by 1
9 D' l, T+ J2 A. m! {+ e' { end- e( w: z5 q: g
end S1 U% h, o0 j2 U/ t
. m3 b8 N0 {0 e+ d- t
begin P_pick3 arriving
$ y9 q n; u( u6 { set A_i to 21
& d x6 O# a7 M- Z/ l7 w move into Q_induct3: ~$ R9 Q, _8 Q6 x! Z
move into pickaisle.induct3/ ]4 W, k2 B: i3 K; V. Z8 P0 T
while A_i<=30 do begin7 ^9 c" h8 ^, F2 E( ?* Z
travel to pickaisle.con(A_i)2 e( j7 E% s/ N3 w2 w" f3 V! Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* R" T( _% r8 {( F5 I
else wait for 10 sec- |* q6 l- t+ W6 M8 v' u
if A_i=A_leave then send to die
' `: z# F# O% k: R else inc A_i by 1# L2 ?; E: g* X# ~
end
- g" G# T5 I4 X; B* dend |
最佳答案
查看完整内容
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,其它按你的 ...
|