Implements the base class for constraint handling. More...
#include <shark/ObjectiveFunctions/AbstractConstraintHandler.h>
Public Types | |
enum | Feature { CAN_PROVIDE_CLOSEST_FEASIBLE = 1, IS_BOX_CONSTRAINED = 2, CAN_GENERATE_RANDOM_POINT = 4 } |
typedef TypedFlags< Feature > | Features |
typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException |
Public Member Functions | |
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. More... | |
bool | isBoxConstrained () const |
Returns whether this function is an instance of BoxConstraintHandler. More... | |
bool | canGenerateRandomPoint () const |
Returns whether this function is an instance of BoxConstraintHandler. More... | |
virtual void | generateRandomPoint (random::rng_type &rng, SearchPointType &startingPoint) const |
If supported, generates a random point inside the feasible region. More... | |
virtual bool | isFeasible (SearchPointType const &) const =0 |
Returns true if the point is in the feasible Region. More... | |
virtual void | closestFeasible (SearchPointType &) const |
Protected Attributes | |
Features | m_features |
Implements the base class for constraint handling.
A constraint handler provides information about the feasible region of a constrained optimization problem. In the minimum it checks whether a point is feasible, or what the next fasible point would be.
Definition at line 48 of file AbstractConstraintHandler.h.
typedef TypedFeatureNotAvailableException<Feature> shark::AbstractConstraintHandler< SearchPointType >::FeatureNotAvailableException |
Definition at line 55 of file AbstractConstraintHandler.h.
typedef TypedFlags<Feature> shark::AbstractConstraintHandler< SearchPointType >::Features |
Definition at line 55 of file AbstractConstraintHandler.h.
enum shark::AbstractConstraintHandler::Feature |
Enumerator | |
---|---|
CAN_PROVIDE_CLOSEST_FEASIBLE | The constraint handler can provide a close feasible point to an infeasible one. |
IS_BOX_CONSTRAINED | The constraint handler is an instance of BoxConstraintHandler. |
CAN_GENERATE_RANDOM_POINT | The ConstraintHandler can generate a random point inside the feasible region. |
Definition at line 50 of file AbstractConstraintHandler.h.
|
inlinevirtual |
Definition at line 57 of file AbstractConstraintHandler.h.
|
inline |
Returns whether this function is an instance of BoxConstraintHandler.
Definition at line 69 of file AbstractConstraintHandler.h.
Referenced by shark::AbstractObjectiveFunction< SearchSpaceType, ResultT >::announceConstraintHandler().
|
inline |
Returns whether this function can calculate the closest feasible to an infeasible point.
Definition at line 60 of file AbstractConstraintHandler.h.
Referenced by shark::AbstractObjectiveFunction< SearchSpaceType, ResultT >::announceConstraintHandler().
|
inlinevirtual |
Reimplemented in shark::BoxConstraintHandler< Vector >, shark::BoxConstraintHandler< RealVector >, and shark::BoxConstraintHandler< SearchPointType >.
Definition at line 85 of file AbstractConstraintHandler.h.
|
inline |
Definition at line 55 of file AbstractConstraintHandler.h.
|
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 in shark::BoxConstraintHandler< Vector >, shark::BoxConstraintHandler< RealVector >, and shark::BoxConstraintHandler< SearchPointType >.
Definition at line 77 of file AbstractConstraintHandler.h.
|
inline |
Returns whether this function is an instance of BoxConstraintHandler.
Definition at line 65 of file AbstractConstraintHandler.h.
|
pure virtual |
Returns true if the point is in the feasible Region.
This function must be implemented by a ConstraintHandler
Implemented in shark::BoxConstraintHandler< Vector >, shark::BoxConstraintHandler< RealVector >, and shark::BoxConstraintHandler< SearchPointType >.
Referenced by shark::AbstractConstraintHandler< Vector >::generateRandomPoint().
|
inlinevirtual |
Definition at line 55 of file AbstractConstraintHandler.h.
|
protected |