Parasol Planning Library (PPL)
Constraint Class Referenceabstract

#include <Constraint.h>

Inheritance diagram for Constraint:
Inheritance graph
[legend]
Collaboration diagram for Constraint:
Collaboration graph
[legend]

Public Member Functions

Constraint Interface
virtual void SetRobot (Robot *const _r)
 
virtual const BoundaryGetBoundary () const =0
 
virtual bool Satisfied (const Cfg &_c) const =0
 

Protected Attributes

Internal State
Robotm_robot {nullptr}
 The subject of this constraint. More...
 

Construction

 Constraint (Robot *const _r)
 
virtual ~Constraint ()
 
virtual std::unique_ptr< ConstraintClone () const =0
 
static std::unique_ptr< ConstraintFactory (Robot *const _r, XMLNode &_node, Environment *_env=nullptr)
 

Detailed Description

An abstract base class representing the required interface for a constraint on the state of a robot. The Constraint interface requires plain jane Cfg's to ensure that they are usable by reactive agents.

Constraints may apply to specific robots, or they may be more general criterion on any robot. In the later case, the robot pointer for the constraint will be null.

Constructor & Destructor Documentation

◆ Constraint()

Constraint::Constraint ( Robot *const  _r)
explicit

Create a constraint for a robot.

Parameters
_rThe robot to constrain.

◆ ~Constraint()

Constraint::~Constraint ( )
virtualdefault

Member Function Documentation

◆ Clone()

virtual std::unique_ptr<Constraint> Constraint::Clone ( ) const
pure virtual

Copy this constraint.

Returns
A copy of this constraint.

Implemented in CSpaceConstraint, and BoundaryConstraint.

◆ Factory()

std::unique_ptr< Constraint > Constraint::Factory ( Robot *const  _r,
XMLNode _node,
Environment _env = nullptr 
)
static

Construct a constraint of the appropriate type from an XML node.

Parameters
_rThe robot to which the constraint applies.
_nodeThe XML node to parse.
Returns
A constraint for _r of the type/parameters described by _node.

◆ GetBoundary()

virtual const Boundary* Constraint::GetBoundary ( ) const
pure virtual

Get a sampling boundary that describes the subset of CSpace allowed by this constraint.

Note
Many constraints can be described in terms of boundaries, but some cannot (such as constraints with ordering requirements). If the constraint can't be represented as a boundary, this will return a null pointer.

Implemented in BoundaryConstraint.

◆ Satisfied()

virtual bool Constraint::Satisfied ( const Cfg _c) const
pure virtual

Determine whether a given configuration of the robot satisfies this constraint.

Parameters
_cThe configuration to check.
Returns
True if _c satisfies this constraint.

Implemented in BoundaryConstraint.

◆ SetRobot()

void Constraint::SetRobot ( Robot *const  _r)
virtual

Change the subject of this constraint.

Parameters
_rThe new robot to constrain, or null to represent any robot.

Field Documentation

◆ m_robot

Robot* Constraint::m_robot {nullptr}
protected

The subject of this constraint.


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