eoCounter?
eoEasyEA -- made it copyable again eoEvalFunc -- added specialized eoEvalFuncCounter eoEvolutionStrategy -- nothing much eoGenContinue -- nothing eoPop -- fixed nth_element_fitness eoBitOp -- fixed error in xover eoFileMonitor -- now appends always eoParam -- worked around memory leak in MSC's strstream eoParser -- changed -pconfig_file to @config_file eoParser -- added messages instead of exception when required param is missing eoStat -- added eoDistanceStat t-eoFunctor -- don't know
This commit is contained in:
parent
a7131a7f71
commit
ff108477c3
16 changed files with 222 additions and 83 deletions
|
|
@ -113,11 +113,12 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent
|
|||
struct GetFitness { Fitness operator()(const EOT& _eo) const { return _eo.fitness(); } };
|
||||
|
||||
Fitness nth_element_fitness(int which) const
|
||||
{
|
||||
{ // probably not the fastest way to do this, but what the heck
|
||||
|
||||
vector<Fitness> fitness(size());
|
||||
std::transform(begin(), end(), fitness.begin(), GetFitness());
|
||||
|
||||
vector<Fitness>::iterator it = fitness.begin();
|
||||
vector<Fitness>::iterator it = fitness.begin() + which;
|
||||
std::nth_element(fitness.begin(), it, fitness.end(), greater<Fitness>());
|
||||
return *it;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue