is& t) @6 L1 e* B6 @
local links,rechts : integer;
) s" F3 p0 g( Y, m7 Q! g$ hdo* \1 v7 ]& A9 Y" d# W
if @.standort.nf(1).nf(1).voll1 V3 M) t# k$ a
and @.standort.nf(2).nf(1).voll m% P Z' \, S& |
and @.standort.nf(3).nf(1).voll
: I% p0 r% H3 {/ [! J then6 S( p, k i/ [, d3 [+ x) ]
blockier_merker := TRUE;
7 f9 u1 j: L; o- P) G else
2 S# d7 Q/ l4 P% m* T if @.standort.nf(1).nf(1).leer
$ s( M7 M) f; n' f( H then
1 \( n6 s% X% J1 U& H @.ziel := "ap4_C";7 f& p9 {3 w P3 r" ?
@.umlagern(@.standort.nf(1));, h& h/ @* Y1 c$ @2 l
else
8 B/ b; M6 u Y links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
2 J8 v6 O- R/ O6 L/ b + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs & b: p. _# @7 v( Q
+ current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;+ P6 r" ~- u* R& z% \
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs 4 R$ Y* y. M9 B- Y
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
8 m, _% ^) B! S5 I6 ]' @5 J5 F + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
, P! @ ~1 `% @( v6 o: Z if links > rechts 4 x- ]" T5 C' X f9 \" J
then7 U0 V U- z2 q2 W
if @.standort.nf(3).nf(1).leer. Q P% b7 D+ l* N6 @/ V9 r4 C
then9 G; J3 Z( _( N, c( j
@.umlagern(@.standort.nf(3)); 6 T% c# w: x' j! y4 Z
else
* i. g0 ~7 L4 ~) k2 \4 } if @.standort.nf(2).nf(1).leer
g6 g4 n% W- O1 A then3 m/ P# D* {4 q
@.umlagern(@.standort.nf(2));. z4 ~' R+ r. }4 m
else% e3 w; `) g0 p" a) J1 A4 t, J. Q- r
@.umlagern(@.standort.nf(1));/ M9 l- D7 t9 z! e# h9 i3 g* Z
end;
0 C k: ?0 @" u; \ end;+ n9 I4 k2 d! {8 n9 C, C6 ?
else * Q$ P8 j+ m* K: M! J
if @.standort.nf(2).nf(1).leer
+ d* k! P- w7 l then
/ M0 [1 j; S, I! u @.umlagern(@.standort.nf(2)); 1 C- B! A1 W4 ~
else
. x# {: z! `& _5 e4 N" w if @.standort.nf(3).nf(1).leer- h& U/ u) ~! Y5 k# D
then7 t% [9 P- N+ @+ N5 N4 \3 ?$ k
@.umlagern(@.standort.nf(3));
* ?! C6 D2 C9 Z else" C+ a7 X% z+ \
@.umlagern(@.standort.nf(1));
4 h8 Q' Y; _0 ^& p9 q% @7 H+ i end;
* S8 `! k' m- _8 S6 A1 @) V$ ^ end;
) ^* X& _, v4 L5 T end; ( K5 ]- `7 f- d* B p5 u% }
end;
% m3 w5 I$ A, U" I* e! J9 j. J# P! D end;1 M# q. ~, Q5 g V, e8 @: w
if ?.leer
& S2 @- S7 F+ |1 fthen
8 W3 D& C$ d+ `8 k1 `6 O0 B blockier_merker := false;
4 ]1 u' J6 j( Jend;0 w ] e/ Y }6 f7 u
end;, \! S( ~, h/ x( f) p
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |