Implements the NSGA-II. More...
#include <shark/Algorithms/DirectSearch/RealCodedNSGAII.h>
Public Member Functions | |
IndicatorBasedRealCodedNSGAII (DefaultRngType &rng=Rng::globalRng) | |
Default c'tor. More... | |
std::string | name () const |
returns the name of the object More... | |
double | crossoverProbability () const |
Returns the probability that crossover is applied. More... | |
double & | crossoverProbability () |
Returns the probability that crossover is applied. More... | |
double | nm () const |
double & | nm () |
double | nc () const |
double & | nc () |
std::size_t | mu () const |
std::size_t & | mu () |
void | read (InArchive &archive) |
Read the component from the supplied archive. More... | |
void | write (OutArchive &archive) const |
Write the component to the supplied archive. More... | |
void | init (ObjectiveFunctionType &function) |
Initializes the optimizer for the supplied objective function. More... | |
void | init (ObjectiveFunctionType &function, std::vector< SearchPointType > const &initialSearchPoints) |
Initializes the algorithm for the supplied objective function. More... | |
void | step (ObjectiveFunctionType const &function) |
Executes one iteration of the algorithm. More... | |
![]() | |
virtual | ~AbstractMultiObjectiveOptimizer () |
Virtual empty d'tor. More... | |
const SolutionType & | solution () const |
Accesses the current approximation of the Pareto-set and -front, respectively. More... | |
![]() | |
const Features & | features () const |
virtual void | updateFeatures () |
bool | requiresValue () const |
bool | requiresFirstDerivative () const |
bool | requiresSecondDerivative () const |
bool | canSolveConstrained () const |
bool | requiresClosestFeasible () const |
virtual | ~AbstractOptimizer () |
Empty virtual d'tor. More... | |
![]() | |
virtual | ~INameable () |
![]() | |
virtual | ~ISerializable () |
Virtual d'tor. More... | |
void | load (InArchive &archive, unsigned int version) |
Versioned loading of components, calls read(...). More... | |
void | save (OutArchive &archive, unsigned int version) const |
Versioned storing of components, calls write(...). More... | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Protected Types | |
typedef shark::Individual< RealVector, RealVector > | IndividualType |
The individual type of the NSGA-II. More... | |
Protected Member Functions | |
void | doInit (std::vector< SearchPointType > const &initialSearchPoints, std::vector< ResultType > const &functionValues, RealVector const &lowerBounds, RealVector const &upperBounds, std::size_t mu, double nm, double nc, double crossover_prob) |
std::vector< IndividualType > | generateOffspring () const |
void | updatePopulation (std::vector< IndividualType > const &offspringVec) |
Executes one iteration of the algorithm. More... | |
![]() | |
void | checkFeatures (ObjectiveFunctionType const &objectiveFunction) |
Convenience function that checks whether the features of the supplied objective function match with the required features of the optimizer. More... | |
Implements the NSGA-II.
Please see the following papers for further reference: Deb, Agrawal, Pratap and Meyarivan. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. 6, NO. 2, APRIL 2002
Definition at line 60 of file RealCodedNSGAII.h.
|
protected |
The individual type of the NSGA-II.
Definition at line 186 of file RealCodedNSGAII.h.
|
inline |
Default c'tor.
Definition at line 66 of file RealCodedNSGAII.h.
References shark::IndicatorBasedRealCodedNSGAII< Indicator >::crossoverProbability(), shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >::m_features, shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::nc(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::nm().
|
inline |
Returns the probability that crossover is applied.
Definition at line 79 of file RealCodedNSGAII.h.
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::IndicatorBasedRealCodedNSGAII(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::init().
|
inline |
Returns the probability that crossover is applied.
Definition at line 83 of file RealCodedNSGAII.h.
|
inlineprotected |
Definition at line 188 of file RealCodedNSGAII.h.
References shark::discrete(), shark::PolynomialMutator::init(), shark::SimulatedBinaryCrossover< PointType >::init(), shark::AbstractMultiObjectiveOptimizer< RealVector >::m_best, shark::SimulatedBinaryCrossover< PointType >::m_nc, shark::PolynomialMutator::m_nm, shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::nc(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::nm(), and SIZE_CHECK.
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::init().
|
inlineprotected |
Definition at line 233 of file RealCodedNSGAII.h.
References shark::coinToss(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu().
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::step().
|
inlinevirtual |
Initializes the optimizer for the supplied objective function.
Tries to sample an initial starting point. If the function does not implement this feature, an exception is thrown. Otherwise, the call is dispatched to the pure-virtual function.
function | The function to be initialized for. |
Exception | if the function does not feature the proposal of starting points. |
Reimplemented from shark::AbstractMultiObjectiveOptimizer< RealVector >.
Definition at line 129 of file RealCodedNSGAII.h.
References shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >::checkFeatures(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu(), and SHARKEXCEPTION.
|
inlinevirtual |
Initializes the algorithm for the supplied objective function.
[in] | function | The objective function. |
[in] | initialSearchPoints | A set of intiial search points. |
Implements shark::AbstractMultiObjectiveOptimizer< RealVector >.
Definition at line 145 of file RealCodedNSGAII.h.
References shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >::checkFeatures(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::crossoverProbability(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::doInit(), shark::BoxConstraintHandler< Vector >::lower(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::nc(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::nm(), and SHARKEXCEPTION.
|
inline |
Definition at line 101 of file RealCodedNSGAII.h.
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::doInit(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::generateOffspring(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::IndicatorBasedRealCodedNSGAII(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::init(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::updatePopulation().
|
inline |
Definition at line 104 of file RealCodedNSGAII.h.
|
inlinevirtual |
returns the name of the object
Reimplemented from shark::INameable.
Definition at line 74 of file RealCodedNSGAII.h.
|
inline |
Definition at line 94 of file RealCodedNSGAII.h.
References shark::SimulatedBinaryCrossover< PointType >::m_nc.
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::doInit(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::IndicatorBasedRealCodedNSGAII(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::init().
|
inline |
Definition at line 97 of file RealCodedNSGAII.h.
References shark::SimulatedBinaryCrossover< PointType >::m_nc.
|
inline |
Definition at line 87 of file RealCodedNSGAII.h.
References shark::PolynomialMutator::m_nm.
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::doInit(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::IndicatorBasedRealCodedNSGAII(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::init().
|
inline |
Definition at line 90 of file RealCodedNSGAII.h.
References shark::PolynomialMutator::m_nm.
|
inlinevirtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Definition at line 108 of file RealCodedNSGAII.h.
References shark::AbstractMultiObjectiveOptimizer< RealVector >::m_best.
|
inlinevirtual |
Executes one iteration of the algorithm.
[in] | function | The function to iterate upon. |
Implements shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >.
Definition at line 178 of file RealCodedNSGAII.h.
References shark::IndicatorBasedRealCodedNSGAII< Indicator >::generateOffspring(), and shark::IndicatorBasedRealCodedNSGAII< Indicator >::updatePopulation().
|
inlineprotected |
Executes one iteration of the algorithm.
[in] | function | The function to iterate upon. |
Definition at line 260 of file RealCodedNSGAII.h.
References shark::Individual< PointType, FitnessTypeT, Chromosome >::IsSelected(), shark::AbstractMultiObjectiveOptimizer< RealVector >::m_best, shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu(), and shark::blas::noalias().
Referenced by shark::IndicatorBasedRealCodedNSGAII< Indicator >::step().
|
inlinevirtual |
Write the component to the supplied archive.
[in,out] | archive | The archive to write to. |
Reimplemented from shark::ISerializable.
Definition at line 118 of file RealCodedNSGAII.h.
References shark::AbstractMultiObjectiveOptimizer< RealVector >::m_best.