is/ S% a* H" |# O2 B
local links,rechts : integer;0 I, Y! L$ j' P" h8 z) x! b
do
. R& d, ]1 D) \/ b! j" V( s& m6 g if @.standort.nf(1).nf(1).voll% ]( m3 W1 d; g8 l" P! |* r
and @.standort.nf(2).nf(1).voll
- R! p% M* V" V+ I$ z0 h and @.standort.nf(3).nf(1).voll4 J- z, F; p2 F. z$ d( D: u# I
then
; Q# z4 u i3 B- J( [2 n blockier_merker := TRUE;" ?# I# j$ h" E3 Q; k
else# M5 N! H; M1 R u. f) X1 L; s4 r+ V
if @.standort.nf(1).nf(1).leer
( V5 W* g) n5 V then6 x* g; a( V* n
@.ziel := "ap4_C";
: G7 R- V2 \3 x; A @.umlagern(@.standort.nf(1));
" S9 P& A I8 e* O9 ?; n else! Y% |9 P4 w4 ~- o' F# S( D' d9 ]
links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
7 |7 x% |) x( m+ y' O- @4 A! N + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
1 s. u, n' N" C! |$ g2 I$ a* v + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;4 j, X' B2 M* F! p5 G) O
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs - O8 j0 I6 C2 d* a3 g a
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
/ g+ [/ \8 M) l+ Z! s! t + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
# j2 `6 Z& S: b$ D0 K: A3 j$ {' s if links > rechts + t" a& k9 V6 D$ L
then
# `) y0 P8 o1 F6 ]5 C+ f8 F if @.standort.nf(3).nf(1).leer
3 o( ^% r& I, w) t* S. O8 i9 q then
: B4 F/ ]0 O$ y @.umlagern(@.standort.nf(3));
$ f) Q2 C0 n; {7 F4 H. O) @ else+ S$ O" @1 H. _% u: ?
if @.standort.nf(2).nf(1).leer* c+ X; ~: I# y( q2 P& n- A
then, |9 Q2 i/ p4 {* Z( A6 P, D7 N
@.umlagern(@.standort.nf(2));# q4 ?2 z `7 @ y3 ]
else$ g" V4 g& D+ { s' Z
@.umlagern(@.standort.nf(1));& R5 l: u9 U0 h" H
end;
0 i) \9 A* F X) [1 M8 _; A end;
% J4 e# P+ j9 n* h else
0 X5 a% g# c9 d c- h. k' m if @.standort.nf(2).nf(1).leer
4 l f! k/ J* p" w6 ^; ?. k8 j6 C then
# p/ V2 ~: P; ]8 a" l @.umlagern(@.standort.nf(2));
' w3 ^, Z6 l5 X0 `# g3 ?3 h0 l8 z else
& O8 ]6 ]" v" Y8 Y* w2 k1 R if @.standort.nf(3).nf(1).leer% D" V; j6 p1 Y3 Z+ f0 D5 a
then3 B- _" X1 C6 W& `* }
@.umlagern(@.standort.nf(3));' ~1 Z! ]. H) T. ]7 Z: L
else) J i9 G/ M4 q p
@.umlagern(@.standort.nf(1));+ Y( d, { _1 S( ?+ k6 N4 U
end;
1 q$ |- `- {# T# { end;7 C, z8 c8 C2 J6 a
end;
/ M$ y( [' N4 _# z end;* @" p& C s% J+ x) g
end;
: E1 A5 @: }% h8 _/ @& `if ?.leer
7 g7 L5 _3 A8 ^; N- B* hthen
g! l: H+ M. B' s: z' @ blockier_merker := false;7 {6 v( I8 `- x# R' t
end;
( O, E2 G% @( M. lend;
3 S: D4 q% [7 g大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |