|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 C$ A7 H& s( i4 ` q
- }7 `$ A5 K8 {& H9 d我的问题是,在每个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中的数值,不知道会不会有什么不妥。" n6 f3 \# |* ]* d6 t' T
0 X$ T' p/ G) d. w& a5 K
begin P_read arriving
. h( |# r5 h) g" \0 T6 n$ n3 e while 1=1 do begin
% i- l; b0 { k read A_tote from "data.txt" with delimiter "\n"
+ Q8 T. ?( j& _8 ^# h- Q read A_time from "data.txt" with delimiter "\n"
& Q. f/ s& k( h H0 X# i" | read A_leave from "data.txt" with delimiter "\n"2 B! B0 \& B6 V* I. M7 A
read A_picks from "data.txt" with delimiter "\n"
% {( s0 e# D& a* {0 h( n6 Y set load type to A_tote
0 `/ v% k; u# ]( X8 J if A_tote="tote 1" then set A_induct to 1
' n) m. I ^) Q0 c: ~" W else if A_tote="tote 2" then set A_induct to 2
! U+ I F0 s& n6 l, B7 t# j/ Y3 A else set A_induct to 3
& B3 _( {0 {+ G# H ]" F" Z1 O, [ set A_i to 02 Q, D" e, X! h) ~" A" E8 P( s
clone 1 load to P_induction+ i8 f' b z& D0 N2 G9 U
wait for A_time sec
1 O1 t Y3 b; h- l8 E7 F0 D end
/ z$ F2 E$ |6 K4 W1 W7 eend
1 l4 j, z& J( W
X; {& X0 K, X6 r9 S8 L" p Ubegin P_induction arriving
. i# I" F; l. k. _& s if A_induct=1 then clone 1 load to P_pick1
6 C$ b: k' w" y2 d else if A_induct=2 then clone 1 load to P_pick2
. a+ n! K2 ~$ @9 W) C2 J else clone 1 load to P_pick3* H" D" ~* h! ~% r
end9 x( Q* O" u# f, \- R7 h0 Q
3 z9 I9 k3 M9 ?/ L8 p" l$ w& J
begin P_pick1 arriving0 X+ w2 g3 ]6 c* O8 W& z- ~( I
set A_i to 1
+ O1 ]! d% H( N# ?% ~ move into Q_induct1
. p4 Z# ]& Z1 ^. ?# a move into pickaisle.induct1
# b; Y; u/ o" t4 i1 d3 L while A_i<=30 do begin2 i- b, a1 o$ P) G+ u7 }
travel to pickaisle.con(A_i)
+ O: r' |2 \0 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" J9 A5 T H4 K/ s9 E
else wait for 10 sec' }% c# f4 |5 V/ o% y* g5 ^) Y
if A_i=A_leave then send to die: U' x c4 N. E2 c5 T# R* o8 g- u
else inc A_i by 1* O3 ^1 s; ~7 a( X) C( Y1 @/ E+ n
end( G; q' G7 ~7 [2 G+ ]8 y
end* d! c; _3 ^1 M" ^; @
& \1 b5 D* B- g3 ~
begin P_pick2 arriving& h/ O; `( B7 C/ Z! _5 c
set A_i to 11* @% J" |( a% u. ^7 ?; x( m/ W
move into Q_induct2
. W* a- b9 ~; J3 d! v: f/ _ move into pickaisle.induct2+ Q# Z! \, c) f) B4 c
while A_i<=30 do begin
& x( ^- N- _% a9 U% P) F travel to pickaisle.con(A_i)
; f/ s; {9 L- v- G' M8 a$ a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, _9 c5 A$ G3 T& Y else wait for 10 sec
7 P/ R/ H! S8 L6 a if A_i=A_leave then send to die
2 P- |3 C# h7 W5 b$ }$ f0 z* n& y8 h else inc A_i by 1- o- k0 r8 Q A6 ]1 K8 l7 |6 j# }
end
, V) o- j1 n2 @end% Q1 d( X2 w% z3 x
- J% k( |0 U& u9 M1 a; w
begin P_pick3 arriving% q. Z; E: H6 I! D* y. ^- I
set A_i to 21
! i+ s# r; I' i; d move into Q_induct3
7 G; @5 i3 e' E% L7 G: U- k move into pickaisle.induct3
, Y4 q3 N: i( T: @5 p t while A_i<=30 do begin
! E" Z( J9 |: Y9 o. x travel to pickaisle.con(A_i)
) \) L& X# J0 N9 z! ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 G$ k' W# l& m- q; C+ N* j; k
else wait for 10 sec
. D4 j5 f* q$ M9 o1 G9 m if A_i=A_leave then send to die' y1 {( p- G5 p, B2 c
else inc A_i by 1* f1 E1 [. e5 W9 y9 u/ C3 }
end
( ]7 ]" P( T" H1 Xend |
最佳答案
查看完整内容
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,其它按你的 ...
|