Backport feasability when computing fitness in fitness assignment
This commit is contained in:
parent
557b24694a
commit
9250e0c3a5
1 changed files with 15 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue