is. H. N1 ]! F U7 Z% n! _2 q1 e
local links,rechts : integer;" s5 z' }7 g* U) f
do
# q8 Z9 J; h1 B1 p4 p: H9 ] if @.standort.nf(1).nf(1).voll8 h3 F# H. f5 a( `1 i) b- D8 H
and @.standort.nf(2).nf(1).voll
/ T+ F: K) A' d1 J! I( z# B% a* B and @.standort.nf(3).nf(1).voll
2 F7 _* K' `' ~ `5 F1 o then7 d2 P8 ?# _4 ?% [: G7 V
blockier_merker := TRUE;
" B c# V* \) }5 ]" D else
: }4 o$ b9 V3 d% ~. }% J+ b if @.standort.nf(1).nf(1).leer
* c! ?- J; J" X( c: X2 } then
& F/ [, e4 Q) X @.ziel := "ap4_C";
" f- Z; q# z h; d( y5 k- h ] @.umlagern(@.standort.nf(1));
5 V# k: ~1 c% e+ o1 v. P else
) e' {* h- F" Q1 N( L. M links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs 7 c: L( B* i3 L5 F0 _9 [& D- g% _
+ current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
/ m- Z0 q5 ^, v2 M# c2 e + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;
' ?- Q1 P$ {9 F! I8 I( ] O rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs + P. @8 s; b, y$ h
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
: r, a" ]7 J) P. \ + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
1 k0 j# Y3 Z; e! k" \ if links > rechts 8 k8 M% Q9 w6 i% U0 g, z: o
then
/ q/ c9 [0 |) b1 H if @.standort.nf(3).nf(1).leer% Y0 e: j" w& s3 o+ b
then$ j$ y) o" X5 y7 W% c% ?
@.umlagern(@.standort.nf(3));
- U& t) C" u$ G8 l! S' Q, v else* ~* x* S) R5 W$ T& m3 t9 N
if @.standort.nf(2).nf(1).leer; X$ W1 _$ ~/ `5 p! M3 L1 X# N& C* F
then
: Y0 i/ E4 }( R m" l6 r! E! N @.umlagern(@.standort.nf(2));- b- `7 Y/ g3 l2 o( I
else# l" Q2 s7 t M7 u* u3 h+ n1 V
@.umlagern(@.standort.nf(1));* m9 W4 B; g) l+ i, b% m- }
end;
1 A7 q$ i# n& ? end;. G4 L9 g/ J! t' g* l
else {: H' R2 Z3 x; Y2 {
if @.standort.nf(2).nf(1).leer
9 y8 k! `3 b( h1 @/ z0 h/ r; W( M then# x i( x. Q& ~+ o' E
@.umlagern(@.standort.nf(2));
3 f6 r6 B" s! Z) I) G& Q% @7 s$ J else
h& k$ t# H9 _, J; [1 J3 ? if @.standort.nf(3).nf(1).leer, U+ S& p8 J3 c5 f
then
; Q9 \' O; L/ N/ C x, |) U f4 @ @.umlagern(@.standort.nf(3));
: t/ ^( B) f8 O Q else2 h2 d8 R7 [5 V* w5 b, F" C) i
@.umlagern(@.standort.nf(1));
" K' h; [6 N! T9 u end;
3 e* F9 d4 i5 I4 b' a* l end;
! {" O3 u7 m6 x/ P end; 4 g2 E0 O: | M
end;: P n9 o1 m6 N# U" Y1 e3 Q V6 O
end;4 \: K7 \. [* _+ }) V! X* M. u. R
if ?.leer
@* g0 I& a. g7 C1 b7 Fthen
& o0 J1 F" g% t8 o blockier_merker := false;2 z2 H: H4 r# ~$ Z
end;4 {! `& `, @+ P! A4 A" U" v& a
end;% i4 X0 b- r7 r
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |