|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 v6 P2 d# O, J+ [ w) Y, @! |' \
! b j, M$ a" H0 m, `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& Y/ X; Y" l! T" i: F+ Y) ~# `: G, G$ o+ z' j* a6 A& H$ k
begin P_read arriving
7 I1 X3 e u7 D2 E9 {0 s" C while 1=1 do begin; K6 R( ?* C: k0 o* k+ Q
read A_tote from "data.txt" with delimiter "\n"& L" E+ H4 F' K4 a/ V$ _3 h
read A_time from "data.txt" with delimiter "\n"
6 u i$ j. M# j- ~0 |* B read A_leave from "data.txt" with delimiter "\n". I3 l" ^. Z3 Q9 t( Y( x( ]4 a
read A_picks from "data.txt" with delimiter "\n"; C4 R' x& |+ y$ Z& I* z
set load type to A_tote2 c* T) F8 W) `/ `
if A_tote="tote 1" then set A_induct to 1
! \1 L4 n. R2 Y/ l M else if A_tote="tote 2" then set A_induct to 2: w& s; ?" ~' i
else set A_induct to 3
- ^: G$ \* ~1 f" c4 |7 a" X set A_i to 0 p) E0 H: E$ t6 Y
clone 1 load to P_induction/ y% u3 E0 N3 y7 ]* ]
wait for A_time sec
: S5 d& E' [2 y' B3 O end
5 p1 y L" ?- [! @end
4 Y7 i2 _. W% b8 h/ w; W( |# F
3 k. H7 A( H. B: q+ [begin P_induction arriving" L# N; F4 g1 w4 P9 i5 ^
if A_induct=1 then clone 1 load to P_pick1" x) m$ P# T4 S5 b
else if A_induct=2 then clone 1 load to P_pick2 O6 ~7 D* d3 K0 \6 }4 {1 P
else clone 1 load to P_pick3& g2 X' U d1 i) Z6 y9 P
end
/ r& O t T) O3 G' r, D! D- E( a+ t' l8 |- S
begin P_pick1 arriving" P# P% Z& W# ] a0 j
set A_i to 1' X6 B( j+ p4 k, \/ u+ t) P0 J, \
move into Q_induct1& B- F, I m1 I, G: Y& D5 q
move into pickaisle.induct1
% z) `! |& M2 @ while A_i<=30 do begin; S. A3 p% c& z( G) w) B5 { M" g
travel to pickaisle.con(A_i)
" a6 }- ]( l1 P7 {8 T2 D3 g8 S; c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" O" d% [/ M" _4 p- c6 C. ] else wait for 10 sec
% E/ Q! l0 f* q! n+ @/ K if A_i=A_leave then send to die! t( D$ u2 W7 U3 J5 @' K5 A
else inc A_i by 1
( c: Z4 x! f- [' z9 g$ c7 ] end
1 \/ d' q2 @8 U9 xend
) ]: f0 n) B0 F Y- d( n# o% B. W
, Y/ \3 V3 U" m% L. s/ Mbegin P_pick2 arriving
2 q7 U6 J/ k: J6 @1 _) L, f( t; e set A_i to 11
+ r. l5 e' Q: U5 w: q move into Q_induct23 [5 |/ U8 O) u1 f" u/ g
move into pickaisle.induct23 i8 n; s6 V- e# D7 v# H3 Q
while A_i<=30 do begin: X' _, N) c2 o: S* f- n
travel to pickaisle.con(A_i)# o3 b' a, n' |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! n2 d1 q* g( r
else wait for 10 sec
, m, T7 D/ G! G if A_i=A_leave then send to die% [2 u' D2 ^& _2 V8 R9 L% a, G" Q
else inc A_i by 1
( ^+ C. r% B% d$ G end. E7 d: W! L; ?
end
, X: k$ K+ F5 M2 f5 S; w' ^2 S2 x5 u I3 b
begin P_pick3 arriving+ Y9 A( A1 c0 i( s
set A_i to 21
. l3 G3 V* x+ E* w% s' U move into Q_induct3( t/ m$ t" d, K0 K* G! P: G& G
move into pickaisle.induct36 i$ |* k- }0 q1 M
while A_i<=30 do begin+ n2 ^- D2 V5 d* T
travel to pickaisle.con(A_i)+ p) K- Y0 f( u. ?4 O* x5 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: O) D: Q' h' `& v% f else wait for 10 sec5 G! A: o; Y3 p: W4 V4 r
if A_i=A_leave then send to die/ r: @# e$ B4 s- E
else inc A_i by 1# L, I6 R$ Y" l0 p) ]- ]0 G$ |
end
" Y. l+ E( o4 R/ u+ f! 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,其它按你的 ...
|