is' y, e! S' M) K2 s
local links,rechts : integer;
x/ W/ ]4 @! e; {. H7 v Edo# E- @: C% \+ A+ f
if @.standort.nf(1).nf(1).voll
: v n, x- I2 \! l( g; a and @.standort.nf(2).nf(1).voll
2 G3 a! J+ F: p" F( i2 O- Z3 X and @.standort.nf(3).nf(1).voll
6 g+ F5 y% p& z% K then
1 Y" j( N3 k3 W6 B( I H9 b blockier_merker := TRUE;
4 ~8 O5 O0 @: t- p6 \ R else
0 n+ x: F' z Q. u; \3 A& W- [: h* g if @.standort.nf(1).nf(1).leer; |% N$ U% m3 E* O& n9 `6 s- J
then
+ k3 \; l0 e! Y* A& R% {+ N# j/ L @.ziel := "ap4_C";
$ N% n0 N& H7 O! I @.umlagern(@.standort.nf(1));
U2 R) f6 p% h- `6 [6 o9 C8 K else
/ u2 x* f V A7 E: c$ O8 l9 O3 f links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs % `7 P- a$ t- n' b e8 g) K
+ current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
- Z X) U; v% E N) h + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;
6 e' P# h6 b, ^+ C& V" Y rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs
, w- C# x3 q2 M- n1 {: @ + current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
/ [' T a/ W0 ?6 i+ d* { + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
/ S3 d$ o( h: l- H/ ~* l5 i( [ if links > rechts % G6 C2 ~7 K; A
then
5 p2 S0 [ j2 ]# `! s/ R if @.standort.nf(3).nf(1).leer
. r3 c8 u& A, j/ X/ ? then# q+ G! q. x! `
@.umlagern(@.standort.nf(3));
7 B# c8 O. U+ Q4 n else. E. q/ e2 |) K1 r2 W- r2 ^. F1 v
if @.standort.nf(2).nf(1).leer
( {/ m) W; M& l6 j4 k# U then! q `, m- A7 m! P8 r) N
@.umlagern(@.standort.nf(2));/ L) n# k3 K: d) C2 I* K
else# s7 T/ }$ ~' @
@.umlagern(@.standort.nf(1));+ K- m6 K4 c( h0 T0 R
end;
* D1 T% U1 M- P/ B9 O end;
0 B0 a% X2 {" m' t. i& N$ j4 f# l else
4 V* ~ j/ A: O5 @9 i5 E if @.standort.nf(2).nf(1).leer4 i2 b4 W; s5 S8 I) w9 e( F
then# k* @0 n( n/ P+ x+ \, p3 s7 H
@.umlagern(@.standort.nf(2)); / q1 W6 ]' k7 [5 p9 z3 _& [
else
9 G3 e8 z( R# o/ m. l if @.standort.nf(3).nf(1).leer
' G9 f$ W; {% B; a" Y then
0 [) J& E9 t& O @.umlagern(@.standort.nf(3));
* q+ I4 [3 k/ P* p else
) |* Q1 _" S8 J' o& X4 e6 W @.umlagern(@.standort.nf(1));
0 I0 x8 S5 {. `8 ]# D: l f( b end;4 \: i9 X4 d# [: Y) Q2 J O5 h6 n
end;+ e# f$ L* y8 _* `* `
end; 3 R g; W( p E. y
end;, c' x1 K" h* g8 Q
end;
m( _0 D; I1 z3 Oif ?.leer
% ~- l2 p6 w3 Wthen
; i I) F* o8 q+ Y! E( ]3 ` blockier_merker := false;- E7 h# q, t/ _) K; P' [! M& @
end;
- Y( q0 p& [- Z e8 S( Vend;
1 L+ T# a. ?1 _+ @大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |