is4 o& ?, V* w& @ b: }; S g! u. t
local links,rechts : integer;
0 l+ d* t {* V% ?9 f: }& q" ado7 Q7 v8 ?- ?& v4 R* L, D2 f
if @.standort.nf(1).nf(1).voll
2 Y( d" Z$ v4 D# i! S and @.standort.nf(2).nf(1).voll5 a; ~7 G) H0 z. F, y! I% _
and @.standort.nf(3).nf(1).voll
! f' u9 x4 Y# L+ `: o x! o then
) [* U* w/ _4 h0 c b8 s blockier_merker := TRUE;
: p- _3 g2 g) B6 a else c; A. F$ j6 Y" C' s* P" ^" h7 ^
if @.standort.nf(1).nf(1).leer
- o% A# `' ]! V* Z" } then
/ |- W: m* b) W- G# y4 n @.ziel := "ap4_C";
7 I0 z+ e1 q; V0 o" [: N/ ~# z @.umlagern(@.standort.nf(1));
) { Q# L( v" A; P. F1 L else
# h9 N! ^- S: z& K7 T" d$ r links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
( ]8 ]" v0 O. A# L/ r7 K" P + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
, O7 {. f% A! M7 U5 A + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;
$ n* H9 f( W% t) x! r; H( n" K rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs
C. D% q/ ~3 k9 W' r + current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs 3 E6 F' @0 f/ O* P0 X4 q; D
+ current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
5 L5 ^5 T' t6 E$ i if links > rechts
5 F0 M8 a i( x4 Y3 Z0 ?+ ?' y0 x then
3 D& q; z/ ?, D) b: C* B: T if @.standort.nf(3).nf(1).leer
/ b$ x: d, _' C* c& @ then
6 ]3 q0 |* U7 r6 R, X' _0 T$ r @.umlagern(@.standort.nf(3)); # \# F3 S) G. X. l# C1 S/ ~
else% Y, @4 H9 l* F0 J# y/ k+ ~
if @.standort.nf(2).nf(1).leer$ |4 [' }' V8 d2 V
then' j: c: s+ S9 K4 ~+ y" L
@.umlagern(@.standort.nf(2));
" A5 D. ] a5 S6 L+ I3 m else
7 _/ K. y% x- [ @.umlagern(@.standort.nf(1));
8 H% D- E4 W' I end;
$ w; H1 T" v' v) J2 P8 ? end;
; ?# U0 ?& G8 h9 g7 A) y0 d else
8 E1 ~' ]" u: g0 d3 Y' S if @.standort.nf(2).nf(1).leer
, }( z8 h! p8 C then
$ N8 @6 m5 x4 x6 j" s @.umlagern(@.standort.nf(2));
0 q( A7 V) ~ q3 _- I* P* X& g& F else
. L; ^. ~5 j1 E% P% b# l if @.standort.nf(3).nf(1).leer
& D/ r' w" q. p) X; y: r then$ @) N1 k. T) t& q% h: l S
@.umlagern(@.standort.nf(3));
5 @) p9 `1 ^% c' F/ r% a; @* l) U& L else! _4 M! B, f; }+ ?& O: t6 w V
@.umlagern(@.standort.nf(1));! P0 o0 a3 e& X7 V
end;
3 `3 N. ~: V! v! }. J$ u end;
, H5 Z8 Y" a$ F- o# `/ x% i( p) S end;
$ {1 Y% A5 h: o end;
, f/ V/ r0 {3 C" d; F* [ end;0 r6 a& c( T" T
if ?.leer
8 m# ~) e$ O& {/ Sthen
8 A3 D) i' G0 h8 ^) A) [ blockier_merker := false;+ v' O+ ~9 ]1 N+ w8 x7 q
end;% J4 f# x" v: k+ w: |# S( Q# N! A; x
end;; g& v6 V% F1 p
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |