is! W. J/ M. q {( _
local links,rechts : integer;
% z$ ^5 T l- U, I( G6 C" qdo
- s$ s N% e/ G* \! r1 j if @.standort.nf(1).nf(1).voll" r. N' q n6 p& \# O& G
and @.standort.nf(2).nf(1).voll
4 P2 F* v. G/ H$ E" _ and @.standort.nf(3).nf(1).voll1 N ~* R& f9 O h8 \5 X; F' T
then* i! U$ F, d6 X- c8 }! b. Z
blockier_merker := TRUE;
. d/ L7 C, y2 { t% R4 C# K else
6 K& _' D; ]8 Z# e% j) U) ^& Z if @.standort.nf(1).nf(1).leer$ o/ E; ?- \, K
then: w3 O* V- _/ t0 q
@.ziel := "ap4_C";
" v- m) t5 \& U9 U @.umlagern(@.standort.nf(1));& h" F( i! g9 U1 I5 F j* K
else
_, `( i0 T' ` P links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
( i1 x1 y' I6 v8 }7 x8 ^" e+ w + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs , f' M8 H; j. e5 I7 O4 Q
+ current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;% i5 q" D5 [; V3 e( m* y7 i
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs + ~2 C3 p' T' I. b) }, ~
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs . F& v$ k; ?2 o8 B, e7 K' u* _
+ current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;& R. r/ M: L- N
if links > rechts
! [! X: q4 e% J/ G& r then
g% c2 ^1 z- @) \ c% \ if @.standort.nf(3).nf(1).leer6 U* ~+ t, K5 `. m- T$ ^
then
7 B( K q2 O" t9 F$ P8 G/ p @.umlagern(@.standort.nf(3));
+ g7 |. ?* y4 D. o. U" s% v2 s6 T else
8 J: S$ q2 ?# h: g6 j& Q/ S if @.standort.nf(2).nf(1).leer
, `+ r1 @; J P then/ h0 W% x7 ]. ^2 L5 \
@.umlagern(@.standort.nf(2));
) u9 F( |" t+ l else
8 F% P9 ]0 ^# S( q; b @.umlagern(@.standort.nf(1));
1 I k$ f7 c# G! R+ ]; A end;
! Y; P. e0 ^9 Q2 O( y end;
3 u. X4 V7 W, o: H2 F5 ^1 ?) v else 0 E. y# A/ l8 c4 a, W8 t
if @.standort.nf(2).nf(1).leer
. ~! u& Y9 T+ Y ?1 B then
' T8 B1 A$ p% X0 z! p( ]: W @.umlagern(@.standort.nf(2));
. y1 n- i. I, j- x- y% } else) u! u: D/ i& ]+ p+ O9 r
if @.standort.nf(3).nf(1).leer
, {: T( ^+ y J/ O3 L) j then7 y/ f& O. x; \$ g4 i& _) F/ K
@.umlagern(@.standort.nf(3));
4 ^; L# G7 W L/ x+ }! E else5 I# w$ ]. s/ `* b, a4 E
@.umlagern(@.standort.nf(1));3 y9 Y4 y% Q8 C$ n. f5 J. `
end;
M3 B* f/ X' Q2 E: }# k" |. t end;$ S: n8 Q4 n2 z) b
end;
! _0 ] i0 }& ~& ]3 ^) ~* S end;! o: Z9 W3 P' E5 P; R! t) Q! _
end;* Y7 s& r7 W0 O8 l! `
if ?.leer
$ i2 u4 B7 e8 Ythen
' G# N8 Z( r& c5 ~7 G blockier_merker := false;$ J( M6 w( L. U9 z1 h7 X' _5 B
end;$ }# f- V" Z6 S5 X% f9 m; i
end;
. x* D: ~- X2 L! ?3 e- Y6 g大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |