is8 N$ a/ N' ~( ], ]) c3 F9 x9 s
local links,rechts : integer;6 g2 S* N( ^" T/ g
do% G; ^. w; I( y; t2 f& X
if @.standort.nf(1).nf(1).voll* p* `' b- J/ h9 n
and @.standort.nf(2).nf(1).voll
! }! x: F8 H) N, a and @.standort.nf(3).nf(1).voll# q7 Z* S- S$ R' ?
then
. a8 \6 q: S" J/ t9 t( P/ X, Z blockier_merker := TRUE;
9 B$ W; V1 v) y% G: @6 W else" Y( U+ n) r- c, g) S; I
if @.standort.nf(1).nf(1).leer- t$ E; o, Z3 s/ Y" Z k8 j
then- D" T J" i3 R( b
@.ziel := "ap4_C";
: N% r5 s% J+ D2 k, Y! F& @ @.umlagern(@.standort.nf(1));
( _; z; g, }, ]2 X$ U( \0 v& | else
+ K! g9 B& h( N1 A3 l- s links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
! y+ Z9 }( t" P + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
0 |* E9 o, Q, ?( ~, k/ m' v. S + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;2 i( W" l6 R: p' r* l
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs
& U N. E' s) `; j6 O: Q + current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs 7 _. G8 f+ K/ k) s( i
+ current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;+ F+ b3 }& n, Z9 G" p/ D, G
if links > rechts ! o, k* K: I2 q* t7 D' [5 x& P2 G
then- s$ n A/ M* {
if @.standort.nf(3).nf(1).leer
- M. _! f1 K1 i; K then
1 F y$ [! X p: J @.umlagern(@.standort.nf(3)); ' `5 b& l* K: ~) }
else2 F- \* m4 t4 [. O
if @.standort.nf(2).nf(1).leer1 Y9 m K, i2 z2 w4 x
then& H/ n6 P3 T: ~' F4 v
@.umlagern(@.standort.nf(2));
: L* X# g' Z5 f' A% ? else
- x/ w7 a1 r' ?- C @.umlagern(@.standort.nf(1));/ m, m( @( Q6 x9 a2 Z+ u. U
end;
: L1 c0 |/ }3 D end;
$ c }: x* S+ ?8 H else ' H* a4 h& D$ G0 Y* h/ q+ f
if @.standort.nf(2).nf(1).leer* i/ O& b- l2 I. f: U7 ]9 Q
then
$ M$ e. Q$ B, E4 b# x' I, G @.umlagern(@.standort.nf(2));
& A; q/ Z. R! { else
9 c2 X3 a. o0 R9 w' k! Z8 q if @.standort.nf(3).nf(1).leer
, v; }9 b1 h) D- G6 K! S/ P then
- W% }- W: f R0 G @.umlagern(@.standort.nf(3));% ~- W: I+ W7 V- {( m9 B2 n
else
7 K1 d7 K5 z2 `9 F6 T H/ }" H. T) e @.umlagern(@.standort.nf(1));
# x. ?; Q- e- l end;' e4 }9 _1 b, [6 `% o9 y) n
end;9 p3 C' A+ b2 z+ L% K( V( x* r
end;
0 C7 e8 L# d2 W/ H w; f2 O; W# T end;
2 a+ U! }- ?, x; j6 N$ H end;, f" k6 i( l- H
if ?.leer
! X0 l/ V, f- Qthen
2 }$ u( i) M2 V7 ~! m2 ] blockier_merker := false;/ j9 ]& ~( T, v" G" A0 Y. e2 I
end;5 m' ~4 ^" }& _, q; J
end;$ |! c" l8 W: U5 J w" b7 h# {
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |