shark::RVEA Class Reference

Implements the RVEA algorithm. More...

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

+ Inheritance diagram for shark::RVEA:

Public Member Functions

SHARK_EXPORT_SYMBOL RVEA (random::rng_type &rng=random::globalRng)
 
std::string name () const
 returns the name of the object More...
 
double crossoverProbability () const
 
double & crossoverProbability ()
 
double nm () const
 
double & nm ()
 
double nc () const
 
double & nc ()
 
double alpha () const
 
double & alpha ()
 
double adaptationFrequency () const
 
double & adaptationFrequency ()
 
std::size_t mu () const
 Size of parent population and number of reference vectors. More...
 
std::size_t numInitPoints () const
 Returns the number of points this method requires for initialisation. More...
 
std::size_t approxMu () const
 
std::size_t & approxMu ()
 
RealMatrix referenceVectors () const
 
RealMatrix & referenceVectors ()
 
RealMatrix initialReferenceVectors () const
 
std::size_t maxIterations () const
 
std::size_t & maxIterations ()
 
bool willAdaptReferenceVectors () const
 True if the reference vectors will be adapted. More...
 
template<typename Archive >
void serialize (Archive &archive)
 
SHARK_EXPORT_SYMBOL void init (ObjectiveFunctionType const &function, std::vector< SearchPointType > const &initialSearchPoints)
 Initialize the optimizer for the supplied objective function using a set of initialisation points. More...
 
SHARK_EXPORT_SYMBOL void step (ObjectiveFunctionType const &function)
 Carry out one step of the optimizer for the supplied objective function. More...
 
- Public Member Functions inherited from shark::AbstractMultiObjectiveOptimizer< RealVector >
SolutionType const & solution () 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 ()
 
virtual void init (ObjectiveFunctionType const &function)
 Initialize the optimizer for the supplied objective function. More...
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. More...
 
virtual void read (InArchive &archive)
 Read the component from the supplied archive. More...
 
virtual void write (OutArchive &archive) const
 Write the component to the supplied archive. 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 ()
 

Static Public Member Functions

static SHARK_EXPORT_SYMBOL std::size_t suggestMu (std::size_t n, std::size_t const approx_mu)
 

Protected Types

typedef shark::Individual< RealVector, RealVector > IndividualType
 

Protected Member Functions

SHARK_EXPORT_SYMBOL void doInit (std::vector< SearchPointType > const &initialSearchPoints, std::vector< ResultType > const &functionValues, RealVector const &lowerBounds, RealVector const &upperBounds, std::size_t const approx_mu, double const nm, double const nc, double const crossover_prob, double const alph, double const fr, std::size_t const max_iterations, std::vector< Preference > const &referenceVectorsPreferences=std::vector< Preference >())
 
SHARK_EXPORT_SYMBOL std::vector< IndividualTypegenerateOffspring () const
 
SHARK_EXPORT_SYMBOL void updatePopulation (std::vector< IndividualType > const &offspringvec)
 
- 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...
 

Protected Attributes

std::vector< IndividualTypem_parents
 
- 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
 

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
 

Detailed Description

Implements the RVEA algorithm.

Implementation of the RVEA algorithm from the following paper: R. Cheng, Y. Jin, M. Olhofer, and B. Sendhoff, “A reference vector guided evolutionary algorithm for many-objective optimization,” IEEE Transactions on Evolutionary Computation, Vol 20, Issue 5, October 2016 http://dx.doi.org/10.1109/TEVC.2016.2519378

Definition at line 55 of file RVEA.h.

Member Typedef Documentation

◆ IndividualType

typedef shark::Individual<RealVector, RealVector> shark::RVEA::IndividualType
protected

Definition at line 192 of file RVEA.h.

Constructor & Destructor Documentation

◆ RVEA()

SHARK_EXPORT_SYMBOL shark::RVEA::RVEA ( random::rng_type &  rng = random::globalRng)

Member Function Documentation

◆ adaptationFrequency() [1/2]

double shark::RVEA::adaptationFrequency ( ) const
inline

Definition at line 96 of file RVEA.h.

Referenced by willAdaptReferenceVectors().

◆ adaptationFrequency() [2/2]

double& shark::RVEA::adaptationFrequency ( )
inline

Definition at line 100 of file RVEA.h.

◆ alpha() [1/2]

double shark::RVEA::alpha ( ) const
inline

Definition at line 88 of file RVEA.h.

◆ alpha() [2/2]

double& shark::RVEA::alpha ( )
inline

Definition at line 92 of file RVEA.h.

◆ approxMu() [1/2]

std::size_t shark::RVEA::approxMu ( ) const
inline

Definition at line 121 of file RVEA.h.

◆ approxMu() [2/2]

std::size_t& shark::RVEA::approxMu ( )
inline

Definition at line 125 of file RVEA.h.

◆ crossoverProbability() [1/2]

double shark::RVEA::crossoverProbability ( ) const
inline

Definition at line 64 of file RVEA.h.

◆ crossoverProbability() [2/2]

double& shark::RVEA::crossoverProbability ( )
inline

Definition at line 68 of file RVEA.h.

◆ doInit()

SHARK_EXPORT_SYMBOL void shark::RVEA::doInit ( std::vector< SearchPointType > const &  initialSearchPoints,
std::vector< ResultType > const &  functionValues,
RealVector const &  lowerBounds,
RealVector const &  upperBounds,
std::size_t const  approx_mu,
double const  nm,
double const  nc,
double const  crossover_prob,
double const  alph,
double const  fr,
std::size_t const  max_iterations,
std::vector< Preference > const &  referenceVectorsPreferences = std::vector< Preference >() 
)
protected

◆ generateOffspring()

SHARK_EXPORT_SYMBOL std::vector<IndividualType> shark::RVEA::generateOffspring ( ) const
protected

◆ init()

SHARK_EXPORT_SYMBOL void shark::RVEA::init ( ObjectiveFunctionType const &  function,
std::vector< SearchPointType > const &  initPoints 
)
virtual

Initialize the optimizer for the supplied objective function using a set of initialisation points.

Most single objective algorithms only require a single point. However multi-objective algorithms need a set of initialisation points. The number of points required should be numInitPoints(). Otherwise the algorithm might use heuristics to generate additional points if needed.

Be aware that function.init() has to be called before calling this function!

Parameters
[in]functionThe objective function to initialize for.
[in]initPointspoints used for initialisation. Should be at least numInitPoints().

Implements shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >.

Referenced by serialize().

◆ initialReferenceVectors()

RealMatrix shark::RVEA::initialReferenceVectors ( ) const
inline

Definition at line 137 of file RVEA.h.

◆ maxIterations() [1/2]

std::size_t shark::RVEA::maxIterations ( ) const
inline

Definition at line 141 of file RVEA.h.

◆ maxIterations() [2/2]

std::size_t& shark::RVEA::maxIterations ( )
inline

Definition at line 145 of file RVEA.h.

◆ mu()

std::size_t shark::RVEA::mu ( ) const
inline

Size of parent population and number of reference vectors.

In the RVEA algorithm, the exact mu value is determined by the simplex-lattice design (Lattice.h), so the user cannot set it directly. Instead, one must set the approxMu() value, which will be used as a parameter in the lattice. If one wants to know the exact mu value, set approxMu() to RVEA::suggestMu(n, m) where n is the objective dimension and m is the approximate mu. Then the actual mu value will not be changed in the initialization.

Definition at line 113 of file RVEA.h.

◆ name()

std::string shark::RVEA::name ( ) const
inlinevirtual

returns the name of the object

Reimplemented from shark::INameable.

Definition at line 60 of file RVEA.h.

◆ nc() [1/2]

double shark::RVEA::nc ( ) const
inline

Definition at line 80 of file RVEA.h.

References shark::SimulatedBinaryCrossover< PointType >::m_nc.

◆ nc() [2/2]

double& shark::RVEA::nc ( )
inline

Definition at line 84 of file RVEA.h.

References shark::SimulatedBinaryCrossover< PointType >::m_nc.

◆ nm() [1/2]

double shark::RVEA::nm ( ) const
inline

Definition at line 72 of file RVEA.h.

References shark::PolynomialMutator::m_nm.

◆ nm() [2/2]

double& shark::RVEA::nm ( )
inline

Definition at line 76 of file RVEA.h.

References shark::PolynomialMutator::m_nm.

◆ numInitPoints()

std::size_t shark::RVEA::numInitPoints ( ) const
inlinevirtual

Returns the number of points this method requires for initialisation.

The number of points supplied is allowed to be smaller, however in this case the optimizer will resort to techniques generating additional points if needed.

Implements shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >.

Definition at line 117 of file RVEA.h.

◆ referenceVectors() [1/2]

RealMatrix shark::RVEA::referenceVectors ( ) const
inline

Definition at line 129 of file RVEA.h.

◆ referenceVectors() [2/2]

RealMatrix& shark::RVEA::referenceVectors ( )
inline

Definition at line 133 of file RVEA.h.

◆ serialize()

template<typename Archive >
void shark::RVEA::serialize ( Archive &  archive)
inline

◆ step()

SHARK_EXPORT_SYMBOL void shark::RVEA::step ( ObjectiveFunctionType const &  function)
virtual

Carry out one step of the optimizer for the supplied objective function.

Parameters
[in]functionThe objective function to initialize for.

Implements shark::AbstractOptimizer< RealVector, RealVector, std::vector< ResultSet< RealVector, RealVector > > >.

Referenced by serialize().

◆ suggestMu()

static SHARK_EXPORT_SYMBOL std::size_t shark::RVEA::suggestMu ( std::size_t  n,
std::size_t const  approx_mu 
)
static

Referenced by serialize().

◆ updatePopulation()

SHARK_EXPORT_SYMBOL void shark::RVEA::updatePopulation ( std::vector< IndividualType > const &  offspringvec)
protected

◆ willAdaptReferenceVectors()

bool shark::RVEA::willAdaptReferenceVectors ( ) const
inline

True if the reference vectors will be adapted.

Returns true if the algorithm will adapt the unit reference vectors in the current iteration. This is controlled by the adaptationFreqency() parameter; a value of, e.g., 0.2 will make the algorithm readapt reference vectors every 20% of the iteration. Running the algorithm for 1000 iterations will then make it readapt on iteration 0, 200, 400, etc.

Definition at line 156 of file RVEA.h.

References adaptationFrequency().

Member Data Documentation

◆ m_parents

std::vector<IndividualType> shark::RVEA::m_parents
protected

Definition at line 213 of file RVEA.h.

Referenced by serialize().


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