Backport feasability when computing fitness in fitness assignment

This commit is contained in:
Johann Dreo 2013-06-12 10:39:23 +02:00
commit 9250e0c3a5

View file

@ -45,6 +45,8 @@ public:
protected:
using moeoExpBinaryIndicatorBasedFitnessAssignment<MOEOT>::kappa;
//! Split up the population in two: in one pop the feasible individual, in the other the feasible ones
virtual void split( eoPop<MOEOT> & pop )
{
@ -94,6 +96,19 @@ protected:
}
}
virtual Type computeFitness(const unsigned int _idx)
{
Type result( 0.0, values[_idx][_idx].is_feasible() );
for (unsigned int i=0; i<values.size(); i++)
{
if (i != _idx)
{
result -= exp(-values[i][_idx]/kappa);
}
}
return result;
}
};