is3 l1 g( O# `0 z! b I- t7 g
local links,rechts : integer;5 Y+ o) }0 K' P
do
* s; @' ]( e* O* f9 V6 Z if @.standort.nf(1).nf(1).voll
9 a; e2 j0 @" x) r0 R, C and @.standort.nf(2).nf(1).voll) Z9 S8 C- \9 D8 ]0 M5 \
and @.standort.nf(3).nf(1).voll
" x# Q' d. W6 v9 \2 G then7 k1 \' |. [, G
blockier_merker := TRUE;; D! |" Q6 A1 C- n3 d
else
u# o! e7 g/ |) C& j! |3 B if @.standort.nf(1).nf(1).leer
V# D3 {' i' b1 z& O7 @ then5 Y6 Z0 l4 w1 U. g9 Y
@.ziel := "ap4_C";
" F6 R% h# O2 S: ^. b3 f$ | @.umlagern(@.standort.nf(1));
( i5 c1 q- R0 o. J8 C else+ m$ U& M0 ~5 G8 S, }( D% ]9 I7 x
links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
$ h' k; ?; o( |1 v% }! p + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs ! F4 D0 f( I# j T
+ current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;
( g/ l- \/ W. P: o5 W rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs & c* h) L [# u9 x6 I
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
+ n, b- \" \! B5 n2 T# U- R + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
1 v% O/ _% X* f1 `7 O- F# B if links > rechts ! e0 a( I5 k+ v8 F
then
( P% b% l+ x! c6 @8 { if @.standort.nf(3).nf(1).leer1 Y/ z% F& b( B) r) p
then
6 j# h7 {$ Q9 Q6 c# O7 i; @. C- } @.umlagern(@.standort.nf(3)); ; w/ ]% \( z6 V* Q l0 u
else, ^2 E! Y7 s! k
if @.standort.nf(2).nf(1).leer4 N g$ `& g# a" v* _( z
then- }& m+ q1 d' i* b8 T+ y, g) m; B
@.umlagern(@.standort.nf(2)); B" h o1 ^; ~; M
else5 i+ F! }- [3 u% m- @" i0 y" s
@.umlagern(@.standort.nf(1));" R; p( k7 Q* f5 G
end;
+ L& R' m3 J9 j% i end;
2 {$ i$ |7 H7 X" e% n3 I% l else
9 k1 h# a+ G: ` if @.standort.nf(2).nf(1).leer
0 d8 D9 N6 v# i4 {3 a: a5 } then
: E0 P$ L* _* b( v @.umlagern(@.standort.nf(2)); 4 t& i: x& J( E% C' Z. ^
else q. k" f; F+ g* K: F
if @.standort.nf(3).nf(1).leer; _; [: l0 m% U, o+ n3 k8 [6 c
then2 j9 g" v! ]5 L( d6 N. @2 \' x" G
@.umlagern(@.standort.nf(3));
' n5 k/ T) \1 S/ r$ j" N else
4 j) N" c4 d: T( y+ R3 Y. ]; l5 ^ @.umlagern(@.standort.nf(1));8 {1 x* k/ N% p- J6 J/ Q
end;
0 Z# R' d- B. f3 C' ]' Q0 p end;
) W. ?. b* F8 X% `# U7 q0 h3 e z end;
% {$ O( z- i3 n9 S end;
3 q# Z& t- v# }, r4 ` end;
$ T9 O6 g9 h3 E: H0 u! Pif ?.leer7 N; k& v9 ]' m
then
7 {% A6 D( ~- A blockier_merker := false;1 p. a, A/ ]% M: r& \, x
end;
+ U7 s& b9 B% Z& ]9 a, j2 B' U3 wend;
6 M) s# u8 y& b. \. ?大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |