is0 t) M: @: k3 Q5 c) g+ A
local links,rechts : integer;
/ p8 s+ B6 g6 `do! ]& ~( Z" m2 L' S) d
if @.standort.nf(1).nf(1).voll
$ I8 ^8 z4 N& Z7 ^ and @.standort.nf(2).nf(1).voll8 n& q7 @/ q! X
and @.standort.nf(3).nf(1).voll
8 T0 E* u" k' C0 j, a; G) a8 e0 Y then
/ t5 L& Q% e8 R% P8 H1 f- l( u& F blockier_merker := TRUE;6 _9 _9 V1 a( D# f, K( A$ O
else
! a/ p" a1 r# e- j2 B1 F if @.standort.nf(1).nf(1).leer+ \; u5 p; d! L. ~" V% O( v
then& W y3 E. t% V
@.ziel := "ap4_C";0 z- z0 i" A# N2 b& B/ P7 g
@.umlagern(@.standort.nf(1));
2 P& p8 |# b: r- r' T else0 g$ [0 u1 |" _
links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs - Y" K0 p4 [1 ^: c4 l
+ current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs / Z5 W% `* w+ ], E: I/ u) x
+ current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;( Q* i. d% `% p+ B1 U; I
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs 4 b% w$ @8 K h& }/ G0 }* G+ o
+ current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs 5 M/ X& u* i: Y8 J
+ current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;
# r3 Y2 X8 B( y8 J& U, X3 W if links > rechts 7 Y4 `& v1 l7 I- U# A' m0 X1 V* u
then& e/ g- p$ \% Y
if @.standort.nf(3).nf(1).leer
3 D7 f# |' }* |9 A) y5 n4 u5 f then
6 y9 l$ q Q% Z5 v @.umlagern(@.standort.nf(3));
) H u, v2 e/ }. m6 { else
9 k1 y! h3 F5 Z' a1 R z if @.standort.nf(2).nf(1).leer1 V/ Y( h3 j+ |
then
! ?7 S" a+ V/ `; x$ v @.umlagern(@.standort.nf(2)); e1 [2 e7 W H" x0 X7 }) e
else$ G% q1 }& w+ X; Y* v) ]
@.umlagern(@.standort.nf(1));* W, f; Y' }: i" G1 L0 w
end;
( d2 E+ m6 r$ a6 h! H5 a6 e end;
. |( E6 X. A7 p else 2 k6 K p, z# U3 T- B' h m
if @.standort.nf(2).nf(1).leer
4 U! W: j1 Z3 J; b$ w, B1 { then
& w. d4 I- ~# }" i @.umlagern(@.standort.nf(2));
( q0 w: v8 S* c5 c else
J; e& Y. k1 @, o* k9 E' ^ if @.standort.nf(3).nf(1).leer
1 t, z- d! { `+ s P! b' R5 S then/ g! Y$ K) q: E- \4 u4 r$ o! {. k; y
@.umlagern(@.standort.nf(3));
4 _1 q8 Y/ \" l# M( {# q else
/ W8 G5 o6 A2 n; g0 r% R @.umlagern(@.standort.nf(1));
3 a9 l; K; ?3 f' K0 M" S end;
& Q2 m# |. y. q6 V& F0 R end;& V# M+ s; B* K" Q
end; 2 p/ W: K) j5 F2 Z% d1 a" t; P
end;
( h( u1 R* M' x. _" N end;; Q$ h+ S2 H0 |7 T
if ?.leer
: q# s0 T, f% |2 V8 tthen! q1 U% y5 d& C+ |
blockier_merker := false;
/ ~2 p# ^' S* O4 g; d* \- Aend;6 u$ a+ d2 w# `- z0 e
end;0 L. q! L A! W- r; Z+ o) m. Y
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |