KrisLibrary  1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
CSet Class Reference

A subset of a CSpace, which establishes a constraint for a configuration must meet. Mathematically, this is a set S which imposes the constraint [q in S]. More...

#include <CSet.h>

Inheritance diagram for CSet:
AxisRangeSet BoxSet CostGoal CSpaceConstraintSet FiniteSet Geometric2DObstacleFreeSet IntegratedControlSet IntersectionSet NeighborhoodSet SubspaceSet UnionSet VisibilitySet

Public Types

typedef bool(* CPredicate) (const Config &)
 

Public Member Functions

 CSet (CPredicate f)
 
virtual int NumDimensions () const
 Returns the number of dimensions this accepts (-1) for all dimensions.
 
virtual bool Contains (const Config &x)
 Returns true if this constraint is satisfied at configuration x.
 
virtual bool Project (Config &x)
 
virtual bool IsSampleable () const
 If true, the Sample() function is implemented.
 
virtual void Sample (Config &x)
 If IsSampleable is true, draws a config at random from the set.
 
virtual Optimization::NonlinearProgramNumeric ()
 
virtual bool IsConvex () const
 If true, the feasible set is convex with respect to the CSpace's interpolation function.
 
virtual Real ObstacleDistance (const Config &x)
 

Public Attributes

CPredicate test
 

Detailed Description

A subset of a CSpace, which establishes a constraint for a configuration must meet. Mathematically, this is a set S which imposes the constraint [q in S].

You can either create a subclass of CSet for greatest functionality, or construct a CSet with a function pointer that returns whether a Config is in or out.

Member Function Documentation

virtual Optimization::NonlinearProgram* CSet::Numeric ( )
inlinevirtual

If possible, give the set as a feasible solution to the nonlinear program g(x) <= 0, h(x) = 0.

Reimplemented in CSpaceConstraintSet, IntersectionSet, FiniteSet, SubspaceSet, NeighborhoodSet, AxisRangeSet, and BoxSet.

virtual Real CSet::ObstacleDistance ( const Config x)
inlinevirtual

If overloaded, return the CSpace signed distance from x to the set boundary. Positive means x is in the set, 0 means boundary, negative means x is out of the set.

Referenced by IntersectionSet::IsConvex().

virtual bool CSet::Project ( Config x)
inlinevirtual

If possible, project x onto a nearby configuration in the set, and return true. If not, return false.

Referenced by UnionSet::NumDimensions(), and CSpace::ProjectFeasible().


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