|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# c5 {# `0 p& n& P7 s8 H) c& k* A' v
6 G, }0 E# M2 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: B3 s6 `8 v9 M9 b
/ J, L$ l; f% S+ d! H: `$ n ?- Qbegin P_read arriving
- B0 @% p; s1 G) y' e while 1=1 do begin
7 v8 Z/ l4 x3 [$ E' m' L* A# h9 f/ F read A_tote from "data.txt" with delimiter "\n"
) r' p# _( M |; E2 | read A_time from "data.txt" with delimiter "\n"% O, U3 \7 S+ A- G8 j. C' T
read A_leave from "data.txt" with delimiter "\n"
6 Q( n: T$ X% N" u read A_picks from "data.txt" with delimiter "\n"
# R; }* O$ `, r' A; m+ r3 p1 J8 g set load type to A_tote
3 A8 J7 a& Y0 t0 `1 ~! g if A_tote="tote 1" then set A_induct to 1. o( e& s; X1 o. D0 m
else if A_tote="tote 2" then set A_induct to 2
Z5 z6 Q1 U5 s else set A_induct to 3
! H% I5 o! Z4 Y0 x+ ] set A_i to 0 _) x% p0 l. V8 C/ [$ m
clone 1 load to P_induction
, G1 T% f* _& C4 y wait for A_time sec6 H+ t. B2 R+ \ h* b
end
" s3 I, k4 r6 kend8 x8 \& E4 D. r4 o
- i7 T# j+ K* Y: X) ?( l$ f4 F5 bbegin P_induction arriving- d; o2 s9 S$ g2 Q* D( d6 d
if A_induct=1 then clone 1 load to P_pick15 W5 G4 i. V% A' b/ U& u
else if A_induct=2 then clone 1 load to P_pick2
; ` }! y* ]) Q/ F- S9 ` else clone 1 load to P_pick3) H6 s1 j/ G C' u* m' e
end0 [ ?4 l: }: m2 V
! I+ ]. H0 T( M& [5 O; N1 s8 P3 P
begin P_pick1 arriving
0 T7 l& @; B% N5 K) G- n! B. M set A_i to 1( D; K8 n# T4 P4 P/ ^. h3 e7 T
move into Q_induct1
" |: N1 p F( B# M move into pickaisle.induct1
$ R3 h! |, Z2 _) e; `7 v1 R while A_i<=30 do begin- s/ m. g1 D9 x
travel to pickaisle.con(A_i)
\$ n$ P8 f& A4 s" | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. n* \8 O% e' K$ n' _9 h! H# ^' ] else wait for 10 sec
9 F/ s$ D6 x( V; R; C6 s$ w if A_i=A_leave then send to die
/ P0 i# q% U7 @- O/ ?. }0 e0 N) l$ Q' o else inc A_i by 1
0 T: `5 s1 h; p: l& f- i end
) C) ?, X/ M3 i4 [end q5 e! C% S5 O# N+ Z( \9 F
/ C" V) i+ d ?begin P_pick2 arriving+ M( k7 F% V$ M5 c0 }; a
set A_i to 11, }' w) e# w f3 H0 M1 _8 D& f% W
move into Q_induct2
" w. m \% L- l# ^. t5 }0 ^ move into pickaisle.induct2, b5 r D) t4 I9 K
while A_i<=30 do begin
* o$ `+ p/ d0 V travel to pickaisle.con(A_i)
, X: ?+ C5 U) G1 T) H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. b6 c/ g. ` S- t; ], I
else wait for 10 sec- r# c( R( ?- t, {6 i
if A_i=A_leave then send to die
u: a% C [) m* z* P+ F5 U else inc A_i by 1
/ [8 D7 O) \( h: k' _ end
5 Q, X- ]4 v6 x9 s6 g" {end
0 \+ u6 O2 s+ K J1 l, v) D+ [- y# ]7 e6 I- D- B
begin P_pick3 arriving0 H- l" V6 d5 u+ z3 A+ V/ ^# |$ D3 k
set A_i to 21
1 g9 R( e' O' B% X. i! D. D, Y2 r7 g9 R+ I move into Q_induct3
' Z' {7 d3 N6 Q$ s# y move into pickaisle.induct33 N- ]0 N; S& P( X) q$ ]! p9 S
while A_i<=30 do begin
P" o4 M9 Z+ T1 c" H% l travel to pickaisle.con(A_i)
7 i5 \# D0 I5 {% B3 f7 y" \1 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 B7 s- [& X8 }( E& J" u1 ]
else wait for 10 sec
, W1 c* X% K7 B7 z8 V7 t7 f if A_i=A_leave then send to die
- C; M( n" Z$ z" [" A else inc A_i by 1
# k2 w1 F% I( e4 r end( v2 \ I+ X/ T; |: g
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,其它按你的 ...
|