|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 I9 p3 E5 q2 A' I l
6 p0 C# W* W2 L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 Z$ d- F6 N6 J+ h m" S
! @) w! X: d; pbegin P_read arriving, C* Y/ @: {' M3 Q' |
while 1=1 do begin8 M+ N2 B9 z' R6 L# P+ t
read A_tote from "data.txt" with delimiter "\n": {8 b1 R' y1 h1 A6 @1 t9 n" J! m
read A_time from "data.txt" with delimiter "\n"! x( R6 v& B. E( b( \0 u* m
read A_leave from "data.txt" with delimiter "\n"" t( A3 q) x5 m4 [! e1 @8 P u
read A_picks from "data.txt" with delimiter "\n"4 o: n9 {' |$ ]2 G0 A R2 I
set load type to A_tote+ D7 }# E% ]* c$ z" @; M* f# X y& t
if A_tote="tote 1" then set A_induct to 1
8 G& Y* Z U- y! w6 n else if A_tote="tote 2" then set A_induct to 27 `, J( Q l1 a( x6 `: U
else set A_induct to 3 ; `* j# [, ^* f2 G
set A_i to 07 R# V: H$ }1 f4 l6 q9 k; J0 a7 L
clone 1 load to P_induction
+ |4 f( e2 U G% e+ q% f2 Z. e% T wait for A_time sec4 W3 R& u$ X+ M& Z( M. G& `
end
* q' r0 K6 w6 c" Oend0 K# ^' z; j. D. r$ Q5 c" ?+ ]+ N' o
) n; r. m7 c; @
begin P_induction arriving5 D" G* M' h: P n* m# k1 i* \
if A_induct=1 then clone 1 load to P_pick15 j: e6 A4 P3 J" w- w" p
else if A_induct=2 then clone 1 load to P_pick29 f& Q7 u6 j! m* z7 Y! ]7 n
else clone 1 load to P_pick37 R$ |8 S% ^! l# q/ Y& t
end6 x* K4 Z- T5 a- e, Q+ r1 T+ D
+ r/ X$ T! [# M7 h* Xbegin P_pick1 arriving
2 y: B, q* ]+ K# g set A_i to 1$ F' J3 ^& K; c
move into Q_induct1
4 l* X* |- W% Q: i9 V% s+ D) m* y move into pickaisle.induct1
. ?( o! v- ~7 \, Z* r2 k while A_i<=30 do begin6 s% P) {) w# D! d
travel to pickaisle.con(A_i); Y% x$ U( g( T+ Z" w, {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, H7 E/ P# e$ ]2 Q- V& B
else wait for 10 sec
1 m3 p7 t+ P x0 i if A_i=A_leave then send to die
5 X ^% L/ N; v. w7 [4 } else inc A_i by 14 k8 {6 e& J! |9 X2 M, q6 s5 X
end
) Z% |% Q+ o0 \" ]) @$ xend) E( o' r y+ @8 U9 X9 B$ V
/ r( D( `2 c% L5 R; h* g+ o6 Y9 b1 Sbegin P_pick2 arriving
/ W, m) _0 A8 t, y; u set A_i to 11
5 x* w4 k5 ]- O move into Q_induct2
# J, x- n7 e& ~6 Q2 J move into pickaisle.induct2
* Q* u2 f" e8 a m" H9 B* g while A_i<=30 do begin& }) _' m' Y$ X
travel to pickaisle.con(A_i)0 l3 p- M/ m* z9 u3 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F/ }' R7 G( m
else wait for 10 sec! P8 C1 [( r3 \7 N6 Y4 B- t
if A_i=A_leave then send to die
& l! x- [# U: X+ R0 d$ t else inc A_i by 1) d4 `' H9 W0 p6 r' s+ s
end
7 G0 @, P/ C3 Wend% Y" ]2 p0 n& }3 \9 ?4 C7 F
; X( t+ \! a0 O$ gbegin P_pick3 arriving
) \2 _- G3 l+ `; F/ j; e- A) b set A_i to 21
+ n) A" `% D8 N6 }1 [: i% @( J move into Q_induct36 g% p" w1 T- v, W' Z. v
move into pickaisle.induct3; E3 x0 ^6 P% D
while A_i<=30 do begin+ {3 t7 r9 W- C5 x
travel to pickaisle.con(A_i)
/ ?$ B% o" r7 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Z/ `& A5 l7 c, V2 h/ z5 h' _ o/ Y else wait for 10 sec
/ _1 a! T- e* G4 b if A_i=A_leave then send to die
. U& o9 @8 g/ K- Q else inc A_i by 1+ C& i! y0 t& e' T ^* c
end
4 y" s6 X8 l) G. G0 Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|