|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 _3 c) V6 U8 t X* R5 D8 o# U% t
9 ]* M( d# P5 Y- q. \* z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 o* W m9 ^- Y" w0 R
/ H, n, l# }0 C4 ~) u: _3 f6 v
begin P_read arriving
; G+ M! s$ d- @- u9 n2 w6 j while 1=1 do begin/ h( Z. i/ T& u! l& d1 D' G4 Z. z
read A_tote from "data.txt" with delimiter "\n"
8 d; O4 V5 ]7 _' F read A_time from "data.txt" with delimiter "\n"! u% c- ~3 a4 s5 P0 s# s- Y
read A_leave from "data.txt" with delimiter "\n"
+ G' ~/ U/ V: ?0 n$ ` D3 K& Y) ^ read A_picks from "data.txt" with delimiter "\n"
8 t4 \0 x9 g1 w9 v" K8 m# y: u, d set load type to A_tote
6 F9 ^+ h7 A- I* ~9 n. J/ } if A_tote="tote 1" then set A_induct to 1
& y$ u+ Y% h x/ d else if A_tote="tote 2" then set A_induct to 2
/ N3 _: g6 I, C0 f4 [ else set A_induct to 3
. Z5 c: V7 Z. l9 Y' Q set A_i to 0
2 D* b, I. Q9 q5 V clone 1 load to P_induction6 }) O8 ?3 ~5 l" X. X8 J% Q. {, @' K
wait for A_time sec6 |! n3 G. h9 n9 }
end
, _. u# {% {' hend& r8 q: }- u( N. G3 }
6 f2 A+ o" ~* V8 M
begin P_induction arriving% n: G6 z- P8 M! [- G( _% @6 e
if A_induct=1 then clone 1 load to P_pick1
& m0 c* C! l7 }, k else if A_induct=2 then clone 1 load to P_pick2
$ [7 a" h7 U6 s! R* `' D% b else clone 1 load to P_pick3: }1 z4 r6 ~! r; C5 w3 f" S- d
end
2 k2 `" m1 x W' |* w* Z5 z$ z; ^! D+ P" p! ~ }
begin P_pick1 arriving
3 q: {7 N3 v# f set A_i to 1
8 `8 s( E- F& a0 y" `( u. [8 i/ W/ G move into Q_induct1
3 ?1 Q, }4 @. L( s move into pickaisle.induct1. k1 \1 b/ Z( a) r& s1 [
while A_i<=30 do begin
/ E/ L( s. x/ Y* I9 p3 Z, d travel to pickaisle.con(A_i)
, l. s2 k$ Z: O; N d; }/ ?0 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ K+ n9 E6 @* r7 N9 d! X else wait for 10 sec* Q0 ~" M* I+ X0 A7 k8 T
if A_i=A_leave then send to die' T! |7 h( ]9 Q3 T9 T: p
else inc A_i by 1/ W/ m& F- }% D+ k) C! p; d
end" l+ c) @5 y$ v* h- O. W! Y# V
end
- }9 E5 v& {1 j% F( G2 U- E+ ^' W( o, w1 Y6 q& G
begin P_pick2 arriving* z, u) N) o) B( t
set A_i to 11
" |, E) O# a5 ~) f' X4 p9 P0 n move into Q_induct2
, N6 l4 V% e1 S; |8 A move into pickaisle.induct2
( `' u% w. t& P2 c' D& Z while A_i<=30 do begin
, \' \' x8 W4 S3 M+ B travel to pickaisle.con(A_i)
0 S" z2 y! H- i+ C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 N' S+ m* ~, l
else wait for 10 sec
% g1 ^7 P9 Y7 D3 k7 U P if A_i=A_leave then send to die2 d! T4 o5 i7 w B- V- ~
else inc A_i by 1
0 U8 m+ l$ p; k end% D5 W7 U! f' [2 ]' G
end
+ M3 o/ A6 o& N5 ~
7 ^) V% D( p# P& B3 zbegin P_pick3 arriving
2 f8 Q5 ^1 ?% v set A_i to 212 n5 d8 M/ i* f4 ~6 @0 T
move into Q_induct3/ p0 f. Y) [2 e
move into pickaisle.induct3
8 q8 X4 Y9 R& ]9 F while A_i<=30 do begin
) B0 A4 c c, ~4 H/ ~& j$ k travel to pickaisle.con(A_i)& K% N2 ?9 x& ^) I: w7 g' A& C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' N) L9 d7 I1 R: T; Q& d, k" Y" W( D else wait for 10 sec
_6 r, T2 n6 B& H* G* j. p if A_i=A_leave then send to die7 P& @ h) s3 D/ W. v% d
else inc A_i by 1 Y5 T7 V7 I+ `. L9 F& b
end& T! N6 `$ ?; r8 H3 K( I2 T5 O
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,其它按你的 ...
|