Implements the base class for constraint handling. More...
#include <shark/ObjectiveFunctions/AbstractConstraintHandler.h>
Inheritance diagram for shark::AbstractConstraintHandler< SearchPointType >: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. | |
| bool | isBoxConstrained () const |
| Returns whether this function is an instance of BoxConstraintHandler. | |
| bool | canGenerateRandomPoint () const |
| Returns whether this function is an instance of BoxConstraintHandler. | |
| virtual void | generateRandomPoint (random::rng_type &rng, SearchPointType &startingPoint) const |
| If supported, generates a random point inside the feasible region. | |
| virtual bool | isFeasible (SearchPointType const &) const =0 |
| Returns true if the point is in the feasible Region. | |
| 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 53 of file AbstractConstraintHandler.h.
| typedef TypedFeatureNotAvailableException<Feature> shark::AbstractConstraintHandler< SearchPointType >::FeatureNotAvailableException |
Definition at line 60 of file AbstractConstraintHandler.h.
| typedef TypedFlags<Feature> shark::AbstractConstraintHandler< SearchPointType >::Features |
Definition at line 60 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 55 of file AbstractConstraintHandler.h.
|
inlinevirtual |
Definition at line 62 of file AbstractConstraintHandler.h.
|
inline |
Returns whether this function is an instance of BoxConstraintHandler.
Definition at line 74 of file AbstractConstraintHandler.h.
References shark::AbstractConstraintHandler< SearchPointType >::CAN_GENERATE_RANDOM_POINT, and shark::AbstractConstraintHandler< SearchPointType >::m_features.
Referenced by shark::AbstractObjectiveFunction< PointType, ResultT >::announceConstraintHandler().
|
inline |
Returns whether this function can calculate the closest feasible to an infeasible point.
Definition at line 65 of file AbstractConstraintHandler.h.
References shark::AbstractConstraintHandler< SearchPointType >::CAN_PROVIDE_CLOSEST_FEASIBLE, and shark::AbstractConstraintHandler< SearchPointType >::m_features.
Referenced by shark::AbstractObjectiveFunction< PointType, ResultT >::announceConstraintHandler().
|
inlinevirtual |
Reimplemented in shark::BoxConstraintHandler< SearchPointType >, and shark::BoxConstraintHandler< Vector >.
Definition at line 90 of file AbstractConstraintHandler.h.
References shark::AbstractConstraintHandler< SearchPointType >::CAN_PROVIDE_CLOSEST_FEASIBLE, and SHARK_FEATURE_EXCEPTION.
|
inline |
Definition at line 60 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< SearchPointType >, and shark::BoxConstraintHandler< Vector >.
Definition at line 82 of file AbstractConstraintHandler.h.
References shark::AbstractConstraintHandler< SearchPointType >::CAN_GENERATE_RANDOM_POINT, and SHARK_FEATURE_EXCEPTION.
|
inline |
Returns whether this function is an instance of BoxConstraintHandler.
Definition at line 70 of file AbstractConstraintHandler.h.
References shark::AbstractConstraintHandler< SearchPointType >::IS_BOX_CONSTRAINED, and shark::AbstractConstraintHandler< SearchPointType >::m_features.
|
pure virtual |
Returns true if the point is in the feasible Region.
This function must be implemented by a ConstraintHandler
Implemented in shark::BoxConstraintHandler< SearchPointType >, and shark::BoxConstraintHandler< Vector >.
|
inlinevirtual |
Definition at line 60 of file AbstractConstraintHandler.h.
|
protected |
Definition at line 60 of file AbstractConstraintHandler.h.
Referenced by shark::AbstractConstraintHandler< SearchPointType >::canGenerateRandomPoint(), shark::AbstractConstraintHandler< SearchPointType >::canProvideClosestFeasible(), and shark::AbstractConstraintHandler< SearchPointType >::isBoxConstrained().