|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 m, [3 D4 ]) `9 M# k; Q/ U0 ^
/ |3 E$ ` b! 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中的数值,不知道会不会有什么不妥。
5 p P- |* c; E( s5 M0 I4 Z; D2 Y) B I6 Y" c
begin P_read arriving
3 X' k+ |! v: y, M7 g; f while 1=1 do begin
7 c" L0 k3 K# A7 O% d" B- Y- o! u read A_tote from "data.txt" with delimiter "\n"
7 J2 W8 k1 Q4 g3 Q( d read A_time from "data.txt" with delimiter "\n"3 f! Q8 \ l! [. g+ _+ q
read A_leave from "data.txt" with delimiter "\n"
5 ~ v* j4 A0 U- ~# a5 Y* o read A_picks from "data.txt" with delimiter "\n"; ^' e0 o. _' Z+ r
set load type to A_tote2 u* x7 j: S4 U- t$ J" Y9 Z* r7 a
if A_tote="tote 1" then set A_induct to 11 d" r6 _7 F/ \/ t# @8 |$ q/ Y# Y
else if A_tote="tote 2" then set A_induct to 2
5 d' T- @4 Y/ v- G. }) ^) D else set A_induct to 3 4 b8 J L+ |( y
set A_i to 05 r& o+ q$ F8 e. j. O
clone 1 load to P_induction4 E! F+ M1 n# U
wait for A_time sec6 ~8 n) H: p6 o$ x7 D
end
+ U: b: p% b4 c" V8 eend# c; P, A& e c! R- d3 |
' {/ m$ e; i4 i5 f" e
begin P_induction arriving
" H7 S! @. k3 @) p. w$ p if A_induct=1 then clone 1 load to P_pick1$ ^: J: U6 b6 I3 h' Y l
else if A_induct=2 then clone 1 load to P_pick2) t- \' Q, H* l4 R
else clone 1 load to P_pick3& s* \( H/ K' w1 f0 |
end
# R: y1 ]- t5 C) N
5 `$ y9 r6 U) ebegin P_pick1 arriving6 O+ e) |0 R1 K
set A_i to 1
& N$ L+ V3 q& B- Y) b t E3 j move into Q_induct1& X1 V( g* }1 F) @2 E6 z8 S
move into pickaisle.induct1
+ ?7 B9 j* r% q5 d$ n! S while A_i<=30 do begin+ o V. B, ^- _$ f8 ?
travel to pickaisle.con(A_i)3 e9 y0 T9 b& b5 D& V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C2 \/ n' p; t/ f* w
else wait for 10 sec& u3 _ L% l2 }: \2 h5 J
if A_i=A_leave then send to die5 A! l: y2 a! ]" S1 }: P0 u
else inc A_i by 1/ B% c5 I# X2 _2 g
end% a+ g8 o1 |2 k9 E( j0 d- x
end
! J5 G V2 {1 J+ N- Z3 Q9 h. w
6 T9 m2 b' ]6 X6 Jbegin P_pick2 arriving
/ \0 z- h& m1 A* c! P; G set A_i to 115 A0 y& ^$ P ~& i' F
move into Q_induct2
9 D/ V; Z, i; R! v' I* t move into pickaisle.induct2) v- v7 Z! ^" i9 \8 Q2 N) W
while A_i<=30 do begin" b4 g3 i$ |; f o6 k" |( `0 E
travel to pickaisle.con(A_i)
# h% Y; W& c o( T; Q M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `$ V8 S' h. t+ S else wait for 10 sec' h! s$ Y) q( ?6 q3 M. n
if A_i=A_leave then send to die. U% z7 l% F7 E8 y3 r
else inc A_i by 17 i/ Q) m. x" o: n, x; u
end1 q( U) F: |" d: s
end
! B, m+ w: ^& g* Q# G) W ]
; h Z8 b( m1 s. fbegin P_pick3 arriving5 ~$ `# Q& j* h
set A_i to 21( [2 N" J. v! P; F- n/ C- c
move into Q_induct3
& D& Z2 x9 {/ b9 L% X& K5 r move into pickaisle.induct30 V; M3 T$ q: y; I
while A_i<=30 do begin
# M g$ Q6 Y/ i4 q; |- h travel to pickaisle.con(A_i)
4 w" J$ [1 \* ^1 o3 x8 ?" t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec z7 M) R9 w' Z8 F# G
else wait for 10 sec
0 O, q' K: p# \ if A_i=A_leave then send to die
9 a5 r- [+ n$ O: G$ b else inc A_i by 1
( j" P/ U- @* z end
# g3 ~8 ~, l" P0 L- ]9 M4 ^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,其它按你的 ...
|