eoPerf2WorthCached< EOT, WorthT > Class Template Reference

Perf2Worth with fitness cache. More...

#include <eoPerf2Worth.h>

Inheritance diagram for eoPerf2WorthCached< EOT, WorthT >:

eoPerf2Worth< EOT, WorthT > eoUF< A1, R > eoValueParam< std::vector< WorthT > > eoFunctorBase eoParam eoNDSorting< EOT > eoParetoRanking< EOT > eoNDSorting_I< EOT > eoNDSorting_II< EOT >

List of all members.

Public Member Functions

 eoPerf2WorthCached (std::string _description="Worths")
void operator() (const eoPop< EOT > &_pop)
 Implementation of the operator(), updating a cache of fitnesses.
virtual void calculate_worths (const eoPop< EOT > &_pop)=0
 The actual virtual function the derived classes should implement.
virtual void sort_pop (eoPop< EOT > &_pop)
 Sort population according to worth, will keep the worths and fitness_cache in sync with the population.
virtual void resize (eoPop< EOT > &_pop, unsigned sz)

Private Attributes

std::vector< typename
EOT::Fitness > 
fitness_cache

Classes

class  compare_worth
 helper class used to sort indices into populations/worths More...


Detailed Description

template<class EOT, class WorthT = typename EOT::Fitness>
class eoPerf2WorthCached< EOT, WorthT >

Perf2Worth with fitness cache.

Definition at line 111 of file eoPerf2Worth.h.


Member Function Documentation

template<class EOT, class WorthT = typename EOT::Fitness>
void eoPerf2WorthCached< EOT, WorthT >::operator() ( const eoPop< EOT > &  _pop  )  [inline]

Implementation of the operator(), updating a cache of fitnesses.

Calls the virtual function calculate_worths when one of the fitnesses has changed. It is not virtual, but derived classes can remove the fitness caching trough the third template element

Definition at line 125 of file eoPerf2Worth.h.


The documentation for this class was generated from the following file:

Generated on Thu Jan 1 23:19:49 2009 for EvolvingObjects by  doxygen 1.5.5