Parasol Planning Library (PPL)
CompositeState< GraphType > Class Template Reference

#include <CompositeState.h>

Inheritance diagram for CompositeState< GraphType >:
Inheritance graph
[legend]
Collaboration diagram for CompositeState< GraphType >:
Collaboration graph
[legend]

Public Types

Local Types
typedef size_t VID
 A VID in an individual graph. More...
 
typedef std::vector< VID > VIDSet
 A set of VIDs from indiv. graphs. More...
 
typedef GraphType::CfgType CfgType
 The indiv. graph vertex type. More...
 
typedef CompositeEdge< GraphType > CompositeEdgeType
 
typedef CompositeGraph< CompositeState, CompositeEdgeType > GroupGraphType
 
typedef GraphType IndividualGraph
 

Public Member Functions

Construction
 CompositeState (GroupGraphType *const _groupGraph=nullptr)
 
 CompositeState (RobotGroup *const _group)
 
Equality
virtual bool operator== (const CompositeState &_other) const noexcept
 
virtual bool operator!= (const CompositeState &_other) const noexcept
 
Robots

Access the robots within this composite state.

virtual size_t GetNumRobots () const noexcept
 Get the number of robots in this composite state. More...
 
virtual const std::vector< Robot * > & GetRobots () const noexcept
 Get the full vector of robot pointers. More...
 
virtual Robot * GetRobot (const size_t _index) const
 
Graph Accessors

These functions provide access to the related group graph (if any) and descriptors for individual states.

virtual GroupGraphType * GetGroupGraph () const noexcept
 Get the group graph this composite state is with respect to. More...
 
virtual void SetGroupGraph (GroupGraphType *_newGraph)
 Set the composite graph that this composite state exists within. More...
 
virtual VID GetVID (const size_t _index) const noexcept
 
virtual VID GetVID (Robot *const _robot) const
 
Individual States

These functions manage the individual states that comprise this composite state.

virtual void SetRobotCfg (Robot *const _robot, const VID _vid)
 
virtual void SetRobotCfg (const size_t _index, const VID _vid)
 
virtual void SetRobotCfg (Robot *const _robot, CfgType &&_cfg)
 
virtual void SetRobotCfg (const size_t _index, CfgType &&_cfg)
 
virtual CfgType & GetRobotCfg (Robot *const _robot)
 
virtual CfgType & GetRobotCfg (const size_t _index)
 
virtual const CfgType & GetRobotCfg (Robot *const _robot) const
 
virtual const CfgType & GetRobotCfg (const size_t _index) const
 
void ClearLocalCfgs ()
 Clear the Local Cfg information. More...
 

Protected Member Functions

Helpers
virtual void VerifyIndex (const size_t _robotIndex) const noexcept
 
virtual bool IsLocalCfg (const size_t _robotIndex) const noexcept
 
virtual void InitializeLocalCfgs () noexcept
 Initialize the set of local configurations if not already done. More...
 

Protected Attributes

Internal State
GroupGraphType * m_groupMap {nullptr}
 The group graph. More...
 
RobotGroup * m_group {nullptr}
 The robot group for this state. More...
 
VIDSet m_vids
 The individual VIDs in this aggregate state. More...
 
std::vector< CfgType > m_localCfgs
 Individual states not in a map. More...
 

Detailed Description

template<typename GraphType>
class CompositeState< GraphType >

An aggregate state which represents a state for each robot in a robot group. 'GraphType' represents the individual graph type for a single robot.

Member Typedef Documentation

◆ CfgType

template<typename GraphType >
typedef GraphType::CfgType CompositeState< GraphType >::CfgType

The indiv. graph vertex type.

◆ CompositeEdgeType

template<typename GraphType >
typedef CompositeEdge<GraphType> CompositeState< GraphType >::CompositeEdgeType

◆ GroupGraphType

template<typename GraphType >
typedef CompositeGraph<CompositeState, CompositeEdgeType> CompositeState< GraphType >::GroupGraphType

◆ IndividualGraph

template<typename GraphType >
typedef GraphType CompositeState< GraphType >::IndividualGraph

◆ VID

template<typename GraphType >
typedef size_t CompositeState< GraphType >::VID

A VID in an individual graph.

◆ VIDSet

template<typename GraphType >
typedef std::vector<VID> CompositeState< GraphType >::VIDSet

A set of VIDs from indiv. graphs.

Constructor & Destructor Documentation

◆ CompositeState() [1/2]

template<typename GraphType >
CompositeState< GraphType >::CompositeState ( GroupGraphType *const  _groupGraph = nullptr)
explicit

Construct a composite state.

Parameters
_groupGraphThe composite graph to which this state belongs.

◆ CompositeState() [2/2]

template<typename GraphType >
CompositeState< GraphType >::CompositeState ( RobotGroup *const  _group)
explicit

Construct a composite state.

Parameters
_groupThe robot group to which this state belongs if it is not in a graph.

Member Function Documentation

◆ ClearLocalCfgs()

template<typename GraphType >
void CompositeState< GraphType >::ClearLocalCfgs

Clear the Local Cfg information.

◆ GetGroupGraph()

template<typename GraphType >
CompositeState< GraphType >::GroupGraphType * CompositeState< GraphType >::GetGroupGraph
virtualnoexcept

Get the group graph this composite state is with respect to.

◆ GetNumRobots()

template<typename GraphType >
size_t CompositeState< GraphType >::GetNumRobots
virtualnoexcept

Get the number of robots in this composite state.

◆ GetRobot()

template<typename GraphType >
Robot * CompositeState< GraphType >::GetRobot ( const size_t  _index) const
virtual

Get the robot pointer for a group member by index.

Parameters
_indexThe desired index.
Todo:
Remove this after we are very sure things are working.

◆ GetRobotCfg() [1/4]

template<typename GraphType >
CompositeState< GraphType >::CfgType & CompositeState< GraphType >::GetRobotCfg ( const size_t  _index)
virtual

Get the individual state (cfg) for a robot in the group.

Parameters
_indexThe index of the robot.
Returns
The individual state for the indexed robot.

◆ GetRobotCfg() [2/4]

template<typename GraphType >
const CompositeState< GraphType >::CfgType & CompositeState< GraphType >::GetRobotCfg ( const size_t  _index) const
virtual

Get the individual state (cfg) for a robot in the group.

Parameters
_indexThe index of the robot.
Returns
The individual state for the indexed robot.

◆ GetRobotCfg() [3/4]

template<typename GraphType >
CompositeState< GraphType >::CfgType & CompositeState< GraphType >::GetRobotCfg ( Robot *const  _robot)
virtual

Get the individual state (cfg) for a robot in the group.

Parameters
_robotThe robot which the state refers to.
Returns
The individual state for the indexed robot.

◆ GetRobotCfg() [4/4]

template<typename GraphType >
const CompositeState< GraphType >::CfgType & CompositeState< GraphType >::GetRobotCfg ( Robot *const  _robot) const
virtual

Get the individual state (cfg) for a robot in the group.

Parameters
_robotThe robot which the state refers to.
Returns
The individual state for the indexed robot.

◆ GetRobots()

template<typename GraphType >
const std::vector< Robot * > & CompositeState< GraphType >::GetRobots
virtualnoexcept

Get the full vector of robot pointers.

◆ GetVID() [1/2]

template<typename GraphType >
CompositeState< GraphType >::VID CompositeState< GraphType >::GetVID ( const size_t  _index) const
virtualnoexcept

Get the VID for a particular robot.

Parameters
_indexThe index (within the group) of the robot.
Returns
The VID of the robot's individual state, or INVALID_VID if it is not a valid VID in the invididual graph.

◆ GetVID() [2/2]

template<typename GraphType >
CompositeState< GraphType >::VID CompositeState< GraphType >::GetVID ( Robot *const  _robot) const
virtual

Get the VID for a particular robot.

Parameters
_robotThe a robot within the group.
Returns
The VID of the robot's individual state, or INVALID_VID if it is not a valid VID in the invididual graph.

◆ InitializeLocalCfgs()

template<typename GraphType >
void CompositeState< GraphType >::InitializeLocalCfgs
protectedvirtualnoexcept

Initialize the set of local configurations if not already done.

◆ IsLocalCfg()

template<typename GraphType >
bool CompositeState< GraphType >::IsLocalCfg ( const size_t  _robotIndex) const
protectedvirtualnoexcept

Return whether the cfg for the robot is local to the group cfg, or if it's in an individual roadmap already.

◆ operator!=()

template<typename GraphType >
bool CompositeState< GraphType >::operator!= ( const CompositeState< GraphType > &  _other) const
virtualnoexcept

Check if the current and given composite states are unequal.

Parameters
_otherThe given composite state.
Returns
True if unequal, false otherwise.

◆ operator==()

template<typename GraphType >
bool CompositeState< GraphType >::operator== ( const CompositeState< GraphType > &  _other) const
virtualnoexcept

Check if the current and given composite states are equal.

Parameters
_otherThe given composite state.
Returns
True if equal, false otherwise.

◆ SetGroupGraph()

template<typename GraphType >
void CompositeState< GraphType >::SetGroupGraph ( GroupGraphType *  _newGraph)
virtual

Set the composite graph that this composite state exists within.

◆ SetRobotCfg() [1/4]

template<typename GraphType >
void CompositeState< GraphType >::SetRobotCfg ( const size_t  _index,
CfgType &&  _cfg 
)
virtual

Set the individual state (cfg) for a robot to a graph copy of a state.

Parameters
_indexThe robot's group index which the state refers to.
_vidThe state descriptor.

◆ SetRobotCfg() [2/4]

template<typename GraphType >
void CompositeState< GraphType >::SetRobotCfg ( const size_t  _index,
const VID  _vid 
)
virtual

Set the individual state (cfg) for a robot to a graph copy of a state.

Parameters
_indexThe robot's group index which the state refers to.
_vidThe state descriptor.

◆ SetRobotCfg() [3/4]

template<typename GraphType >
void CompositeState< GraphType >::SetRobotCfg ( Robot *const  _robot,
CfgType &&  _cfg 
)
virtual

Set the individual state (cfg) for a robot to a graph copy of a state.

Parameters
_robotThe robot which the state refers to.
_vidThe state descriptor.

◆ SetRobotCfg() [4/4]

template<typename GraphType >
void CompositeState< GraphType >::SetRobotCfg ( Robot *const  _robot,
const VID  _vid 
)
virtual

Set the individual state (cfg) for a robot to a graph copy of a state.

Parameters
_robotThe robot which the state refers to.
_vidThe state descriptor.

◆ VerifyIndex()

template<typename GraphType >
void CompositeState< GraphType >::VerifyIndex ( const size_t  _robotIndex) const
inlineprotectedvirtualnoexcept

Verify that an index is valid. Throw an exception if not.

Parameters
_robotIndexThe (group) index to verify.

Field Documentation

◆ m_group

template<typename GraphType >
RobotGroup* CompositeState< GraphType >::m_group {nullptr}
protected

The robot group for this state.

◆ m_groupMap

template<typename GraphType >
GroupGraphType* CompositeState< GraphType >::m_groupMap {nullptr}
protected

The group graph.

◆ m_localCfgs

template<typename GraphType >
std::vector<CfgType> CompositeState< GraphType >::m_localCfgs
protected

Individual states not in a map.

◆ m_vids

template<typename GraphType >
VIDSet CompositeState< GraphType >::m_vids
protected

The individual VIDs in this aggregate state.


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