Handler for box-constraints. More...
#include <shark/ObjectiveFunctions/BoxConstraintHandler.h>
Public Member Functions | |
BoxConstraintHandler (Vector const &lower, Vector const &upper) | |
BoxConstraintHandler (std::size_t dim, double lower, double upper) | |
BoxConstraintHandler () | |
std::size_t | dimensions () const |
bool | isFeasible (Vector const &point) const |
Returns true if the point is in the feasible Region. | |
void | closestFeasible (Vector &point) const |
virtual void | generateRandomPoint (random::rng_type &rng, Vector &startingPoint) const |
If supported, generates a random point inside the feasible region. | |
void | setBounds (Vector const &lower, Vector const &upper) |
Sets lower and upper bounds of the box. | |
void | setBounds (std::size_t dimension, double lower, double upper) |
Sets lower and upper bounds of the box. | |
Vector const & | lower () const |
Returns the lower bound of the box. | |
Vector const & | upper () const |
Returns the upper bound of the box. | |
Public Member Functions inherited from shark::AbstractConstraintHandler< Vector > | |
const Features & | features () const |
virtual void | updateFeatures () |
virtual | ~AbstractConstraintHandler () |
bool | canProvideClosestFeasible () const |
Returns whether this function can calculate the closest feasible to an infeasible point. | |
bool | isBoxConstrained () const |
Returns whether this function is an instance of BoxConstraintHandler. | |
bool | canGenerateRandomPoint () const |
Returns whether this function is an instance of BoxConstraintHandler. | |
Additional Inherited Members | |
Public Types inherited from shark::AbstractConstraintHandler< Vector > | |
enum | Feature |
typedef TypedFlags< Feature > | Features |
typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException |
Protected Attributes inherited from shark::AbstractConstraintHandler< Vector > | |
Features | m_features |
Handler for box-constraints.
Handles box-constraints i.e. function values in \( l_i < x_i < u_i \).
Definition at line 46 of file BoxConstraintHandler.h.
|
inline |
Definition at line 48 of file BoxConstraintHandler.h.
References shark::BoxConstraintHandler< Vector >::lower(), shark::AbstractConstraintHandler< Vector >::m_features, SIZE_CHECK, and shark::BoxConstraintHandler< Vector >::upper().
|
inline |
Definition at line 56 of file BoxConstraintHandler.h.
References shark::AbstractConstraintHandler< Vector >::m_features.
|
inline |
Definition at line 64 of file BoxConstraintHandler.h.
References shark::AbstractConstraintHandler< Vector >::m_features.
|
inlinevirtual |
Reimplemented from shark::AbstractConstraintHandler< Vector >.
Definition at line 83 of file BoxConstraintHandler.h.
References shark::BoxConstraintHandler< Vector >::dimensions(), and SIZE_CHECK.
|
inline |
Definition at line 71 of file BoxConstraintHandler.h.
Referenced by shark::BoxConstraintHandler< Vector >::closestFeasible(), shark::BoxConstraintHandler< Vector >::generateRandomPoint(), shark::BoxConstraintHandler< Vector >::isFeasible(), shark::benchmarks::DTLZ1::numberOfVariables(), shark::benchmarks::DTLZ2::numberOfVariables(), shark::benchmarks::DTLZ3::numberOfVariables(), shark::benchmarks::DTLZ4::numberOfVariables(), shark::benchmarks::DTLZ5::numberOfVariables(), shark::benchmarks::DTLZ6::numberOfVariables(), shark::benchmarks::DTLZ7::numberOfVariables(), shark::benchmarks::Fonseca::numberOfVariables(), shark::benchmarks::GSP::numberOfVariables(), shark::benchmarks::IHR1::numberOfVariables(), shark::benchmarks::IHR2::numberOfVariables(), shark::benchmarks::IHR3::numberOfVariables(), shark::benchmarks::IHR4::numberOfVariables(), shark::benchmarks::IHR6::numberOfVariables(), shark::benchmarks::LZ1::numberOfVariables(), shark::benchmarks::LZ2::numberOfVariables(), shark::benchmarks::LZ3::numberOfVariables(), shark::benchmarks::LZ4::numberOfVariables(), shark::benchmarks::LZ5::numberOfVariables(), shark::benchmarks::LZ6::numberOfVariables(), shark::benchmarks::LZ7::numberOfVariables(), shark::benchmarks::LZ8::numberOfVariables(), shark::benchmarks::LZ9::numberOfVariables(), shark::benchmarks::ZDT1::numberOfVariables(), shark::benchmarks::ZDT2::numberOfVariables(), shark::benchmarks::ZDT3::numberOfVariables(), shark::benchmarks::ZDT4::numberOfVariables(), and shark::benchmarks::ZDT6::numberOfVariables().
|
inlinevirtual |
If supported, generates a random point inside the feasible region.
rng | The random number generator used for generating the point |
startingPoint | The proposed point |
Reimplemented from shark::AbstractConstraintHandler< Vector >.
Definition at line 91 of file BoxConstraintHandler.h.
References shark::BoxConstraintHandler< Vector >::dimensions(), and shark::random::uni().
|
inlinevirtual |
Returns true if the point is in the feasible Region.
This function must be implemented by a ConstraintHandler
Implements shark::AbstractConstraintHandler< Vector >.
Definition at line 75 of file BoxConstraintHandler.h.
References shark::BoxConstraintHandler< Vector >::dimensions(), and SIZE_CHECK.
|
inline |
Returns the lower bound of the box.
Definition at line 111 of file BoxConstraintHandler.h.
Referenced by shark::BoxConstraintHandler< Vector >::BoxConstraintHandler(), shark::IndicatorBasedRealCodedNSGAII< Indicator >::init(), shark::SMSEMOA::init(), shark::BoxConstraintHandler< Vector >::setBounds(), and shark::BoxConstraintHandler< Vector >::setBounds().
|
inline |
Sets lower and upper bounds of the box.
Definition at line 106 of file BoxConstraintHandler.h.
References shark::BoxConstraintHandler< Vector >::lower(), and shark::BoxConstraintHandler< Vector >::upper().
|
inline |
Sets lower and upper bounds of the box.
Definition at line 100 of file BoxConstraintHandler.h.
References shark::BoxConstraintHandler< Vector >::lower(), SIZE_CHECK, and shark::BoxConstraintHandler< Vector >::upper().
Referenced by shark::benchmarks::DTLZ1::setNumberOfVariables(), shark::benchmarks::DTLZ2::setNumberOfVariables(), shark::benchmarks::DTLZ3::setNumberOfVariables(), shark::benchmarks::DTLZ4::setNumberOfVariables(), shark::benchmarks::DTLZ5::setNumberOfVariables(), shark::benchmarks::DTLZ6::setNumberOfVariables(), shark::benchmarks::DTLZ7::setNumberOfVariables(), shark::benchmarks::Fonseca::setNumberOfVariables(), shark::benchmarks::GSP::setNumberOfVariables(), shark::benchmarks::IHR1::setNumberOfVariables(), shark::benchmarks::IHR2::setNumberOfVariables(), shark::benchmarks::IHR3::setNumberOfVariables(), shark::benchmarks::IHR4::setNumberOfVariables(), shark::benchmarks::IHR6::setNumberOfVariables(), shark::benchmarks::LZ1::setNumberOfVariables(), shark::benchmarks::LZ2::setNumberOfVariables(), shark::benchmarks::LZ3::setNumberOfVariables(), shark::benchmarks::LZ4::setNumberOfVariables(), shark::benchmarks::LZ5::setNumberOfVariables(), shark::benchmarks::LZ6::setNumberOfVariables(), shark::benchmarks::LZ7::setNumberOfVariables(), shark::benchmarks::LZ8::setNumberOfVariables(), shark::benchmarks::LZ9::setNumberOfVariables(), shark::benchmarks::ZDT1::setNumberOfVariables(), shark::benchmarks::ZDT2::setNumberOfVariables(), shark::benchmarks::ZDT3::setNumberOfVariables(), shark::benchmarks::ZDT4::setNumberOfVariables(), and shark::benchmarks::ZDT6::setNumberOfVariables().
|
inline |
Returns the upper bound of the box.
Definition at line 115 of file BoxConstraintHandler.h.
Referenced by shark::BoxConstraintHandler< Vector >::BoxConstraintHandler(), shark::BoxConstraintHandler< Vector >::setBounds(), and shark::BoxConstraintHandler< Vector >::setBounds().