Individual is a simple templated class modelling an individual that acts as a candidate solution in an evolutionary algorithm. More...
#include <shark/Algorithms/DirectSearch/Individual.h>
Classes | |
struct | FitnessOrdering |
Ordering relation by the fitness of the individuals(only single objective) More... | |
struct | RankOrdering |
Ordering relation by the ranks of the individuals. More... | |
Public Types | |
typedef FitnessTypeT | FitnessType |
typedef PointType | SearchPointType |
Public Member Functions | |
Individual () | |
Default constructor that initializes the individual's attributes to default values. More... | |
SearchPointType & | searchPoint () |
Returns a reference to the search point that is associated with the individual. More... | |
const SearchPointType & | searchPoint () const |
Returns a const reference to the search point that is associated with the individual. More... | |
Chromosome & | chromosome () |
Returns a reference to the chromosome that is associated with the individual. More... | |
Chromosome const & | chromosome () const |
Returns a const reference to the chromosome that is associated with the individual. More... | |
unsigned int | age () const |
Returns the age of the individual (in generations). More... | |
unsigned int & | age () |
Returns a reference to the age of the individual (in generations). More... | |
FitnessType & | unpenalizedFitness () |
Returns a reference to the unpenalized fitness of the individual. More... | |
FitnessType const & | unpenalizedFitness () const |
Returns the unpenalized fitness of the individual. More... | |
FitnessType & | penalizedFitness () |
Returns a reference to the penalized fitness of the individual. More... | |
FitnessType const & | penalizedFitness () const |
Returns the unpenalized fitness of the individual. More... | |
unsigned int | rank () const |
Returns the level of non-dominance of the individual. More... | |
unsigned int & | rank () |
Returns a reference to the level of non-dominance of the individual. Allows for lvalue()-semantic. More... | |
bool | selected () const |
Returns true if the individual is selected for the next parent generation. More... | |
bool & | selected () |
Returns true if the individual is selected for the next parent generation. More... | |
template<typename Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Stores the individual and all of its chromosomes in an archive. More... | |
Static Public Member Functions | |
static bool | IsSelected (Individual const &individual) |
returns true if the individual is selected for the next parent set More... | |
Protected Attributes | |
SearchPointType | m_searchPoint |
The search point associated with the individual. More... | |
Chromosome | m_chromosome |
The search point associated with the individual. More... | |
unsigned int | m_age |
The age of the individual (in generations). More... | |
unsigned int | m_rank |
The level of non-dominance of the individual. The lower the better. More... | |
bool | m_selected |
Is the individual selected for the next parent set? More... | |
FitnessType | m_penalizedFitness |
Penalized fitness of the individual. More... | |
FitnessType | m_unpenalizedFitness |
Unpenalized fitness of the individual. More... | |
Friends | |
void | swap (Individual &i1, Individual &i2) |
Individual is a simple templated class modelling an individual that acts as a candidate solution in an evolutionary algorithm.
The class holds the current search point as well as the penalized and unpenalized fitness, its domination rank with respect to the population, its age, a boolean variable determining whether the individual is selected for the next parent generation and some payload chromosome which is by default a RealVector.
The states mean the following:
Definition at line 62 of file Individual.h.
typedef FitnessTypeT shark::Individual< PointType, FitnessTypeT, Chromosome >::FitnessType |
Definition at line 65 of file Individual.h.
typedef PointType shark::Individual< PointType, FitnessTypeT, Chromosome >::SearchPointType |
Definition at line 67 of file Individual.h.
|
inline |
Default constructor that initializes the individual's attributes to default values.
Definition at line 92 of file Individual.h.
|
inline |
Returns the age of the individual (in generations).
Definition at line 129 of file Individual.h.
|
inline |
Returns a reference to the age of the individual (in generations).
Definition at line 136 of file Individual.h.
|
inline |
Returns a reference to the chromosome that is associated with the individual.
Definition at line 115 of file Individual.h.
Referenced by main(), and shark::ElitistCMA::sigma().
|
inline |
Returns a const reference to the chromosome that is associated with the individual.
Definition at line 122 of file Individual.h.
|
inlinestatic |
returns true if the individual is selected for the next parent set
Definition at line 71 of file Individual.h.
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::updatePopulation().
|
inline |
Returns a reference to the penalized fitness of the individual.
Definition at line 157 of file Individual.h.
Referenced by shark::FitnessExtractor::operator()(), and shark::PenalizingEvaluator::operator()().
|
inline |
Returns the unpenalized fitness of the individual.
Definition at line 163 of file Individual.h.
|
inline |
Returns the level of non-dominance of the individual.
Definition at line 170 of file Individual.h.
Referenced by shark::Individual< PointType, FitnessTypeT, Chromosome >::RankOrdering::operator()(), and shark::IndicatorBasedSteadyStateMOCMA< Indicator >::updatePopulation().
|
inline |
Returns a reference to the level of non-dominance of the individual. Allows for lvalue()-semantic.
Definition at line 177 of file Individual.h.
|
inline |
Returns a reference to the search point that is associated with the individual.
Definition at line 101 of file Individual.h.
Referenced by shark::compare_fitness(), main(), shark::PolynomialMutator::operator()(), shark::SimulatedBinaryCrossover< RealVector >::operator()(), shark::BitflipMutator::operator()(), and shark::PenalizingEvaluator::operator()().
|
inline |
Returns a const reference to the search point that is associated with the individual.
Definition at line 108 of file Individual.h.
|
inline |
Returns true if the individual is selected for the next parent generation.
Definition at line 184 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::IsSelected(), and shark::IndicatorBasedSteadyStateMOCMA< Indicator >::updatePopulation().
|
inline |
Returns true if the individual is selected for the next parent generation.
Definition at line 191 of file Individual.h.
|
inline |
Stores the individual and all of its chromosomes in an archive.
Definition at line 199 of file Individual.h.
|
inline |
Returns a reference to the unpenalized fitness of the individual.
Definition at line 143 of file Individual.h.
Referenced by shark::compare_fitness(), shark::PenalizingEvaluator::operator()(), and shark::Individual< PointType, FitnessTypeT, Chromosome >::FitnessOrdering::operator()().
|
inline |
Returns the unpenalized fitness of the individual.
Definition at line 150 of file Individual.h.
|
friend |
Definition at line 210 of file Individual.h.
|
protected |
The age of the individual (in generations).
Definition at line 225 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::age(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize().
|
protected |
The search point associated with the individual.
Definition at line 223 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::chromosome(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize().
|
protected |
Penalized fitness of the individual.
Definition at line 229 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::penalizedFitness(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize().
|
protected |
The level of non-dominance of the individual. The lower the better.
Definition at line 226 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::rank(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize().
|
protected |
The search point associated with the individual.
Definition at line 222 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::searchPoint(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize().
|
protected |
Is the individual selected for the next parent set?
Definition at line 227 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::selected(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize().
|
protected |
Unpenalized fitness of the individual.
Definition at line 230 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::unpenalizedFitness().