fix examples using binary_value
This commit is contained in:
parent
b03bd951e0
commit
01e44cf828
7 changed files with 143 additions and 129 deletions
|
|
@ -50,12 +50,14 @@ main()
|
|||
|
||||
eoBinRandom<Chrom> random;
|
||||
eoPop<Chrom> pop;
|
||||
|
||||
BinaryValue eval;
|
||||
|
||||
for (i = 0; i < POP_SIZE; ++i)
|
||||
{
|
||||
Chrom chrom(CHROM_SIZE);
|
||||
random(chrom);
|
||||
binary_value(chrom);
|
||||
eval(chrom);
|
||||
pop.push_back(chrom);
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +75,7 @@ main()
|
|||
breeder(pop);
|
||||
|
||||
// reevaluation of fitness
|
||||
for_each(pop.begin(), pop.end(), binary_value);
|
||||
for_each(pop.begin(), pop.end(), eval);
|
||||
|
||||
cout << "new population:" << endl;
|
||||
for (i = 0; i < pop.size(); ++i)
|
||||
|
|
|
|||
Reference in a new issue