|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 }+ n0 C8 G5 W& H
# a( Y. O) E5 c9 z1 ?* ]1 M3 N我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ U+ s: U l: }, S% y
: }' S& J, k3 Q9 @+ T' X: ~begin P_read arriving
0 ~+ B- U) o5 a8 k, P1 n/ U while 1=1 do begin
, f" A) o$ G9 W V& |+ W( u read A_tote from "data.txt" with delimiter "\n"# D9 ^, @8 b3 H
read A_time from "data.txt" with delimiter "\n"6 r" e; h# e: C/ m
read A_leave from "data.txt" with delimiter "\n"* `( [: X9 M; ~6 G0 `, D0 n) g
read A_picks from "data.txt" with delimiter "\n"
x+ P* e6 D; m- o' K1 _ set load type to A_tote
8 y' p# W2 K) x. {, R/ P# C if A_tote="tote 1" then set A_induct to 1/ E, E! J# {3 t- `
else if A_tote="tote 2" then set A_induct to 2
' F6 l" i# n) |( M else set A_induct to 3
5 X3 J8 ^9 T/ e set A_i to 0
( o; z: l- O+ b9 | V clone 1 load to P_induction. O# D; l2 t2 E4 m( n& e& v
wait for A_time sec
+ P9 M' Q8 y, ~7 i end- B5 J, k& a; B. M! v9 G! Y
end( r9 K' B' H/ C9 n: p n
' x3 H" K: Z( s# d' @4 J _
begin P_induction arriving8 m6 F1 L: z) i9 S) Y
if A_induct=1 then clone 1 load to P_pick1
( _9 ~' [6 g, w0 w: @" p4 J9 G else if A_induct=2 then clone 1 load to P_pick2
0 A% {/ \- V6 U else clone 1 load to P_pick3/ Y4 C" C% C3 [- o6 f8 h' l
end8 n4 _9 w- J0 h3 Z
% l# s* ]( q* W2 ]4 g
begin P_pick1 arriving; z! f5 u0 \9 E8 Z: d9 p0 o$ n5 W; g
set A_i to 1
" x* ]" Z/ |( n# C) d( k move into Q_induct1
, h5 q' U4 |% V# Y& j! X a5 v move into pickaisle.induct13 i( z, R% j7 C! j m
while A_i<=30 do begin5 F5 O, S% j" c( c3 U/ D
travel to pickaisle.con(A_i)% f6 \( H& m. a6 O) G( }0 a4 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, M$ n4 V! L1 h8 Z else wait for 10 sec& j' e* ^$ H( j. |" c
if A_i=A_leave then send to die
# f/ H* r8 H m) a# [; a5 S else inc A_i by 1- {+ n6 f5 d7 v& i1 r
end
. W9 n0 G' ~; ^% _7 A z, Tend$ ~, G& I0 y# E ]! h
; Y m0 t1 {! ] c4 Q
begin P_pick2 arriving; R# a' V/ A0 M/ O. ~4 w3 b
set A_i to 11& X2 \/ X# O+ {$ m, M
move into Q_induct2- `8 T, a% Z# w
move into pickaisle.induct2 c( Y p3 V1 d3 B/ j
while A_i<=30 do begin; c! ^4 Z7 M& c) G% N. y
travel to pickaisle.con(A_i)
" K% a( m( L" ~, G! D2 T" s( u: } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 e: O& ?+ [; V; j2 x) y3 b else wait for 10 sec1 s/ [7 W$ |) f6 O5 O# N
if A_i=A_leave then send to die
' N! P Y0 y; x8 [ else inc A_i by 1' b4 U, s J/ D
end* Y9 c9 j- t! D+ _" @& l6 k9 P
end
2 n2 a" ]/ W$ K Y4 X6 _8 m$ a& B" V$ S; m
begin P_pick3 arriving
1 ~' ]6 ]4 j d4 z set A_i to 21# f8 X$ |, Y- \- X
move into Q_induct35 S2 z0 W: @, v- g3 A& D
move into pickaisle.induct3
! A9 F" s! ^2 n& G" N( | while A_i<=30 do begin! X, o" N; I$ l+ z
travel to pickaisle.con(A_i)7 t) X7 p" f0 C. p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H% ~! [0 e! r" N1 o; V" r# _& P0 r else wait for 10 sec
& ^' D+ i; f& @' N5 _( L6 |3 D$ X) ?' e if A_i=A_leave then send to die
7 e9 l1 ]8 G: o# F- ]2 w else inc A_i by 1" U7 ^. y. Y1 a* K! d
end! E% d: W0 z% m3 [- E
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,其它按你的 ...
|