EvolvingObjects
eoProportionalSelect< EOT > Class Template Reference

eoProportionalSelect: select an individual proportional to her stored fitness value More...

#include <eoProportionalSelect.h>

Inheritance diagram for eoProportionalSelect< EOT >:
eoSelectOne< EOT > eoUF< const eoPop< EOT > &, const EOT & > eoFunctorBase unary_function

List of all members.

Public Member Functions

 eoProportionalSelect (const eoPop< EOT > &=eoPop< EOT >())
 Sanity check.
void setup (const eoPop< EOT > &_pop)
 virtual function to setup some population stats (for instance eoProportional can benefit greatly from this)
const EOT & operator() (const eoPop< EOT > &_pop)
 do the selection,

Private Types

typedef std::vector< typename
EOT::Fitness > 
FitVec

Private Attributes

FitVec cumulative

Detailed Description

template<class EOT>
class eoProportionalSelect< EOT >

eoProportionalSelect: select an individual proportional to her stored fitness value

Changed the algorithm to make use of a cumulative array of fitness scores, This changes the algorithm from O(n) per call to O(log n) per call. (MK)

Examples:
t-eoRoulette.cpp.

Definition at line 45 of file eoProportionalSelect.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends