|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( G9 A! W2 s5 J. `9 |6 P$ P
6 O' m3 _0 ~9 i" l0 T3 v. 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中的数值,不知道会不会有什么不妥。: S% _5 b7 f4 s7 l6 l- O
6 W6 l4 X0 p! L5 ~; y) t: K" m% lbegin P_read arriving
# L! ]2 @: C. H; N while 1=1 do begin
: Q0 q/ l. C8 t* @! ~ read A_tote from "data.txt" with delimiter "\n"
: n) K4 k, {& ?. D4 G5 T1 S read A_time from "data.txt" with delimiter "\n"
' I7 k1 ?; O8 l! v7 m read A_leave from "data.txt" with delimiter "\n"' f% H8 o7 \" U" {! l0 f* r* m
read A_picks from "data.txt" with delimiter "\n"9 [, O1 I# B' x1 G2 S, Q
set load type to A_tote
& F8 P" V! U" }$ T6 y0 B if A_tote="tote 1" then set A_induct to 12 k8 [- D, X4 o. o' G
else if A_tote="tote 2" then set A_induct to 2
# @/ |- }5 v& i4 l L* K3 | else set A_induct to 3 ' R% e; y4 i# [% K+ Z& A3 {
set A_i to 0
" i6 k+ e! J. |) S clone 1 load to P_induction
1 e8 T6 H% f/ [1 ?5 P wait for A_time sec/ i) o1 |' V: h
end
7 i$ x- U; j$ h" y1 U0 send1 j" J6 O" }: m
3 t( d/ h' I8 ~3 A
begin P_induction arriving# u9 o0 B ^, a$ @
if A_induct=1 then clone 1 load to P_pick1
7 u: d/ l A" O6 \7 ~ else if A_induct=2 then clone 1 load to P_pick27 n4 B* _3 G# S1 f6 w
else clone 1 load to P_pick3( h" g) l1 g: x m4 v& P
end
! { Y9 O" s5 }9 o e3 A* S, L) v
begin P_pick1 arriving
6 d- i8 X: y8 b set A_i to 19 D/ t% ?4 }; i! s4 W, E
move into Q_induct1
' x1 J8 `& G, z move into pickaisle.induct15 _! l+ t# ^5 ~9 ?7 `
while A_i<=30 do begin" q+ ^9 | y4 h; r/ a7 U/ H0 g
travel to pickaisle.con(A_i) i0 U* J& L: I4 W( O' a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% k1 u$ {& y, l' Y+ M
else wait for 10 sec
( B/ s* a% w/ V+ O9 Q2 z if A_i=A_leave then send to die
( T2 {, Y# ^$ q5 |5 j else inc A_i by 1" @- g. g' s' w1 F$ i5 G
end& d+ x8 E' I# Y5 C3 ^
end: F* j5 t' b6 _8 a% t1 W
& E3 s5 o2 \5 h2 s
begin P_pick2 arriving+ B. [- ^+ h- V" w S
set A_i to 11
) C/ X" b9 ~. H( a$ I+ t4 P7 i, I- d move into Q_induct2
* S6 }# q) K7 ~3 _0 N8 t4 O move into pickaisle.induct20 }; g& P4 L8 K, c! l
while A_i<=30 do begin
8 |: U0 D; S2 w travel to pickaisle.con(A_i)7 } A/ c3 K% l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% j+ S5 j4 z& |8 i/ R* Z: A
else wait for 10 sec: ?! U' [2 e7 E/ h/ e4 C- H8 i
if A_i=A_leave then send to die# d) ~% p' [# h# h# U8 J2 b) D
else inc A_i by 1
! X5 |* e6 `, Y4 v4 I b end2 o9 m# o' |: F5 c5 Q, B
end) @+ s" H+ A8 ?! d" x( [
6 _8 o0 A# D i: T
begin P_pick3 arriving
$ n5 [' q @1 Y/ ]4 j9 h set A_i to 21. O9 T, g& o( ~% |
move into Q_induct3
& I0 [0 ?* w' H$ }- Q$ t move into pickaisle.induct3+ I) @) s, K5 [
while A_i<=30 do begin
- [- ~* z. O; u travel to pickaisle.con(A_i)
# E; o+ [7 }& a$ W! g( B* q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- j! X2 x6 {5 Z( m& x+ U0 f
else wait for 10 sec
7 Q" e# \2 m" T, U2 B# z+ s1 H7 T+ j if A_i=A_leave then send to die1 @; E7 p9 e& `8 t9 I
else inc A_i by 1
2 D! o2 k+ f6 o+ L- u0 k7 d/ H* n end9 f+ F& m( r w" _- h& ^
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,其它按你的 ...
|