fast computation of dominance-depth corrected for minimizing objectives

This commit is contained in:
liefooga 2013-06-25 16:28:25 +02:00
commit 6fc4d043e0
2 changed files with 22 additions and 4 deletions

View file

@ -81,8 +81,8 @@ int main()
obj3[1] = 5;
obj4[0] = 5;
obj4[1] = 1;
obj5[0] = 3;
obj5[1] = 3;
obj5[0] = 4;
obj5[1] = 4;
// population
eoPop < Solution > pop;
@ -97,6 +97,10 @@ int main()
// fitness assignment
moeoDominanceDepthFitnessAssignment< Solution > fitnessAssignment;
fitnessAssignment(pop);
for (unsigned int fun=0; fun<pop.size(); fun++) {
std::cout << pop[fun].fitness() << std::endl;
}
// pop[0]
if (pop[0].fitness() != 2.0)
@ -129,7 +133,7 @@ int main()
return EXIT_FAILURE;
}
// pop[5]
if (pop[5].fitness() != 2.0)
if (pop[5].fitness() != 1.0)
{
std::cout << "ERROR (bad fitness for pop[5])" << std::endl;
return EXIT_FAILURE;