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

#include <CompositeEdge.h>

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

Public Types

Local Types
typedef GraphType::CfgType IndividualCfg
 
typedef GraphType::EdgeType IndividualEdge
 
typedef double EdgeWeight
 
typedef stapl::edge_descriptor_impl< size_t > ED
 
typedef CompositeState< GraphType > CompositeStateType
 
typedef CompositeGraph< CompositeStateType, CompositeEdge > GroupGraphType
 
typedef std::vector< CompositeStateType > CompositePath
 

Public Member Functions

Construction
 CompositeEdge (GroupGraphType *const &_g=nullptr, const double _w=0.0, const CompositePath &_intermediates=CompositePath())
 
 CompositeEdge (RobotGroup *const &_g, const double _w=0.0, const CompositePath &_intermediates=CompositePath())
 
Ordering and Equality
virtual bool operator== (const CompositeEdge &_w) const noexcept
 
virtual bool operator!= (const CompositeEdge &_w) const noexcept
 
virtual bool operator< (const CompositeEdge &_other) const noexcept
 
Graph Edge Weight
virtual EdgeWeight GetWeight () const noexcept
 Get the numeric weight for this edge. More...
 
virtual void SetWeight (const EdgeWeight _w) noexcept
 
Misc. Interface Functions
void SetGroupGraph (GroupGraphType *const &_g)
 
virtual void Clear () noexcept
 Reset the states of this object. More...
 
CompositePath & GetIntermediates () noexcept
 Get the composite state intermediates. More...
 
const CompositePath & GetIntermediates () const noexcept
 Get the composite state intermediates. More...
 
const size_t GetNumIntermediates () noexcept
 Get the number of composite intermediates along this edge. More...
 
void SetIntermediates (const CompositePath &_cfgs)
 Set the composite state intermediates. More...
 
virtual void Write (std::ostream &_os) const
 
Individual Local Plans
virtual void SetEdge (Robot *const _robot, const ED _ed)
 
void SetEdge (const size_t _robot, IndividualEdge &&_edge)
 
void SetEdge (Robot *const _robot, IndividualEdge &&_edge)
 
virtual IndividualEdge * GetEdge (Robot *const _robot)
 
virtual const IndividualEdge * GetEdge (Robot *const _robot) const
 
virtual IndividualEdge * GetEdge (const size_t _robotIndex)
 
virtual const IndividualEdge * GetEdge (const size_t _robotIndex) const
 
std::vector< IndividualEdge > & GetLocalEdges () noexcept
 Get a vector of local edges in the plan. More...
 
void ClearLocalEdges () noexcept
 Clear all local edges in the plan. More...
 
virtual std::vector< ED > & GetEdgeDescriptors () noexcept
 
virtual size_t GetNumRobots () const noexcept
 Get the number of robots given in this group local plan. More...
 
virtual std::unordered_set< Robot * > GetActiveRobots ()
 
virtual void SetTimeSteps (size_t _timesteps)
 Set the number of timesteps along this composite edge. More...
 
virtual size_t GetTimeSteps () const
 Get the number of timesteps along this composite edge. More...
 
Stapl graph interface
virtual CompositeEdge operator+ (const CompositeEdge &_other) const
 
virtual double Weight () const noexcept
 Get the weight of the plan. More...
 

Protected Attributes

Internal State
GroupGraphType * m_groupMap {nullptr}
 The composite graph that this edge is in. More...
 
RobotGroup * m_group {nullptr}
 The robot group that this edge belongs to. More...
 
double m_weight {std::numeric_limits<double>::infinity()}
 The edge weight. More...
 
CompositePath m_intermediates
 Composite state intermediates. More...
 
std::vector< ED > m_edges
 Descriptors of the individual edges. More...
 
std::vector< IndividualEdge > m_localEdges
 Note that any edges added to m_localEdges must be valid and complete. More...
 
size_t m_timesteps
 The number of timesteps along this edge. More...
 

Iteration

Iterate over the EDs in this edge.

typedef std::vector< ED >::iterator iterator
 
typedef std::vector< ED >::const_iterator const_iterator
 
virtual iterator begin () noexcept
 
virtual iterator end () noexcept
 
virtual const_iterator begin () const noexcept
 
virtual const_iterator end () const noexcept
 

Detailed Description

template<typename GraphType>
class CompositeEdge< GraphType >

A composite edge for multiple robots, which is composed of an individual edge for each robot. 'GraphType' refers to the individual robot graph type.

Member Typedef Documentation

◆ CompositePath

template<typename GraphType >
typedef std::vector<CompositeStateType> CompositeEdge< GraphType >::CompositePath

◆ CompositeStateType

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

◆ const_iterator

template<typename GraphType >
typedef std::vector<ED>::const_iterator CompositeEdge< GraphType >::const_iterator

◆ ED

template<typename GraphType >
typedef stapl::edge_descriptor_impl<size_t> CompositeEdge< GraphType >::ED

◆ EdgeWeight

template<typename GraphType >
typedef double CompositeEdge< GraphType >::EdgeWeight

◆ GroupGraphType

template<typename GraphType >
typedef CompositeGraph<CompositeStateType, CompositeEdge> CompositeEdge< GraphType >::GroupGraphType

◆ IndividualCfg

template<typename GraphType >
typedef GraphType::CfgType CompositeEdge< GraphType >::IndividualCfg

◆ IndividualEdge

template<typename GraphType >
typedef GraphType::EdgeType CompositeEdge< GraphType >::IndividualEdge

◆ iterator

template<typename GraphType >
typedef std::vector<ED>::iterator CompositeEdge< GraphType >::iterator

Constructor & Destructor Documentation

◆ CompositeEdge() [1/2]

template<typename GraphType >
CompositeEdge< GraphType >::CompositeEdge ( GroupGraphType *const &  _g = nullptr,
const double  _w = 0.0,
const CompositePath &  _intermediates = CompositePath() 
)

Constructs a CompositeEdge.

Parameters
_gThe group roadmap in which this edge exists.
_wThe weight of the plan. Defaults to 0.0.
_intermediatesThe intermediates along the edge. Defaults to CompositePath().

◆ CompositeEdge() [2/2]

template<typename GraphType >
CompositeEdge< GraphType >::CompositeEdge ( RobotGroup *const &  _g,
const double  _w = 0.0,
const CompositePath &  _intermediates = CompositePath() 
)

Constructs a CompositeEdge.

Parameters
_gThe robot group to which this edge exists.
_wThe weight of the plan. Defaults to 0.0.
_intermediatesThe intermediates along the edge. Defaults to CompositePath().

Member Function Documentation

◆ begin() [1/2]

template<typename GraphType >
CompositeEdge< GraphType >::const_iterator CompositeEdge< GraphType >::begin
virtualnoexcept

◆ begin() [2/2]

template<typename GraphType >
CompositeEdge< GraphType >::iterator CompositeEdge< GraphType >::begin
virtualnoexcept

◆ Clear()

template<typename GraphType >
void CompositeEdge< GraphType >::Clear
virtualnoexcept

Reset the states of this object.

Reimplemented in GroupLocalPlan< GraphType >.

◆ ClearLocalEdges()

template<typename GraphType >
void CompositeEdge< GraphType >::ClearLocalEdges
noexcept

Clear all local edges in the plan.

◆ end() [1/2]

template<typename GraphType >
CompositeEdge< GraphType >::const_iterator CompositeEdge< GraphType >::end
virtualnoexcept

◆ end() [2/2]

template<typename GraphType >
CompositeEdge< GraphType >::iterator CompositeEdge< GraphType >::end
virtualnoexcept

◆ GetActiveRobots()

template<typename GraphType >
std::unordered_set< Robot * > CompositeEdge< GraphType >::GetActiveRobots
virtual

Get a vector of the robots who move along this composite edge (i.e. the individual source vertex differs from the target vertex).

◆ GetEdge() [1/4]

template<typename GraphType >
CompositeEdge< GraphType >::IndividualEdge * CompositeEdge< GraphType >::GetEdge ( const size_t  _robotIndex)
virtual

Get the individual edge for a robot.

Parameters
_robotIndexThe group index of the robot which the edge refers to.
Returns
A pointer to the edge for _robot. It will be null if it has not yet been set.

◆ GetEdge() [2/4]

template<typename GraphType >
const CompositeEdge< GraphType >::IndividualEdge * CompositeEdge< GraphType >::GetEdge ( const size_t  _robotIndex) const
virtual

Get the individual edge for a robot.

Parameters
_robotIndexThe group index of the robot which the edge refers to.
Returns
A pointer to the edge for _robot. It will be null if it has not yet been set.

◆ GetEdge() [3/4]

template<typename GraphType >
CompositeEdge< GraphType >::IndividualEdge * CompositeEdge< GraphType >::GetEdge ( Robot *const  _robot)
virtual

Get the individual edge for a robot.

Parameters
_robotThe robot which the edge refers to.
Returns
A pointer to the edge for _robot. It will be null if it has not yet been set.

◆ GetEdge() [4/4]

template<typename GraphType >
const CompositeEdge< GraphType >::IndividualEdge * CompositeEdge< GraphType >::GetEdge ( Robot *const  _robot) const
virtual

Get the individual edge for a robot.

Parameters
_robotThe robot which the edge refers to.
Returns
A pointer to the edge for _robot. It will be null if it has not yet been set.

◆ GetEdgeDescriptors()

template<typename GraphType >
std::vector< typename CompositeEdge< GraphType >::ED > & CompositeEdge< GraphType >::GetEdgeDescriptors
virtualnoexcept

Get a vector of individual edge descriptors. An edge descriptor will be invalid if an individual edge is local.

◆ GetIntermediates() [1/2]

template<typename GraphType >
const CompositeEdge< GraphType >::CompositePath & CompositeEdge< GraphType >::GetIntermediates
noexcept

Get the composite state intermediates.

◆ GetIntermediates() [2/2]

template<typename GraphType >
CompositeEdge< GraphType >::CompositePath & CompositeEdge< GraphType >::GetIntermediates
noexcept

Get the composite state intermediates.

◆ GetLocalEdges()

template<typename GraphType >
std::vector< typename CompositeEdge< GraphType >::IndividualEdge > & CompositeEdge< GraphType >::GetLocalEdges
noexcept

Get a vector of local edges in the plan.

◆ GetNumIntermediates()

template<typename GraphType >
const size_t CompositeEdge< GraphType >::GetNumIntermediates
noexcept

Get the number of composite intermediates along this edge.

◆ GetNumRobots()

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

Get the number of robots given in this group local plan.

◆ GetTimeSteps()

template<typename GraphType >
size_t CompositeEdge< GraphType >::GetTimeSteps
virtual

Get the number of timesteps along this composite edge.

◆ GetWeight()

template<typename GraphType >
CompositeEdge< GraphType >::EdgeWeight CompositeEdge< GraphType >::GetWeight
virtualnoexcept

Get the numeric weight for this edge.

◆ operator!=()

template<typename GraphType >
bool CompositeEdge< GraphType >::operator!= ( const CompositeEdge< GraphType > &  _w) const
virtualnoexcept

Check if the given edge is unequal to the current.

Parameters
_wThe given edge.

◆ operator+()

template<typename GraphType >
CompositeEdge< GraphType > CompositeEdge< GraphType >::operator+ ( const CompositeEdge< GraphType > &  _other) const
virtual

Add two composite edges. This only adds weights, it doesn't take intermediates into account.

◆ operator<()

template<typename GraphType >
bool CompositeEdge< GraphType >::operator< ( const CompositeEdge< GraphType > &  _other) const
inlinevirtualnoexcept

Check if the given edge is less than the current.

Parameters
_otherThe given edge.

◆ operator==()

template<typename GraphType >
bool CompositeEdge< GraphType >::operator== ( const CompositeEdge< GraphType > &  _w) const
virtualnoexcept

Check if the given edge is equal to the current.

Parameters
_wThe given edge.

◆ SetEdge() [1/3]

template<typename GraphType >
void CompositeEdge< GraphType >::SetEdge ( const size_t  _robot,
IndividualEdge &&  _edge 
)

Set the individual edge for a robot to a local copy of an edge.

Parameters
_robotThe robot which the edge refers to.
_edgeThe edge.

◆ SetEdge() [2/3]

template<typename GraphType >
void CompositeEdge< GraphType >::SetEdge ( Robot *const  _robot,
const ED  _ed 
)
virtual

Set the individual edge for a robot to a graph copy of an edge.

Parameters
_robotThe robot which the edge refers to.
_edThe edge descriptor.

◆ SetEdge() [3/3]

template<typename GraphType >
void CompositeEdge< GraphType >::SetEdge ( Robot *const  _robot,
IndividualEdge &&  _edge 
)

Set the individual edge for a robot to a local copy of an edge.

Parameters
_robotThe robot which the edge refers to.
_edgeThe edge.

◆ SetGroupGraph()

template<typename GraphType >
void CompositeEdge< GraphType >::SetGroupGraph ( GroupGraphType *const &  _g)

Set the composite graph that this composite edge lies within.

Parameters
_gThe composite graph to associate the edge with.

◆ SetIntermediates()

template<typename GraphType >
void CompositeEdge< GraphType >::SetIntermediates ( const CompositePath &  _cfgs)

Set the composite state intermediates.

◆ SetTimeSteps()

template<typename GraphType >
void CompositeEdge< GraphType >::SetTimeSteps ( size_t  _timesteps)
virtual

Set the number of timesteps along this composite edge.

◆ SetWeight()

template<typename GraphType >
void CompositeEdge< GraphType >::SetWeight ( const EdgeWeight  _w)
virtualnoexcept

Set the numeric weight for this edge.

Parameters
_wThe numeric weight.

◆ Weight()

template<typename GraphType >
double CompositeEdge< GraphType >::Weight
virtualnoexcept

Get the weight of the plan.

◆ Write()

template<typename GraphType >
void CompositeEdge< GraphType >::Write ( std::ostream &  _os) const
virtual

Write an edge to an output stream.

Parameters
_osThe output stream to write to.

Field Documentation

◆ m_edges

template<typename GraphType >
std::vector<ED> CompositeEdge< GraphType >::m_edges
protected

Descriptors of the individual edges.

◆ m_group

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

The robot group that this edge belongs to.

◆ m_groupMap

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

The composite graph that this edge is in.

◆ m_intermediates

template<typename GraphType >
CompositePath CompositeEdge< GraphType >::m_intermediates
protected

Composite state intermediates.

◆ m_localEdges

template<typename GraphType >
std::vector<IndividualEdge> CompositeEdge< GraphType >::m_localEdges
protected

Note that any edges added to m_localEdges must be valid and complete.

Edges which are not in a map.

◆ m_timesteps

template<typename GraphType >
size_t CompositeEdge< GraphType >::m_timesteps
protected

The number of timesteps along this edge.

◆ m_weight

template<typename GraphType >
double CompositeEdge< GraphType >::m_weight {std::numeric_limits<double>::infinity()}
protected

The edge weight.


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