shark::IndicatorBasedRealCodedNSGAII< Indicator > Class Template Reference

Implements the NSGA-II. More...

#include <shark/Algorithms/DirectSearch/RealCodedNSGAII.h>

+ Inheritance diagram for shark::IndicatorBasedRealCodedNSGAII< Indicator >:

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...
 
- Public Member Functions inherited from shark::AbstractMultiObjectiveOptimizer< RealVector >
virtual ~AbstractMultiObjectiveOptimizer ()
 Virtual empty d'tor. More...
 
const SolutionTypesolution () const
 Accesses the current approximation of the Pareto-set and -front, respectively. More...
 
- Public Member Functions inherited from shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >
const Featuresfeatures () 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...
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
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< IndividualTypegenerateOffspring () const
 
void updatePopulation (std::vector< IndividualType > const &offspringVec)
 Executes one iteration of the algorithm. More...
 
- Protected Member Functions inherited from shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >
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...
 

Additional Inherited Members

- Public Types inherited from shark::AbstractMultiObjectiveOptimizer< RealVector >
typedef super::SearchPointType SearchPointType
 
typedef super::SolutionType SolutionType
 
typedef super::ObjectiveFunctionType ObjectiveFunctionType
 
- Public Types inherited from shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >
enum  Feature
 Models features that the optimizer requires from the objective function. More...
 
typedef RealVector SearchPointType
 
typedef RealVector ResultType
 
typedef std::vector< ResultSet< RealVector, RealVector > > SolutionType
 
typedef AbstractObjectiveFunction< RealVector, ResultTypeObjectiveFunctionType
 
typedef TypedFlags< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Protected Attributes inherited from shark::AbstractMultiObjectiveOptimizer< RealVector >
SolutionType m_best
 The current Pareto-set/-front. More...
 
- Protected Attributes inherited from shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >
Features m_features
 

Detailed Description

template<typename Indicator>
class shark::IndicatorBasedRealCodedNSGAII< Indicator >

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.

Member Typedef Documentation

§ IndividualType

template<typename Indicator >
typedef shark::Individual<RealVector,RealVector> shark::IndicatorBasedRealCodedNSGAII< Indicator >::IndividualType
protected

The individual type of the NSGA-II.

Definition at line 186 of file RealCodedNSGAII.h.

Constructor & Destructor Documentation

§ IndicatorBasedRealCodedNSGAII()

Member Function Documentation

§ crossoverProbability() [1/2]

template<typename Indicator >
double shark::IndicatorBasedRealCodedNSGAII< Indicator >::crossoverProbability ( ) const
inline

§ crossoverProbability() [2/2]

template<typename Indicator >
double& shark::IndicatorBasedRealCodedNSGAII< Indicator >::crossoverProbability ( )
inline

Returns the probability that crossover is applied.

Definition at line 83 of file RealCodedNSGAII.h.

§ doInit()

template<typename Indicator >
void shark::IndicatorBasedRealCodedNSGAII< Indicator >::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 
)
inlineprotected

§ generateOffspring()

template<typename Indicator >
std::vector<IndividualType> shark::IndicatorBasedRealCodedNSGAII< Indicator >::generateOffspring ( ) const
inlineprotected

§ init() [1/2]

template<typename Indicator >
void shark::IndicatorBasedRealCodedNSGAII< Indicator >::init ( ObjectiveFunctionType function)
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.

Parameters
functionThe function to be initialized for.
Exceptions
Exceptionif 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.

§ init() [2/2]

§ mu() [1/2]

§ mu() [2/2]

template<typename Indicator >
std::size_t& shark::IndicatorBasedRealCodedNSGAII< Indicator >::mu ( )
inline

Definition at line 104 of file RealCodedNSGAII.h.

§ name()

template<typename Indicator >
std::string shark::IndicatorBasedRealCodedNSGAII< Indicator >::name ( ) const
inlinevirtual

returns the name of the object

Reimplemented from shark::INameable.

Definition at line 74 of file RealCodedNSGAII.h.

§ nc() [1/2]

§ nc() [2/2]

template<typename Indicator >
double& shark::IndicatorBasedRealCodedNSGAII< Indicator >::nc ( )
inline

§ nm() [1/2]

§ nm() [2/2]

template<typename Indicator >
double& shark::IndicatorBasedRealCodedNSGAII< Indicator >::nm ( )
inline

Definition at line 90 of file RealCodedNSGAII.h.

References shark::PolynomialMutator::m_nm.

§ read()

template<typename Indicator >
void shark::IndicatorBasedRealCodedNSGAII< Indicator >::read ( InArchive archive)
inlinevirtual

Read the component from the supplied archive.

Parameters
[in,out]archiveThe archive to read from.

Reimplemented from shark::ISerializable.

Definition at line 108 of file RealCodedNSGAII.h.

References shark::AbstractMultiObjectiveOptimizer< RealVector >::m_best.

§ step()

template<typename Indicator >
void shark::IndicatorBasedRealCodedNSGAII< Indicator >::step ( ObjectiveFunctionType const &  function)
inlinevirtual

§ updatePopulation()

template<typename Indicator >
void shark::IndicatorBasedRealCodedNSGAII< Indicator >::updatePopulation ( std::vector< IndividualType > const &  offspringVec)
inlineprotected

§ write()

template<typename Indicator >
void shark::IndicatorBasedRealCodedNSGAII< Indicator >::write ( OutArchive archive) const
inlinevirtual

Write the component to the supplied archive.

Parameters
[in,out]archiveThe archive to write to.

Reimplemented from shark::ISerializable.

Definition at line 118 of file RealCodedNSGAII.h.

References shark::AbstractMultiObjectiveOptimizer< RealVector >::m_best.


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