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... | |
SearchPointType const & | 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... | |
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... | |
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_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 61 of file Individual.h.
typedef FitnessTypeT shark::Individual< PointType, FitnessTypeT, Chromosome >::FitnessType |
Definition at line 64 of file Individual.h.
typedef PointType shark::Individual< PointType, FitnessTypeT, Chromosome >::SearchPointType |
Definition at line 66 of file Individual.h.
|
inline |
Default constructor that initializes the individual's attributes to default values.
Definition at line 83 of file Individual.h.
|
inline |
Returns a reference to the chromosome that is associated with the individual.
Definition at line 99 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 104 of file Individual.h.
|
inline |
Returns a reference to the penalized fitness of the individual.
Definition at line 119 of file Individual.h.
Referenced by shark::PenalizingEvaluator::operator()().
|
inline |
Returns the unpenalized fitness of the individual.
Definition at line 123 of file Individual.h.
|
inline |
Returns the level of non-dominance of the individual.
Definition at line 128 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 133 of file Individual.h.
|
inline |
Returns a reference to the search point that is associated with the individual.
Definition at line 89 of file Individual.h.
Referenced by shark::PartiallyMappedCrossover::operator()(), 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 94 of file Individual.h.
|
inline |
Returns true if the individual is selected for the next parent generation.
Definition at line 138 of file Individual.h.
Referenced by shark::IndicatorBasedSteadyStateMOCMA< Indicator >::updatePopulation().
|
inline |
Returns true if the individual is selected for the next parent generation.
Definition at line 143 of file Individual.h.
|
inline |
Stores the individual and all of its chromosomes in an archive.
Definition at line 149 of file Individual.h.
|
inline |
Returns a reference to the unpenalized fitness of the individual.
Definition at line 109 of file Individual.h.
Referenced by shark::PenalizingEvaluator::operator()(), and shark::Individual< PointType, FitnessTypeT, Chromosome >::FitnessOrdering::operator()().
|
inline |
Returns the unpenalized fitness of the individual.
Definition at line 114 of file Individual.h.
|
friend |
Definition at line 159 of file Individual.h.
|
protected |
The search point associated with the individual.
Definition at line 171 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 176 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 173 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 170 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 174 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 177 of file Individual.h.
Referenced by shark::Individual< RealVector, FitnessType, CMAChromosome >::serialize(), and shark::Individual< RealVector, FitnessType, CMAChromosome >::unpenalizedFitness().