is2 t8 e( k5 {- R, ~
local links,rechts : integer; ^% ]7 D8 S6 v( y5 N
do0 r* h1 `! D% F
if @.standort.nf(1).nf(1).voll# O4 _+ T4 E/ L( o3 N
and @.standort.nf(2).nf(1).voll
! L) d" E* S. N and @.standort.nf(3).nf(1).voll
; V: D$ n1 W. n5 ^; H1 N then, O3 A9 \; U/ O) t% b) S6 t
blockier_merker := TRUE;
5 A( P" s. P% |/ Z, Y, G: } else7 {- t1 h; H4 }6 K9 D( E
if @.standort.nf(1).nf(1).leer
5 m) P$ G# V. M8 F then( S( W9 C; J/ s$ q B
@.ziel := "ap4_C";4 M, }) `5 p% d# x$ |2 L' s
@.umlagern(@.standort.nf(1));
/ ~& G7 s. r: w5 S8 U; C4 i0 H else/ K* I- l, b7 W$ x/ q
links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
* S' |# r6 S1 d + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
* d. n0 } |6 Q# a9 d2 H* r3 |: S + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;. P% ?0 H" T4 w7 _9 m
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs ( N5 r6 ]' k0 [- {4 C' x2 F" p
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
/ I( |( o5 E; d, V; n + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
, a: o7 H2 t k4 L if links > rechts
: N, l: ?" C- i. Y3 u then
8 s& I' k9 R+ z- p if @.standort.nf(3).nf(1).leer
# G& M4 W; W' N" f- S7 | then
* y3 h% S q1 j6 [& T | @.umlagern(@.standort.nf(3)); 0 m) r- j3 [9 x r* O& T7 S0 [
else
: ]3 L8 @: ?! r1 m if @.standort.nf(2).nf(1).leer
2 d1 X/ S, @7 ^' B then
; P Q7 S+ c* A2 b& {. | @.umlagern(@.standort.nf(2));
% j% W! ], B1 ]" J+ w6 q% d6 M else
+ J$ Y: |% H- _- B9 T @.umlagern(@.standort.nf(1));
0 J% m( X Q! f1 G5 j, ~ end;
. k3 @) G4 h4 y. M7 ?% f9 e end;7 ~1 f P8 \# ~* k( W4 B3 O
else 2 m+ _. K3 P Q
if @.standort.nf(2).nf(1).leer
5 `: w* n7 S4 f2 J& s* j+ Z4 T( h( G then: `9 h* k5 n+ p
@.umlagern(@.standort.nf(2)); 2 a% ^2 R" A. ]% x# \
else9 {& ^) m* Y- u5 K0 E# t6 a- C
if @.standort.nf(3).nf(1).leer
7 c3 J7 N; l* @' d; Z4 p) ? then
: \, G; S) ?9 z7 U6 s @.umlagern(@.standort.nf(3));& D6 {4 j, t# V4 p
else
( X6 X4 y, b) o. i @.umlagern(@.standort.nf(1));
0 L$ J) @+ R/ Y end;
9 r5 ~3 f) {" g6 t% O end;
B% b, {# {3 p end;
5 x% p9 }% l8 O" w: h J( @0 x end;
0 V; [) X1 G2 f: B6 R9 [; @' s# } end;
: F2 O+ P$ Y) E. }; t- u/ f3 yif ?.leer
9 T. G$ {9 i7 z+ ^then
% T' ~& X) C @" ` blockier_merker := false;3 f8 F. \7 r% v
end;! P2 h; }# N5 |2 X- ^# w( l
end;- E4 o e- s. {& z$ ?+ O
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |