|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! ^4 q5 J& m8 i: p6 W
# j x2 M; x6 f8 @4 f1 g我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ m0 v/ m% h* Q* u1 Q" j+ I$ A7 i& p4 w0 w
begin P_read arriving
/ \- W* O/ K( x; Z while 1=1 do begin
2 s2 o) V& }+ \. z read A_tote from "data.txt" with delimiter "\n"3 G9 Z) J) x- }0 i& R9 p8 l T6 A
read A_time from "data.txt" with delimiter "\n"& y0 k. T3 @! P, E q) x# i3 O2 H' r
read A_leave from "data.txt" with delimiter "\n"
4 G/ r4 G6 c: Q- G3 j5 l o read A_picks from "data.txt" with delimiter "\n"
. S- B2 n6 h5 R3 J5 i set load type to A_tote X) w$ y# ^+ S% g; p
if A_tote="tote 1" then set A_induct to 1
1 H: m* L6 O$ R$ b5 z3 R. F else if A_tote="tote 2" then set A_induct to 25 Y9 a! r( }3 o$ e
else set A_induct to 3
/ M3 |6 S+ w7 G* U set A_i to 02 Y& d7 A* \( g
clone 1 load to P_induction
7 \5 D" @. Q9 X* W! D( a! @ wait for A_time sec
$ |2 _* a! B0 K/ {: M2 T end G" w K ? [& Z& _. Q% t6 K
end; k S! j2 d5 e, z
6 @. n2 E* m' B P' |5 h: F1 [. ^% \9 A
begin P_induction arriving5 }$ s. L3 G, @
if A_induct=1 then clone 1 load to P_pick1% }7 o" O2 q1 f: S# }1 P
else if A_induct=2 then clone 1 load to P_pick23 J+ F- J7 ?! U- ^( u2 V/ x
else clone 1 load to P_pick3
7 G) G' `, y: Tend8 @# |2 ^2 u; f' w! B) s
9 f6 a1 x; ^; Y8 hbegin P_pick1 arriving* D* `% J0 Q9 B+ I; N! s, e0 _
set A_i to 1
, J' F0 i3 h" N: i0 K9 i move into Q_induct1, j' w9 _; J- m9 i
move into pickaisle.induct1) [9 \# r. w2 @9 S
while A_i<=30 do begin4 Y% [5 i0 F' E5 L- i& s
travel to pickaisle.con(A_i)
% f8 k( w/ G5 S. v2 z0 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 U9 S/ \4 b( H+ W: a6 q- W0 P! q else wait for 10 sec$ X) M2 W3 @* ]4 H) j. o
if A_i=A_leave then send to die
" B' T& n! F/ i- P7 ? else inc A_i by 16 a: X) E. \. N1 ~6 F% w
end
& ?# p( Y: s9 j1 lend
7 p' `0 x2 U+ m% k* x& |8 h3 \, M/ |0 n3 q+ [5 A. G* M
begin P_pick2 arriving. `" A$ X! C' C" L5 R. W- @( [
set A_i to 11
/ p3 X' L' y ^- ] move into Q_induct2: E& v4 z4 o& ]) n3 U
move into pickaisle.induct28 t) p+ J, F( u" i
while A_i<=30 do begin. [& P' n! S8 Z/ v5 g O& T! a
travel to pickaisle.con(A_i)+ X0 ^% H0 C% W y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; L H5 F8 S1 M5 C1 P8 ]+ W9 L4 M0 V
else wait for 10 sec9 R( `( s& n: e3 Z
if A_i=A_leave then send to die# r6 Y6 j: w7 ]; h# V
else inc A_i by 19 Y$ b9 q, u; X* X* s! `. R U# R/ Y
end
4 P6 f5 h4 ?& Y% E' s% I/ {& K$ }end; r! c5 R% r- l$ G: A
; y. s' |! L5 d% H/ R0 Gbegin P_pick3 arriving$ K5 e! e- K) w, ]
set A_i to 21
8 O7 W8 A/ e F6 ?' M move into Q_induct3
1 r! P) Y5 G W" ~- \! {( J2 G. `+ ^ move into pickaisle.induct3
+ T: e" A+ X5 r9 W5 _ while A_i<=30 do begin
4 S* F* j9 C, x travel to pickaisle.con(A_i)
& Q6 n$ l; \, l: C6 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. c& \& u9 p6 |* s I4 S" U" Y
else wait for 10 sec+ t& H1 J$ z6 C
if A_i=A_leave then send to die/ v8 F7 s# \. Q8 y7 O8 N
else inc A_i by 1
& a% b; ~" I" e3 i4 ] end
3 N0 b& q; Z% R* _' rend |
最佳答案
查看完整内容
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,其它按你的 ...
|