|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 G( ]5 ^" e/ ]" V. A, ~7 }$ l$ X {9 P; M0 }* B; C2 a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' G3 b7 n5 l4 [, a3 V Z- F4 ]
% H% U( \/ L! o+ }3 e4 W) c% `: S9 \begin P_read arriving
* r. r( {4 A% V! [& t) C; F while 1=1 do begin
6 J3 X- ?7 J) I& k+ a read A_tote from "data.txt" with delimiter "\n"& x- \# |4 z$ p1 @1 x X* X G
read A_time from "data.txt" with delimiter "\n"% C3 E5 A# Z2 {" X5 ^1 x7 R
read A_leave from "data.txt" with delimiter "\n"( T, D) \ ]2 o9 L: z4 j* T
read A_picks from "data.txt" with delimiter "\n"4 r! a1 ]4 B a8 t' s5 q- h
set load type to A_tote5 g; W" R% k1 M+ l; k
if A_tote="tote 1" then set A_induct to 10 l) P, t! m5 l( `5 K' r/ G3 }* |- \, ^
else if A_tote="tote 2" then set A_induct to 2; h2 F2 f) g* z
else set A_induct to 3
T# X1 w3 b! I( A, p0 V set A_i to 00 R {/ m- e0 v: U5 |+ I) ^! a
clone 1 load to P_induction
, `! l( x& M9 V& D7 n wait for A_time sec) A7 Q* L9 d8 m4 Z! ?1 i
end( B, }0 S$ a2 g* o4 p3 X
end
* @& e w6 ], Z' R; p5 w& F a
% G2 C5 [# P+ Ybegin P_induction arriving
( Y1 |1 u C7 E if A_induct=1 then clone 1 load to P_pick1
}7 L$ K: L+ l E7 Q4 | else if A_induct=2 then clone 1 load to P_pick2$ ~$ H/ I8 s7 @
else clone 1 load to P_pick3
* R* K. V. q9 K) Aend
; }1 a0 U1 v9 g, g. }4 \" J. _5 \1 ~3 k+ m8 R/ v
begin P_pick1 arriving b- a( x. e$ V3 t4 l/ T% c5 b
set A_i to 1
1 J5 z& n* @$ w5 p move into Q_induct1
/ ` C( P2 G3 M! ? move into pickaisle.induct1
+ E5 {$ V) T2 {! J+ m while A_i<=30 do begin
- \1 i# b5 G& r6 e+ }7 J# [ travel to pickaisle.con(A_i)* _+ ^2 @/ `9 ]/ _ d( n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' p" y9 ^5 x: E' T! v4 d
else wait for 10 sec
$ d2 D( N0 G- E9 z; v x if A_i=A_leave then send to die
( w# m' I, j1 u0 n. v' C else inc A_i by 16 o/ s- \! b+ G
end
8 s- b1 z) h7 _end6 u1 \# Z+ e; v: u
* `3 O3 U( D6 P- F3 Z& l) I
begin P_pick2 arriving& b) |/ \4 h; Z
set A_i to 11) J* ~8 y2 D: E6 }: y
move into Q_induct23 [1 H# w3 n% L7 \, W% \* Y
move into pickaisle.induct2" `- o/ Q$ M% R, l. F* o$ u
while A_i<=30 do begin: P3 b O$ A$ m; T7 H. D: u; R
travel to pickaisle.con(A_i)
. w% K% x% P5 ^: p9 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ k$ s1 Y2 t) C2 L/ i else wait for 10 sec
# h7 M. b4 X: e2 R y/ y$ g9 S if A_i=A_leave then send to die3 L. o' a7 ]( R# O% o
else inc A_i by 18 x; e# ~) N7 x# q4 }: j$ ` R
end
/ g8 _# A3 o) L7 g$ p+ \end
, t: y% G: G! f) @ t( {
* m) I0 C3 K; I, w: z5 k, ~0 Ubegin P_pick3 arriving; I2 U7 h0 {8 j# t6 X+ H( r: _ {; P
set A_i to 214 l0 K" i( X) T
move into Q_induct37 n! N6 c5 L0 p W) ?" F, N' \
move into pickaisle.induct3
1 m2 b7 e& i- n8 a; R+ Q4 q; H, u while A_i<=30 do begin0 A* G' C1 ^! a5 t5 y! U h
travel to pickaisle.con(A_i)* J' q! b* t+ x x6 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }4 }! o* ?' ~1 T else wait for 10 sec
# q9 ?0 v' f2 y3 ~/ m9 d: e if A_i=A_leave then send to die) n; Y9 i, `+ g1 L% ]8 Z3 k
else inc A_i by 1
( u! T/ U F) {" a! [5 W end
3 Q4 h/ y/ t6 Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|