|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 r6 L) z! t1 L5 G' F$ E- u6 _6 |% q5 P& \( H4 a8 k+ g6 T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 j" @5 D: F: O$ s7 |" @9 Q- g$ x R/ t
+ @3 n( {( n7 w4 E9 ]( }; v0 Ybegin P_read arriving z& d C& f. P- |9 `& {
while 1=1 do begin
1 R: N0 Q. H( U) [1 }' w read A_tote from "data.txt" with delimiter "\n"
/ v, [ t; o1 i* H T! C! i& t read A_time from "data.txt" with delimiter "\n"
3 F2 ~2 }1 H5 ^9 E1 Q read A_leave from "data.txt" with delimiter "\n"
+ _8 {( p6 G: f ^ read A_picks from "data.txt" with delimiter "\n"
7 b! y( W; Q7 [( Q7 T5 } set load type to A_tote
C2 b2 K* D: t2 }, T if A_tote="tote 1" then set A_induct to 1
- `, [5 w$ C, U* V4 F% g$ ~$ l+ K else if A_tote="tote 2" then set A_induct to 2! u4 {, O* ]/ K9 l& U# t& _
else set A_induct to 3 / a* T( |3 V, t3 {7 I0 T
set A_i to 0
8 |% D3 C/ J. D" ] q clone 1 load to P_induction
( i; o; `# E' L! C% o b2 E wait for A_time sec5 N2 N1 M- R) ~2 T$ R, p# x% P
end. F& `4 R- Z/ A7 s0 G
end
9 s, O2 B. Z; P7 b( P" \
* t) _6 n# y0 G4 }begin P_induction arriving
8 ^4 q- Q8 [+ Z0 l- a5 `- p) p if A_induct=1 then clone 1 load to P_pick1
% z0 j8 d0 `' r3 \9 @! H else if A_induct=2 then clone 1 load to P_pick2
. m4 q9 W; X! l0 n0 X8 h else clone 1 load to P_pick3
1 ]- g: C+ v4 Z' N/ z" j6 R0 ~end
" {! d0 J6 S0 @( C+ d' J6 `/ l2 W( q) \6 v6 b- b" y! D1 G, n) U) w' ?
begin P_pick1 arriving+ h5 n5 {% N0 t0 l* x
set A_i to 12 ^" X& Y+ K) V
move into Q_induct1
- j6 L# O, U) q+ U" N+ u. j4 C move into pickaisle.induct1
4 `% l3 K" `# L% u, K" f while A_i<=30 do begin
: s$ m5 n) n2 i( f9 K# L3 R) p8 G travel to pickaisle.con(A_i)
- y. \9 |) h9 I- g7 m* t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [+ B: B _6 V" \" y* j
else wait for 10 sec, b8 V; O" T9 f# t% X5 o! n
if A_i=A_leave then send to die
9 B, Y! N5 _9 s7 v/ z else inc A_i by 1. J+ O3 H9 d! D5 g3 a' m
end5 _& u# p# e6 ?8 o- |
end
3 v. l8 G$ |" a) ~$ j: L9 _
' O1 y' d: F+ R8 J! i$ T2 g9 P3 dbegin P_pick2 arriving
& R. k# z9 u6 W7 D( w* ] q8 k set A_i to 11% v( t/ h1 ^0 M+ r# ?3 c
move into Q_induct2
f8 X3 T5 v" @# V% O move into pickaisle.induct2
/ }; n1 X3 k1 K7 z" b9 K; D9 t while A_i<=30 do begin
# ]/ R& v; Q2 B travel to pickaisle.con(A_i) n: g) ]6 k$ Y0 x9 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& w1 F9 U$ W# f5 I* J
else wait for 10 sec4 y Z& Q' R" a9 h9 E( e( r9 f; o
if A_i=A_leave then send to die% ]# P( E! _# K! r8 x! t) ]
else inc A_i by 1
$ o' X* [; z' X9 y6 T8 a( E4 z" h end+ b( R/ F' {: d# |, ^* d A- Y
end
# ~7 b1 ?- v, ?& o
' Q6 p5 Y* ^9 D7 k" y" H! Dbegin P_pick3 arriving5 P% h2 u: K; o0 \
set A_i to 21: B& @5 q3 m% b+ d
move into Q_induct3
+ K6 u3 T8 o/ o; K/ {5 u* F8 Y# i move into pickaisle.induct3
( Y# l% @! k! o: I5 d while A_i<=30 do begin
1 {' s2 _' s5 ~: d M8 w7 `: z" E travel to pickaisle.con(A_i)4 N$ ?# f& e+ e8 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 }. i& C# ?/ o# i: d% J else wait for 10 sec
) m* Z" Z- S( ?! b if A_i=A_leave then send to die: S, ^1 R/ I6 l' k$ b5 t! C: |
else inc A_i by 11 M# D" N8 T4 J8 |
end
$ e+ B5 C0 ^% O' z- w/ iend |
最佳答案
查看完整内容
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,其它按你的 ...
|