|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 P; U( D0 m5 t; b! O$ _) |: |$ i: ^; R: n3 i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ e8 l; R# p. q7 w( }/ T. s) T n- T. P: K2 C7 c: j
begin P_read arriving" t, {" V/ Z4 d3 T) }
while 1=1 do begin! Z5 C7 R8 ~% t& D8 Q9 {9 u
read A_tote from "data.txt" with delimiter "\n"
( P D3 R; e9 r+ O read A_time from "data.txt" with delimiter "\n"7 ?7 X/ x/ q7 a% u& w% }
read A_leave from "data.txt" with delimiter "\n"
- j( c2 r) J# d* ]* t2 W9 p, f read A_picks from "data.txt" with delimiter "\n"+ W4 l( n: l# w! i
set load type to A_tote6 \6 k: z9 C. Z& u8 j
if A_tote="tote 1" then set A_induct to 1" O- E, v1 L. w5 Z
else if A_tote="tote 2" then set A_induct to 24 @% l7 `$ x+ Y1 `
else set A_induct to 3 * s/ j! j2 c x2 \+ F
set A_i to 0; o3 w5 B2 m0 x! H$ g7 P$ k& f
clone 1 load to P_induction
0 \, O p# Q: k! x& B! X( k) D wait for A_time sec
& Z* Y M% l0 C+ e end
( b# u. Y- q4 ?/ rend
0 L5 k0 F' t( P) z* [/ F) B; W8 l) j% S
begin P_induction arriving
6 G: h: m. V; n if A_induct=1 then clone 1 load to P_pick1
7 T' k$ i: g0 g t; x else if A_induct=2 then clone 1 load to P_pick26 o! t" G$ @" f/ K5 I
else clone 1 load to P_pick3
# t0 ]9 i: f, B; n0 L% wend' o8 a: [9 a4 U
: J6 b' z9 g0 h9 s" l* Y0 |4 {+ Lbegin P_pick1 arriving
1 S6 K" k) ?3 q+ s) C( }' A( j set A_i to 1$ `8 A+ P! G! \& W5 j/ x
move into Q_induct1
0 a* B: M. u1 k4 ~4 n" W4 K9 M move into pickaisle.induct1) i+ t; f: C# v
while A_i<=30 do begin: d, b" o: |! _" J$ u X5 s8 R' J
travel to pickaisle.con(A_i)
% {: W- c. R+ x- c( Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }* B2 B9 P2 _8 M7 g3 `+ o
else wait for 10 sec
6 S1 h; Y. }8 c1 h if A_i=A_leave then send to die
- t8 \" ~" t! k( n4 s7 j6 x: K7 @ else inc A_i by 1) y; a/ h% z5 I) ~6 v# v, H; W/ j' T
end
& T& r) \' B9 b3 y) Gend
" d: @7 W$ T' G7 T' G8 {+ n2 o" ?; ^3 x/ h6 {' w- p
begin P_pick2 arriving' b9 f7 l6 A$ T" w
set A_i to 11) X- _, I2 z. t
move into Q_induct22 J5 G+ \, U' K& F' D
move into pickaisle.induct2
# d( M6 ? H9 | while A_i<=30 do begin
' r i8 }' j& Y travel to pickaisle.con(A_i)
* u' V! [8 G9 ~& W6 K9 O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 q S$ R( ?" ^& ?0 ~ else wait for 10 sec4 ~0 l' \8 I7 N/ D$ E; T
if A_i=A_leave then send to die
+ N2 t, L3 p* r+ Z else inc A_i by 1
2 S- T7 q0 G0 P) s# ~# L- b end
0 U5 K$ t: T% {5 k. [0 Tend7 E8 [. ^2 y& R) _3 O5 z
- p1 E6 A9 Z+ a! U/ }( _
begin P_pick3 arriving
* u0 k+ ?+ e) O/ f# E# y set A_i to 21; k. [ |/ \, @: t( A* l# X* p
move into Q_induct3: n2 o* j9 V; d* z) n% K& H, S
move into pickaisle.induct3
( Z8 [2 G& W7 t% _ L- J5 [" p while A_i<=30 do begin
2 h$ {1 T+ W+ p1 m/ b travel to pickaisle.con(A_i)& C7 y! U, y! P6 l# S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Y- n" N# R: F
else wait for 10 sec. `! d" V/ M) {: y% W5 f
if A_i=A_leave then send to die6 ^) o' R; s1 V: m
else inc A_i by 1
@$ @5 H- C. d, E/ l. k. H end
- n$ K, V) e/ K( j7 a1 Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|