is7 L" w. b! ^- J2 o
local links,rechts : integer;
: L9 g, S# _3 _8 t O( N) }do$ A2 K9 } P* k- w
if @.standort.nf(1).nf(1).voll
- U% W+ d( \% i: l5 Z8 K0 E: V and @.standort.nf(2).nf(1).voll) s3 P4 f* d, X
and @.standort.nf(3).nf(1).voll: H5 A/ q" g# g) {# U
then
6 T2 a9 b* n$ D0 U& N blockier_merker := TRUE; s8 ^' X' q J6 c
else- d8 q, T+ X" ?( I
if @.standort.nf(1).nf(1).leer9 l( {4 ]; {. |# |) E3 k4 `4 d7 X
then% |. `8 S: x8 F3 V" X1 ?: |
@.ziel := "ap4_C";" Q( E: t. u- s5 |) ?9 x
@.umlagern(@.standort.nf(1));
. o9 i5 h* B) H" g& @ else- |0 z; Y8 m/ {3 U
links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs 1 T% |6 C- i8 z0 u0 K" ~$ G9 ]3 P
+ current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
. s" p3 w7 s* j9 I; G, d/ }- l + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;7 l' m: K$ K$ L3 t; V( V3 C9 I0 ]. T
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs . g8 j4 w! W( @( Q C, u* o6 n
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
0 v- X" ?8 ^$ ?+ v + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
2 Z n0 E. g7 v if links > rechts " n3 Z9 a" A" \+ M! Z
then s- W- k5 J5 F0 N! e5 Z
if @.standort.nf(3).nf(1).leer' z e) L4 o6 z5 n4 u) n
then
& F- A& l1 w. R+ ~& u @.umlagern(@.standort.nf(3));
* c1 @4 k; X n# f% @% A# z else
, y" f* X& g7 z1 h& w J1 k if @.standort.nf(2).nf(1).leer1 m8 X7 Z {! D0 d' q
then
: D' t( k. B" F% G6 r/ k @.umlagern(@.standort.nf(2));% \/ U7 d; E6 R" [9 N9 W. Y' e
else2 [" @) ~5 u- x8 w/ W. _" n9 h
@.umlagern(@.standort.nf(1));
5 Q& {2 @( G: `2 j( y8 D end;5 ^2 D( @+ t* q, d6 {
end;& h9 s4 r6 U9 m; B
else
, K- y c0 o0 ?% v* j6 z if @.standort.nf(2).nf(1).leer
( Q6 e: p' T) x1 l( Y1 s! s then
0 B3 ^+ b6 }2 k9 l3 W' R2 u @.umlagern(@.standort.nf(2));
a) l5 k% P3 B+ [! }/ E else: I2 C% E0 n% g1 ?
if @.standort.nf(3).nf(1).leer" J; P J+ Q! a. R5 ]; h' m
then
1 a3 j- W! e# A/ F/ |' d @.umlagern(@.standort.nf(3));- R$ z6 B+ g+ Q
else- s: ?) s6 H3 U7 Q! e
@.umlagern(@.standort.nf(1));
% d2 Q3 O: z8 l. u- @ r) o% u end;: X w( @6 h6 Q) {7 v6 }
end;2 x1 ^9 e& U( |2 U2 K
end;
+ I0 z# a% O! j: J5 I end;" `/ d$ R, n5 \; D& x
end;
$ W( O/ c/ w3 }" s( `; b* B: }if ?.leer
" E7 }! [, @7 z, L/ Ythen
% n( _$ u: K# | blockier_merker := false;
; J+ Y2 q# M4 ]0 Yend;; M1 _& M3 N: v, O/ Z$ R
end;
* S# O1 a% L9 W9 T大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |