|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# J! x9 b2 `/ i: c' E/ ^) O0 `2 l* L9 n3 C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. }0 W1 C' x4 R [7 F k' j. \, R. U5 i& ?/ ~& U2 A2 {
begin P_read arriving
0 H8 @! o2 G+ G' C" x6 ~ while 1=1 do begin/ x1 l/ I- R3 B/ U) r6 Q
read A_tote from "data.txt" with delimiter "\n"
' ]5 @/ T6 f) A read A_time from "data.txt" with delimiter "\n"! B5 ?0 ?9 ?$ m. T
read A_leave from "data.txt" with delimiter "\n"
g1 V7 Y7 E" T$ f+ Q' Z. S e read A_picks from "data.txt" with delimiter "\n"
8 x( e# G; s5 S8 X set load type to A_tote. Z9 I q- g* ?* Z' t' N. o& @7 B. T2 q
if A_tote="tote 1" then set A_induct to 18 h( Q U; W' E
else if A_tote="tote 2" then set A_induct to 2
+ e/ [: ? a8 a: g! y( }8 q else set A_induct to 3 2 U- e; P% l3 z8 j. P# |# O
set A_i to 0
- c% L9 z2 W& f7 T7 a4 W) I+ M clone 1 load to P_induction9 O! {6 s7 S0 U5 J! w: S' C
wait for A_time sec: v5 W5 M9 H& |7 o1 T$ Q
end
/ U: j6 _+ C# _$ a' Q' m+ [end
P! F; O- ?2 C( t7 |& c" J6 Y5 K7 h4 C8 ^
begin P_induction arriving) T) m& j; Q* P, F8 A
if A_induct=1 then clone 1 load to P_pick1, o, F4 X6 b) V* K
else if A_induct=2 then clone 1 load to P_pick22 k$ r( T, ]& D9 g
else clone 1 load to P_pick3- Y& n+ }" s$ I- E+ g2 B5 T
end
5 `0 g& i) W9 d, @- E, a2 ]: F, } ]2 j
begin P_pick1 arriving
( z- ~" P& v% T: k3 `2 ~# m/ j& e set A_i to 1
, P9 _/ U8 A- D) l: P! f6 u move into Q_induct19 ?. C1 B1 h8 _( L [: b* p9 c
move into pickaisle.induct1
) t) X& w0 m8 D/ {+ L while A_i<=30 do begin2 r. I" F6 Q2 j( ?# X
travel to pickaisle.con(A_i)
: L& {! ?& T# Z5 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- M/ z% K/ E& m+ Y! k9 }, Y9 s; J' ` else wait for 10 sec
# }0 X0 Q; x `5 ^# D if A_i=A_leave then send to die
5 l" y& k( Z- f else inc A_i by 1
, v O9 t) S% F" g5 p end
1 [. y( x' s/ K; mend. H4 A5 z) Z: Z+ ]6 }! V
9 r4 m3 z* u2 v' m
begin P_pick2 arriving
9 P( x5 L6 a% w, H, R8 ]; m$ w3 P/ u set A_i to 11
; o3 e5 c/ j6 X+ b: Y move into Q_induct2% {) C+ k1 I! a. |& X
move into pickaisle.induct2
5 l- i- n5 f6 E# i/ N# t v while A_i<=30 do begin
; K8 I8 a/ \+ O! d! X1 e; Z travel to pickaisle.con(A_i): e& L$ P3 h, p& X$ V5 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, Q8 R. y% k" y% W& K0 v else wait for 10 sec
6 ?( g! E% p2 ~! z: D f- D+ F3 M1 ] if A_i=A_leave then send to die% m. c( G. | R, ~
else inc A_i by 1
/ @# h! q) ~7 A/ i end9 b0 {3 B' ]1 Q: K, h q1 n+ `. r
end; o8 J) z$ `# ~9 E8 F$ \3 `% z. E
) I9 V! I. |5 A, L8 Mbegin P_pick3 arriving- p+ n$ d6 c ^& x0 B3 C
set A_i to 21 w) @* }/ b3 I+ L4 T
move into Q_induct3' S& u# ?: S6 T) a0 z# ~
move into pickaisle.induct3
* k$ z8 d1 n2 [% \' o: L n while A_i<=30 do begin w0 p9 v, N6 \, [0 J
travel to pickaisle.con(A_i)
1 ^$ z/ a" F6 p: X$ C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 i- k6 w% c2 \! w& U- Q5 b5 } else wait for 10 sec- r8 ` ~) i) m; k' {- [
if A_i=A_leave then send to die4 r" D" O9 d- Z) j
else inc A_i by 1
4 h/ ~- u1 D1 c! k) M7 b$ w end
7 a8 Y& t7 w0 o9 m& \1 J* eend |
最佳答案
查看完整内容
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,其它按你的 ...
|