Changed a few things in the eoPerf2Worth classes, EO.h and eoSelectOne.h are functionally unchanged
This commit is contained in:
parent
9bbac485f9
commit
665e20b0f8
10 changed files with 331 additions and 80 deletions
|
|
@ -37,17 +37,27 @@
|
|||
on a single spot on the front.
|
||||
*/
|
||||
template <class EOT>
|
||||
class eoParetoRanking : public eoPerf2Worth<EOT, double>
|
||||
class eoParetoRanking : public eoPerf2WorthCached<EOT, double>
|
||||
{
|
||||
public :
|
||||
|
||||
eoParetoRanking(eoDominanceMap<EOT>& _dominanceMap) :
|
||||
eoPerf2Worth<EOT, double>(), dominanceMap(_dominanceMap) {}
|
||||
eoPerf2WorthCached<EOT, double>(), dominanceMap(_dominanceMap) {}
|
||||
|
||||
void operator()(const eoPop<EOT>& _pop)
|
||||
void calculate_worths(const eoPop<EOT>& _pop)
|
||||
{
|
||||
dominanceMap(_pop);
|
||||
value() = dominanceMap.sum_dominants();
|
||||
value() = dominanceMap.sum_dominators(); // get rank: 0 means part of current front
|
||||
|
||||
// calculate maximum
|
||||
double maxim = *max_element(value().begin(), value().end());
|
||||
|
||||
// higher is better, so invert the value
|
||||
for (unsigned i = 0; i < value().size(); ++i)
|
||||
{
|
||||
value()[i] = maxim - value()[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private :
|
||||
|
|
|
|||
Reference in a new issue