Use the feasibility of the current individual for the feasability of the metric in dual fitness assignment

This commit is contained in:
Johann Dreo 2013-06-21 11:09:15 +02:00
commit 3d0db369bc

View file

@ -130,7 +130,10 @@ protected:
metric( pop[i].objectiveVector(), pop[j].objectiveVector() ),
pop[i].objectiveVector().is_feasible()
);
} // if i != j
} else { // if i != j
assert( i == j );
values[i][j] = Type( 0.0, pop[i].objectiveVector().is_feasible() );
}
} // for j in pop
} // for i in pop
}
@ -145,11 +148,10 @@ protected:
virtual Type computeFitness(const unsigned int _idx)
{
// Type result( 0.0, values[_idx][_idx].is_feasible() );
Type result( 0.0, values[_idx][_idx].is_feasible() );
for (unsigned int i=0; i<values.size(); i++)
{
if (i != _idx)
{
for (unsigned int i=0; i<values.size(); i++) {
if (i != _idx) {
result -= exp(-values[i][_idx]/kappa);
}
}