|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ p! i4 ]0 ^, J% F: z2 ^% |7 g9 E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! F1 `1 g: g8 @- ~0 X! E; {8 L
( n. c/ k9 g/ s9 n2 {# l4 C" Ibegin P_read arriving
5 t' s7 J1 X! I while 1=1 do begin2 }$ Z, I* _. s. z1 E
read A_tote from "data.txt" with delimiter "\n"' P+ [$ U8 a2 V9 W: ^
read A_time from "data.txt" with delimiter "\n"
, l% K7 I5 ~ u% C# h" w read A_leave from "data.txt" with delimiter "\n"9 b4 k2 S/ [# k+ ]
read A_picks from "data.txt" with delimiter "\n"% A" F( i6 r$ S# U
set load type to A_tote; f+ i9 F4 S0 b9 I4 t7 H: |
if A_tote="tote 1" then set A_induct to 1# b, i4 `7 { _( X+ [; Z; X# h
else if A_tote="tote 2" then set A_induct to 2
2 p* q6 z) e4 U W- F3 k4 {3 F. H' b else set A_induct to 3 & Y. t# o# N7 g1 p# |! j8 X
set A_i to 06 f3 K1 R+ P: o4 E7 p
clone 1 load to P_induction( K* j* o: _9 R: i/ `; j
wait for A_time sec* c/ V4 ~+ Q" @
end9 B! ~* S5 @$ ?" J: b( P
end
( D4 v. k; c% u/ o0 e4 J( O: T( P( r5 T/ ]
begin P_induction arriving
" K- D$ [: Q5 T, r4 s2 m$ r if A_induct=1 then clone 1 load to P_pick1) t8 S- {( x* G6 U: m- X: ]; L! Q" c4 x
else if A_induct=2 then clone 1 load to P_pick2
7 x+ a# e3 Y. B# B5 K) Z9 u else clone 1 load to P_pick3' ~" |3 G4 m- Y4 W! x# {
end
( ~' | o( h1 I) F8 ~& r! `/ u; q- c0 Z# g) j
begin P_pick1 arriving% [% x" n. ^/ _/ @" y
set A_i to 1
. R Q3 Q5 E* W) S- Z' ?0 k move into Q_induct1$ H& `1 @. ?4 p3 f
move into pickaisle.induct1
& i$ M! ^7 K% O2 V, D while A_i<=30 do begin
4 X9 k, Y) R4 }6 j2 K' N" ` travel to pickaisle.con(A_i)/ g8 E2 T/ X, z [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# U( n3 p P$ f* r
else wait for 10 sec
" D. M5 ^- W* [! ~1 L if A_i=A_leave then send to die
- R% u7 l1 B: m8 C else inc A_i by 1
5 Z: a% b' V8 l1 B) b4 I. f6 J end
/ U% f6 Q6 L6 ]- \end
& v; @2 O) D! q1 }7 T1 t3 h5 ?' X- e. b* E6 |6 \
begin P_pick2 arriving
- N3 Q' ^' n9 G; U" P% z6 \& o set A_i to 11
( K. }% @' y+ K$ U# Z2 h5 k move into Q_induct2% h0 z) c6 r% T c
move into pickaisle.induct20 J7 G O! d" n* t
while A_i<=30 do begin9 S7 x5 L% {$ e7 `8 s
travel to pickaisle.con(A_i)
; z) M1 X% d0 H( Z7 K% T' n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* z" z( A& }: \5 I! ^5 z4 A: R
else wait for 10 sec9 L/ Y8 o2 c7 N' m z
if A_i=A_leave then send to die
: P, b3 p k/ ?1 E; K else inc A_i by 1, e: B3 S! x9 t% G
end
1 ] j. d# U0 W1 r: e, @5 n% k k; Aend
; V( q/ @2 g4 ? B
5 S$ Y4 x0 d) y% L5 M. @2 R D4 ibegin P_pick3 arriving8 P: l, m% h& `9 B" ?6 Y- v
set A_i to 21
- V; @& C2 ]+ g8 Q) ^ move into Q_induct3. D( }) A/ z }5 B" ^) F6 I
move into pickaisle.induct38 f B. o" o1 O0 l0 d& [
while A_i<=30 do begin
$ d- _ Q" x9 E. ~0 j travel to pickaisle.con(A_i)5 v8 _9 h% z; \: k, }9 T$ o# q3 W: x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( m, o( z& E" j! p else wait for 10 sec% N7 V1 s& T% I6 y1 P$ ]! s, [. B8 W0 K
if A_i=A_leave then send to die
) s, G# W# s: s% N, Y ~ else inc A_i by 1
! T/ {& o/ O2 {5 e end" s% B) T: I7 c7 K# {- v
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,其它按你的 ...
|