Penalizing evaluator for scalar objective functions. More...
#include <shark/Algorithms/DirectSearch/Operators/Evaluation/PenalizingEvaluator.h>
Public Member Functions | |
PenalizingEvaluator () | |
Default c'tor, initializes the penalty factor to \(10^{-6}\). More... | |
template<typename Function , typename IndividualType > | |
void | operator() (Function const &f, IndividualType &individual) const |
Evaluates the supplied function on the supplied individual. More... | |
template<typename Function , typename Iterator > | |
void | operator() (Function const &f, Iterator begin, Iterator end) const |
Evaluates The function on individuals in the range [first,last]. More... | |
template<class SearchPointType > | |
void | penalize (SearchPointType const &s, SearchPointType const &t, double &fitness) const |
template<class SearchPointType > | |
void | penalize (SearchPointType const &s, SearchPointType const &t, RealVector &fitness) const |
template<typename Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Stores/loads the evaluator's state. More... | |
Public Attributes | |
double | m_penaltyFactor |
Penalty factor \(\alpha\), default value: \(10^{-6}\) . More... | |
std::size_t | m_numEvaluations |
Number of Evaluations on a noisy function. More... | |
Penalizing evaluator for scalar objective functions.
Evaluates the supplied single-objective function \(f\) for the search point \(s\) according to:
\begin{align*} y & = & f( s' )\\ y' & = & f( s' ) + \alpha \vert\vert s - s' \vert\vert_2^2 \end{align*}
where \(s'\) is the repaired version of \(s\) if \(s\) is not feasible and equal to \(s\) otherwise. The default value of \(\alpha\) is \(10^{-6}\).
This Evaluator can also handle noisy functions by applying reevaluations of a single point on f and averaging the results.
Definition at line 57 of file PenalizingEvaluator.h.
|
inline |
Default c'tor, initializes the penalty factor to \(10^{-6}\).
Definition at line 61 of file PenalizingEvaluator.h.
|
inline |
Evaluates the supplied function on the supplied individual.
[in] | f | The function to be evaluated. |
[in] | individual | The individual to evaluate the function for. |
Definition at line 70 of file PenalizingEvaluator.h.
References m_numEvaluations, penalize(), shark::Individual< PointType, FitnessTypeT, Chromosome >::penalizedFitness(), shark::Individual< PointType, FitnessTypeT, Chromosome >::searchPoint(), and shark::Individual< PointType, FitnessTypeT, Chromosome >::unpenalizedFitness().
|
inline |
Evaluates The function on individuals in the range [first,last].
[in] | f | The function to be evaluated. |
[in] | begin | first indivdual in the range to be evaluated |
[in] | end | iterator pointing directly beehind the last individual to be evaluated |
Definition at line 93 of file PenalizingEvaluator.h.
|
inline |
Definition at line 100 of file PenalizingEvaluator.h.
References m_penaltyFactor.
Referenced by operator()().
|
inline |
Definition at line 105 of file PenalizingEvaluator.h.
References m_penaltyFactor.
|
inline |
Stores/loads the evaluator's state.
Archive | The type of the archive. |
[in,out] | archive | The archive to use for loading/storing. |
[in] | version | Currently unused. |
Definition at line 117 of file PenalizingEvaluator.h.
References m_penaltyFactor.
std::size_t shark::PenalizingEvaluator::m_numEvaluations |
Number of Evaluations on a noisy function.
Definition at line 122 of file PenalizingEvaluator.h.
Referenced by operator()().
double shark::PenalizingEvaluator::m_penaltyFactor |
Penalty factor \(\alpha\), default value: \(10^{-6}\) .
Definition at line 121 of file PenalizingEvaluator.h.
Referenced by shark::ElitistCMA::constrainedPenaltyFactor(), penalize(), and serialize().