is% ~8 t$ W2 z# T, x1 F
local links,rechts : integer;
2 C5 R Y* Q/ j8 ~- Cdo" M$ E; k, r! j8 ~2 L; l
if @.standort.nf(1).nf(1).voll0 p' W( s) N# D6 m) |$ T
and @.standort.nf(2).nf(1).voll8 `& B. `4 p" e2 `
and @.standort.nf(3).nf(1).voll
$ Q$ L0 D( q/ [# @( c' P# F1 H& R- L then& L' ~0 t2 `$ i( q2 S" z
blockier_merker := TRUE;
, c; ~& s3 P3 U. _$ o m0 V else
" m% q3 Y& s) B7 j, { if @.standort.nf(1).nf(1).leer
+ J- f4 |- }# `2 g1 l) v* k then
6 ] X c! B. U @.ziel := "ap4_C";
% ], P/ `9 m9 h9 t l @.umlagern(@.standort.nf(1));8 U/ A+ X6 t6 X4 n
else
; Z( d# }7 V, J$ p, f6 P5 ? links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs
) w- e9 i* e+ v& ^ + current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs
" N$ ~! W( H8 a6 R7 K( C0 | + current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;
' Q4 x2 T* K. V; @5 g0 X rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs
3 k3 J, M% U2 p" w0 Y4 s, M& A + current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs : P% N; U% _2 |, D# |9 B8 g/ B% ]
+ current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;% @+ G& V% v* |) u; L. R9 S# E
if links > rechts 3 S0 G2 p3 ]3 z$ w$ H
then# [0 [: R* U2 F/ o/ C6 ]1 R; {
if @.standort.nf(3).nf(1).leer
; f( ~) l5 p9 x; X/ G9 p: q then
0 n6 @; P Y+ L1 _4 q0 m @.umlagern(@.standort.nf(3)); 0 W8 W, k& F5 {
else
5 w- @3 H5 p6 \6 P; B7 A if @.standort.nf(2).nf(1).leer
$ q h L$ X3 Y then
4 R0 E4 b2 H% [, }+ u1 A @.umlagern(@.standort.nf(2));, F/ ~9 f- c r" u4 J( \0 x
else5 C( S5 s: z( V8 C& A) E/ N
@.umlagern(@.standort.nf(1));
. ?% F3 n% b* ^6 {# U$ n/ i/ E. K end;/ L' }0 F& s. Y
end;8 E8 ^4 B9 j1 H+ O% Y! ?& O
else
4 F. ^4 ^( o' [3 [; u if @.standort.nf(2).nf(1).leer
( P" K9 l$ ?. T# X1 h then
. P s! |& ~# x+ c& r @.umlagern(@.standort.nf(2));
4 m+ L* g; K1 }: B) C5 u else; u5 C6 d5 X) Q; E& q' t
if @.standort.nf(3).nf(1).leer! L) ]/ y" [* m8 j7 t2 J0 X
then; ]9 E/ [3 e' v
@.umlagern(@.standort.nf(3));
; q' D* }1 g4 k5 Q) [) N9 E else! M: r$ O4 j8 e
@.umlagern(@.standort.nf(1));) w, a2 ^, C5 ?) t0 V
end;" o' B& R& e" J/ y3 p+ e& v3 U9 Z
end;2 }7 I/ i' j7 F, ?3 k9 ~
end;
' X% K% m8 q h! X8 a& n- Y end;; R H, |: o8 l- `1 Z; E
end;( `! \( E- ]+ P% V4 {1 T/ d
if ?.leer
t2 l' X! X5 }9 Q) Q0 e& kthen
) q: p6 L. E7 y8 @5 J8 D blockier_merker := false;
7 @& ?4 k2 M: ]9 M. h" r5 {$ h6 qend;
6 h5 I& ~. D7 |end;
. _/ r* C" p* x# | G/ Q) t% k大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |