is& q+ Y. F: Z/ R# A0 L; V" t* V. h
local links,rechts : integer;
/ y6 t8 x5 c7 [9 _- Q) O1 rdo* Z7 w/ ?* b3 E
if @.standort.nf(1).nf(1).voll
7 }! ~0 J' b" i' H and @.standort.nf(2).nf(1).voll- H) Q& [4 w6 L7 ^
and @.standort.nf(3).nf(1).voll
V* e0 R0 ^6 R& v1 k$ r3 m then% B, W% x& P. Y0 r8 K7 J. i9 r
blockier_merker := TRUE;1 D& b! T8 E2 n& k
else
7 f9 B% C N, Y if @.standort.nf(1).nf(1).leer9 r& ~4 F5 ?4 c8 s
then
; P; W9 X! H a! c2 r, O3 k @.ziel := "ap4_C";
) q6 s3 k; u9 F @.umlagern(@.standort.nf(1));
* D- Q* y4 ]' w9 I, _1 m/ x5 L else V0 e/ F! Y3 t3 C
links := current.standort.stichE.AnzahlBEs + current.standort.stichD.AnzahlBEs 9 S, z) s+ p2 h+ s$ q
+ current.standort.zuf_E.AnzahlBEs + current.standort.zuf_D.AnzahlBEs ! i' ~5 u% P( D0 s, k* ?! n
+ current.standort.ap4_E.AnzahlBEs + current.standort.ap4_D.AnzahlBEs;5 B* [, C3 G. F3 P
rechts := current.standort.stichB.AnzahlBEs + current.standort.stichA.AnzahlBEs
O1 l, D" K' A + current.standort.zuf_B.AnzahlBEs + current.standort.zuf_A.AnzahlBEs
) M' F! Y1 ^; {+ M8 L6 j + current.standort.ap4_B.AnzahlBEs + current.standort.ap4_A.AnzahlBEs;2 z* _# s: C. k8 [; }2 C; U0 f! _
if links > rechts ; v9 p4 f) `' O) O. E
then
0 g7 [$ r6 b+ r1 d' n if @.standort.nf(3).nf(1).leer) H) i: Y9 m" S1 U, p
then* X, u B8 R4 `& F; S" y
@.umlagern(@.standort.nf(3));
7 j; t7 [( z, q% v" ~ else! [1 v" X, y# i6 v4 S% K
if @.standort.nf(2).nf(1).leer
: a7 q2 ^$ a" b* P then
' e& D7 T6 D7 O: H5 A1 V* j @.umlagern(@.standort.nf(2));
' M R0 y E0 ?% y6 F else
1 S F8 B- d) j( }8 \. \ @.umlagern(@.standort.nf(1));( c" b) u( S, g$ J W
end;
2 u& [/ I# r" |' c* f end;
. |- m! q e- i. h( W else
" [$ l1 d& C1 q- }: w1 z! R if @.standort.nf(2).nf(1).leer
I! t) J# h$ e- m then+ m% @$ ^4 I' u- s% L! h
@.umlagern(@.standort.nf(2)); ( ^& y% n* c _6 W( ^) v
else
S: _) W' J# G2 } if @.standort.nf(3).nf(1).leer4 j" V$ O. |/ k# I
then
' U4 C3 ^8 x7 G7 u* E1 d0 e, Y0 v! m) \ @.umlagern(@.standort.nf(3));2 ~! \3 E+ T% r Y; _, R
else
2 N$ x6 Y. u; t) c+ H; z9 n @.umlagern(@.standort.nf(1));
. z' B- X# F# v: _& T end;% l( e' j1 j/ J
end;- F. ]1 j9 b! i* f7 ~2 s' ]
end; ) D1 u4 k9 J% y. D7 p6 z
end;
& N% k- o* X; {7 i# s$ y& w8 j end;
2 q+ {! l+ m* }if ?.leer6 J' I/ M8 P$ u. G6 N- F5 ~, [" z
then7 L* k$ u- H1 X3 u% D$ i! N
blockier_merker := false;5 z( f8 _" P- l* L: s0 e! }
end;
8 _% S: j% g; l, U5 Qend;0 D l/ d/ {; k( T6 K8 @( G
大家帮忙看看上面的程序是怎样实现分配的,好像用了一个遗传算法的。 |