Курсовая работа: Генетический алгоритм
s: string;
label lbl4;
BEGIN
n: =round ( (nMarsh) *kCross) - 1;
for i: =0 to nMarsh-1 do
begin
setLength (child,n+i+2);
child [n+i+1]: =parents [i] ;
end;
TrackRead (sender);
setlength (elite,1);
s: ='_';
{1}for i: =0 to nMarsh-1 do
begin
lbl4:
elite [0]: =random (n+nMarsh);
if pos ('_'+inttostr (elite [0]) +'_',s) <>0 then goto lbl4;
for j: =0 to n+nMarsh-1 do
begin
if pos ('_'+inttostr (j) +'_',s) =0 then
begin
if road [elite [0]] >road [j] then
begin
elite [0]: =j;
end;
end;
end;
s: =s+inttostr (elite [0]) +'_';
parents [i]: =child [elite [0]] ;