is- Z& @. r" C! h
local links,rechts : integer;
5 O% G# m& Q$ }( odo. N9 m, h% t9 O! k; e7 h4 X
if @.standort.nf(1).nf(1).voll H; N! M& Y6 f1 G# D% f
and @.standort.nf(2).nf(1).voll/ S b- j( N$ m6 |" l7 y
and @.standort.nf(3).nf(1).voll& Z! j4 d5 C3 n& y- J: N( S; g
then% v0 e2 ]& b, Z
blockier_merker := TRUE;
" q( I* ^& Q5 c% N else* R/ N: Z( n& W' z6 k
if @.standort.nf(1).nf(1).leer
: g F( X' R+ e K/ @ then
6 z* d# t& ]1 D# v. g @.ziel := "ap4_C";
# f1 y0 b0 J" k8 l1 }1 b8 i @.umlagern(@.standort.nf(1));8 g$ K, e& D& b7 I
else
' X* Q* j, d( Q) q; J4 c% s1 c links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs 4 S& R3 V3 j( K* B n; |& Y
+ current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs % o3 R/ g" F7 G, g& Y. j* L' _
+ current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;
! R' j6 r6 A9 t6 f" m' J& T9 R rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs
6 Z+ @- n' \5 m# c5 N6 y + current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
3 @+ f& A! @( ?1 ` + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;3 ^- U; `) ^' B( v7 F: p/ b+ |8 G n
if links > rechts 1 d1 X( t/ @& H! u2 |
then
! o9 z) d [9 B, w: ] if @.standort.nf(3).nf(1).leer' W3 E( Q' }" }. F. b; ?
then
: f; k4 T3 j R# U5 ]3 D( }: q @.umlagern(@.standort.nf(3));
6 g' s% Q/ l7 S! B4 D+ _7 ~ else
3 P; N8 X9 U9 r6 d8 _4 v6 I C$ X if @.standort.nf(2).nf(1).leer
$ E+ R8 ~7 j8 X2 t m5 n. }- s then, n: A, c8 y1 v- h2 _
@.umlagern(@.standort.nf(2));2 a& h6 N" j+ G% i. E& f
else2 E+ ?; K* [. S2 E7 d7 S
@.umlagern(@.standort.nf(1));6 z1 u: |0 X5 |0 J- o5 l
end;
1 G* J9 {3 c- Z2 G end; t+ c: v+ W( k1 c
else
- \7 C2 i9 ~" { if @.standort.nf(2).nf(1).leer
; s" R7 u, f. z$ C# `( m8 G then: B3 W( k1 ~" @$ J" Q$ R
@.umlagern(@.standort.nf(2)); 5 W1 `. Z4 Y) u( M
else
! P$ W$ f: j6 q: A if @.standort.nf(3).nf(1).leer
/ ]- D. H0 L$ k: a2 w# m then& i) c* a' ], \. l+ K
@.umlagern(@.standort.nf(3));! N, R. Q6 b! i$ g, E) }: x/ o: S
else
1 m" O, j4 i$ b% b, k$ `7 z0 f0 D @.umlagern(@.standort.nf(1));
0 K9 F& F0 ^2 f end;
! o$ [* E- `# M- ? end;
" [/ B m; L& ]. g: J end; . r3 C2 r' m4 Y# r
end;
5 m" Z$ a# }. w- H$ ~ end;
3 C! v9 P. h* C- [. k* Yif ?.leer
3 l- f* ^- b5 r' E% ethen3 L b: @& O3 B7 Y4 M1 K
blockier_merker := false;3 z% ?- c8 g! r" m- t
end;
) \3 Y1 A+ c0 ]7 N7 |+ ~) {end;4 H- u' x9 {/ C) F- b+ F
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |