refactor UF_random_generator to fit the new std::shuffle

This commit is contained in:
Johann Dreo 2022-01-23 18:17:48 +01:00
commit 4ee48e760b
7 changed files with 39 additions and 29 deletions

View file

@ -123,17 +123,17 @@ void main_function()
<< chrom << " " << chrom2 << std::endl;
}
for (i = 1; i < SIZE / 2; i++)
for (j = 1; j < SIZE / 2; j++)
{
eoBitGxOver<Chrom> gxover(i, j);
std::fill(chrom.begin(), chrom.end(), false);
std::fill(chrom2.begin(), chrom2.end(), true);
gxover(chrom, chrom2);
chrom.fitness(binary_value(chrom)); chrom2.fitness(binary_value(chrom2));
std::cout << "eoBinGxOver(" << i << ", " << j << ") ..... "
<< chrom << " " << chrom2 << std::endl;
for (i = 1; i < SIZE / 2; i++) {
for (j = 1; j < SIZE / 2; j++) {
eoBitGxOver<Chrom> gxover(i, j);
std::fill(chrom.begin(), chrom.end(), false);
std::fill(chrom2.begin(), chrom2.end(), true);
gxover(chrom, chrom2);
chrom.fitness(binary_value(chrom)); chrom2.fitness(binary_value(chrom2));
std::cout << "eoBinGxOver(" << i << ", " << j << ") ..... "
<< chrom << " " << chrom2 << std::endl;
}
}
// test SGA algorithm
eoGenContinue<Chrom> continuator1(50);