Tree Class Reference

A structure holding and managing all data connected to the tree used in the ADDIRRT* algorithm. More...

#include <RobotComponents/components/MotionPlanning/Tasks/AdaptiveDynamicDomainInformedRRTStar/Tree.h>

Classes

struct  NodeType
 Represents a node of thr rrt. More...
 

Public Types

using ConfigType = VectorXf
 The type of configurations. More...
 
using PendingUpdateLookuptableConstIterator = typename PendingUpdateLookuptableType::const_iterator
 Const iterator for the PendingUpdateLookuptable. More...
 
using PendingUpdateLookuptableIterator = typename PendingUpdateLookuptableType::iterator
 Iterator for the PendingUpdateLookuptable. More...
 
using PendingUpdateLookuptableType = std::unordered_map< std::pair< std::size_t, std::size_t >, std::size_t >
 Lookuptable for pending updates. More...
 

Public Member Functions

void addGoalReached (const NodeId &goal, float costToGoToGoal)
 Adds a node to the list of nodes that can reach the goal configuration. More...
 
NodeId addNode (ConfigType cfg, const NodeId &parent, float fromParentCost)
 Adds a node to the tree. More...
 
void addPendingUpdate (const Update &u)
 Adds a new update to the list of pending updates. More...
 
void applyPendingUpdates ()
 Applies all pending updates. More...
 
template<class LockType , class RemoteUpdateGetter >
void applyPendingUpdates (LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate)
 The same as applyPendingUpdates(LockType, RemoteUpdateGetter, UpdateConsumer) but uses an noop as updateConsumer This overload is needed since the defaultparameter does not work. More...
 
template<class LockType , class RemoteUpdateGetter , class UpdateConsumer >
void applyPendingUpdates (LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate, UpdateConsumer updateConsumer=[](Update &&) {})
 Applies all pending updates. More...
 
void applyUpdate (const Update &u)
 Applies the given update. More...
 
NodeTypeat (const NodeId &id)
 
const NodeTypeat (const NodeId &id) const
 
NodeTypeat (std::size_t index)
 
const NodeTypeat (std::size_t index) const
 
bool canApplyUpdate (const Update &u)
 
void decreaseRadius (const NodeId &id)
 Decreases a node's radius. More...
 
const Ice::LongSeq & getAppliedUpdateIds () const
 
float getBestCost () const
 
PathWithCost getBestPath () const
 
const Update & getCurrentUpdate () const
 
Ice::Long getCurrentUpdateId () const
 
FullIceTree getIceTree () const
 
NodeId getIdOfIndex (std::size_t index) const
 
std::vector< std::pair< NodeId, float > > getKNearestNeighboursAndDistances (const ConfigType &cfg, std::size_t k)
 
const std::deque< Update > & getLocalUpdates () const
 
std::pair< NodeId, floatgetNearestNeighbourAndDistance (const ConfigType &cfg)
 
NodeId getNextNodeIdFor (std::size_t workerId)
 
NodeTypegetNode (const NodeId &id)
 
const NodeTypegetNode (const NodeId &id) const
 
const std::deque< std::deque< NodeType > > & getNodes () const
 
float getNthPathCost (std::size_t n) const
 
NodeIdList getNthPathIds (std::size_t n) const
 
PathWithCost getNthPathWithCost (std::size_t n) const
 
std::size_t getPathCount () const
 
const Update & getPendingUpdate (std::size_t workerId, std::size_t updateId) const
 
Ice::Long getPreviousUpdateId () const
 
bool hasAppliedUpdate (std::size_t workerId, Ice::Long updateId)
 
bool hasGoalNode (const NodeId &nodeId) const
 
bool hasPendingUpdate (std::size_t workerId, std::size_t updateId) const
 
void increaseRadius (const NodeId &id)
 Increases a node's radius. More...
 
void increaseWorkerCountTo (std::size_t count)
 Increases the storage of all data structures to be appropriate for count workers. More...
 
void init (const FullIceTree &iceTree, AdaptiveDynamicDomainParameters newaddParams, std::size_t newWorkerId)
 Initailizes the tree from the given tree. More...
 
template<class LockType , class RemoteUpdateGetter , class UpdateConsumer >
void prepareUpdate (Ice::LongSeq dependetOnUpdateIds, LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate, UpdateConsumer updateConsumer)
 Prepares an update by applying all dependet on updates. More...
 
void sendCurrentUpdate (TreeUpdateInterfacePrx &prx)
 Sends the current update to the given proxy. More...
 
void setNodeParent (const NodeId &child, const NodeId &newParent, float fromParentCost)
 Sets the parent node of child to parent. More...
 
std::size_t size () const
 
 Tree ()=default
 Default ctor. More...
 
 Tree (const VectorXf &startCfg)
 Creates a tree that can be used to analyze and apply updates. More...
 

Static Public Attributes

static const NodeId ROOT_ID
 The root node's id. More...
 

Protected Member Functions

void applyGoalReachedUpdates (const GoalInfoList newGoalNodes)
 Applies multiple goal reached updates to the tree. More...
 
void applyNodeCreationUpdate (const NodeCreationUpdate &u, std::size_t workerId)
 Applies a node creation update to the tree. More...
 
template<class LockType , class RemoteUpdateGetter , class UpdateConsumer >
void applyPendingUpdate (std::size_t updateIndex, LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate, UpdateConsumer updateConsumer)
 Applies one pending update from the list of pending updates. More...
 
void applyRadiusUpdate (const RadiusUpdate &u)
 Applies a radius update to the tree. More...
 
void applyRewireUpdate (const RewireUpdate &rewireUpdate)
 Applies a rewire update to the tree. More...
 
void createNewGoalReachedUpdate (const NodeId &goal, float costToGoToGoal)
 Adds a new goal reached update to the current update. More...
 
void createNewNodeCreationUpdate (const ConfigType &cfg, const NodeId &parent, float fromParentCost)
 Adds a new node creation update to the current update. More...
 
void createNewRadiusUpdate (const NodeId &id, bool increaseRadius)
 Adds a new radius update to the current update. More...
 
void createNewRewireUpdate (const NodeId &child, const NodeId &newParent, float fromParentCost)
 Adds a new node creation update to the current update. More...
 
void doAddGoalReached (const NodeId &goal, float costToGoToGoal)
 Adds a node to the list of nodes that can reach the goal configuration. More...
 
NodeId doAddNode (ConfigType cfg, const NodeId &parent, float fromParentCost, std::size_t workerId)
 Adds a node to the tree. More...
 
void doDecreaseRadius (const NodeId &id)
 Decreases a node's radius. More...
 
void doIncreaseRadius (const NodeId &id)
 Increases a node's radius. More...
 
void doSetNodeParent (const NodeId &child, const NodeId &newParent, float fromParentCost, bool updateFromStartCost=true)
 Sets the parent node of child to parent. More...
 
PendingUpdateLookuptableIterator findPendingUpdate (std::size_t workerId, std::size_t updateId)
 
PendingUpdateLookuptableConstIterator findPendingUpdate (std::size_t workerId, std::size_t updateId) const
 
std::deque< GoalInfo >::const_iterator getBestCostIt () const
 
Update & getCurrentUpdateNonConst ()
 
VectorXfSeq getPathTo (NodeId id) const
 
void prepareNextUpdate ()
 Prepares the next update. More...
 
void pushCosts (const NodeId &root)
 Updates fromStartCosts for all children from root. More...
 

Protected Attributes

AdaptiveDynamicDomainParameters addParams
 The parameters of adaptive dynamic domain) More...
 
Ice::LongSeq appliedUpdateIds
 List of ids of applied updates. More...
 
std::deque< GoalInfo > goalNodes
 List of nodes able to reach the goal configuration. More...
 
std::deque< Update > localUpdates
 Updates created by this tree. More...
 
std::size_t nodeCount
 The number of nodes in the rrt. More...
 
std::deque< std::deque< NodeType > > nodes
 Holds all nodes. More...
 
std::deque< Update > pendingUpdates
 Updates to apply to the tree. More...
 
PendingUpdateLookuptableType pendingUpdatesLookupTable
 Speeds up lookup for available updates. More...
 
std::size_t workerId
 The worker id of this trees owner. More...
 

Detailed Description

A structure holding and managing all data connected to the tree used in the ADDIRRT* algorithm.

Function overview: [public ] applyXYZUpdate(XYZUpdate u): applies an existing update u to the tree [protected] createNewXYZUpdate(...) : creates a new update and adds it to the tree's current update [public ] addNode/{in,de}creaseRadius/setNodeParent/addGoalReached: modifies the tree (through do functions) and adds the corresponding update to the local tree [protected] doXYZ: performs the actual modification of the tree

Definition at line 49 of file Tree.h.

Member Typedef Documentation

◆ ConfigType

using ConfigType = VectorXf

The type of configurations.

Definition at line 56 of file Tree.h.

◆ PendingUpdateLookuptableConstIterator

using PendingUpdateLookuptableConstIterator = typename PendingUpdateLookuptableType::const_iterator

Const iterator for the PendingUpdateLookuptable.

Definition at line 99 of file Tree.h.

◆ PendingUpdateLookuptableIterator

using PendingUpdateLookuptableIterator = typename PendingUpdateLookuptableType::iterator

Iterator for the PendingUpdateLookuptable.

Definition at line 95 of file Tree.h.

◆ PendingUpdateLookuptableType

using PendingUpdateLookuptableType = std::unordered_map<std::pair<std::size_t, std::size_t>, std::size_t>

Lookuptable for pending updates.

Definition at line 91 of file Tree.h.

Constructor & Destructor Documentation

◆ Tree() [1/2]

Tree ( )
default

Default ctor.

◆ Tree() [2/2]

Tree ( const VectorXf &  startCfg)

Creates a tree that can be used to analyze and apply updates.

Other operations are undefined.

Parameters
startCfgThe start config.

Definition at line 41 of file Tree.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ addGoalReached()

void addGoalReached ( const NodeId &  goal,
float  costToGoToGoal 
)
inline

Adds a node to the list of nodes that can reach the goal configuration.

(creates an appropriate update)

Parameters
goalThe node to add.
costToGoToGoalThe cost to reach the gol configuration from the given node.

Definition at line 528 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNode()

NodeId addNode ( ConfigType  cfg,
const NodeId &  parent,
float  fromParentCost 
)

Adds a node to the tree.

(creates an appropriate update)

Parameters
cfgThe node's configuration.
parentThe node's parent.
fromParentCostThe cost of the edge (node, parent)
Returns
The new node's id.

Definition at line 241 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPendingUpdate()

void addPendingUpdate ( const Update &  u)

Adds a new update to the list of pending updates.

Parameters
uThe update.

Definition at line 483 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyGoalReachedUpdates()

void applyGoalReachedUpdates ( const GoalInfoList  newGoalNodes)
inlineprotected

Applies multiple goal reached updates to the tree.

Parameters
newGoalNodesThe new nodes that can reach the goal configuration.

Definition at line 314 of file Tree.h.

+ Here is the caller graph for this function:

◆ applyNodeCreationUpdate()

void applyNodeCreationUpdate ( const NodeCreationUpdate &  u,
std::size_t  workerId 
)
inlineprotected

Applies a node creation update to the tree.

Parameters
uThe update.
workerIdThe updates source worker.

Definition at line 301 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyPendingUpdate()

void applyPendingUpdate ( std::size_t  updateIndex,
LockType &&  treeLock,
RemoteUpdateGetter  getRemoteUpdate,
UpdateConsumer  updateConsumer 
)
inlineprotected

Applies one pending update from the list of pending updates.

Parameters
updateIndexThe pending update's index.
treeLockThe lock used to protect the update structures. It will be unlocked when getting a remote update.
getRemoteUpdateFunction used to request a missing update.
updateConsumerFunction used to consume updates after they were added. (will be moved to the consumer)

Definition at line 372 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyPendingUpdates() [1/3]

void applyPendingUpdates ( )
inline

Applies all pending updates.

Updates are not consumes. If a required update is missing this methode will fail. (no update getter is providet). This function is not thread save! Use it only in a serial/protected environment.

Definition at line 197 of file Tree.h.

+ Here is the caller graph for this function:

◆ applyPendingUpdates() [2/3]

void applyPendingUpdates ( LockType &&  treeLock,
RemoteUpdateGetter  getRemoteUpdate 
)
inline

The same as applyPendingUpdates(LockType, RemoteUpdateGetter, UpdateConsumer) but uses an noop as updateConsumer This overload is needed since the defaultparameter does not work.

Parameters
getRemoteUpdateFunction used to request a missing update.
See also
Tree::applyPendingUpdates

Definition at line 219 of file Tree.h.

+ Here is the call graph for this function:

◆ applyPendingUpdates() [3/3]

void applyPendingUpdates ( LockType &&  treeLock,
RemoteUpdateGetter  getRemoteUpdate,
UpdateConsumer  updateConsumer = [](Update&&) {} 
)
inline

Applies all pending updates.

Parameters
treeLockThe lock used to protect the update structures. It will be unlocked when getting a remote update.
getRemoteUpdateFunction used to request a missing update.
updateConsumerFunction used to consume updates after they were added. (will be moved to the consumer)

Definition at line 232 of file Tree.h.

◆ applyRadiusUpdate()

void applyRadiusUpdate ( const RadiusUpdate &  u)
protected

Applies a radius update to the tree.

Parameters
uThe update.

Definition at line 200 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyRewireUpdate()

void applyRewireUpdate ( const RewireUpdate &  rewireUpdate)
protected

Applies a rewire update to the tree.

Parameters
rewireUpdateThe update.

Definition at line 212 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyUpdate()

void applyUpdate ( const Update &  u)

Applies the given update.

Parameters
uThe update.

Definition at line 151 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ at() [1/4]

NodeType& at ( const NodeId &  id)
inline
Parameters
idThe node's id.
Returns
The requested node.

Definition at line 631 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ at() [2/4]

const NodeType& at ( const NodeId &  id) const
inline
Parameters
idThe node's id.
Returns
The requested node. (const)

Definition at line 639 of file Tree.h.

+ Here is the call graph for this function:

◆ at() [3/4]

NodeType& at ( std::size_t  index)
inline
Parameters
indexThe node's index.
Returns
The requested node.

Definition at line 647 of file Tree.h.

+ Here is the call graph for this function:

◆ at() [4/4]

const NodeType& at ( std::size_t  index) const
inline
Parameters
indexThe node's index.
Returns
The requested node. (const)

Definition at line 655 of file Tree.h.

+ Here is the call graph for this function:

◆ canApplyUpdate()

bool canApplyUpdate ( const Update &  u)
Parameters
uThe update.
Returns
Whether the given update can be applied.

Definition at line 136 of file Tree.cpp.

+ Here is the caller graph for this function:

◆ createNewGoalReachedUpdate()

void createNewGoalReachedUpdate ( const NodeId &  goal,
float  costToGoToGoal 
)
inlineprotected

Adds a new goal reached update to the current update.

Parameters
goalThe node that can reach the goal configuration.
costToGoToGoalThe cost to reach the goal configuration from the given node)

Definition at line 358 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewNodeCreationUpdate()

void createNewNodeCreationUpdate ( const ConfigType cfg,
const NodeId &  parent,
float  fromParentCost 
)
inlineprotected

Adds a new node creation update to the current update.

Parameters
cfgThe new node's configuration.
parentThe new node's parent node.
fromParentCostThe cost of the edge (node, parent)

Definition at line 339 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewRadiusUpdate()

void createNewRadiusUpdate ( const NodeId &  id,
bool  increaseRadius 
)
inlineprotected

Adds a new radius update to the current update.

Parameters
idThe node's id.
increaseRadiusWhether the node's radius increases.

Definition at line 329 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewRewireUpdate()

void createNewRewireUpdate ( const NodeId &  child,
const NodeId &  newParent,
float  fromParentCost 
)
inlineprotected

Adds a new node creation update to the current update.

Parameters
childThe rewired child node.
newParentThe new parent node.
fromParentCostThe cost of the edge (child, new parent)

Definition at line 349 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decreaseRadius()

void decreaseRadius ( const NodeId &  id)
inline

Decreases a node's radius.

(creates an appropriate update)

Parameters
idThe node.

Definition at line 509 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doAddGoalReached()

void doAddGoalReached ( const NodeId &  goal,
float  costToGoToGoal 
)
inlineprotected

Adds a node to the list of nodes that can reach the goal configuration.

Parameters
goalThe node to add.
costToGoToGoalThe cost to reach the gol configuration from the given node.

Definition at line 576 of file Tree.h.

+ Here is the caller graph for this function:

◆ doAddNode()

NodeId doAddNode ( ConfigType  cfg,
const NodeId &  parent,
float  fromParentCost,
std::size_t  workerId 
)
protected

Adds a node to the tree.

Parameters
cfgThe node's configuration.
parentThe node's parent.
fromParentCostThe cost of the edge (node, parent)
workerIdThe worker creating this node.
Returns
The new node's id.

Definition at line 261 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doDecreaseRadius()

void doDecreaseRadius ( const NodeId &  id)
protected

Decreases a node's radius.

Parameters
idThe node.

Definition at line 298 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doIncreaseRadius()

void doIncreaseRadius ( const NodeId &  id)
inlineprotected

Increases a node's radius.

Parameters
idThe node.

Definition at line 567 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doSetNodeParent()

void doSetNodeParent ( const NodeId &  child,
const NodeId &  newParent,
float  fromParentCost,
bool  updateFromStartCost = true 
)
protected

Sets the parent node of child to parent.

(costs are updated)

Parameters
childThe cild node.
newParentThe new parent node.
fromParentCostThe cost of the edge (child, new parent)
updateFromStartCostWhether to update the costs of the subtree beneath cild.

Definition at line 281 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findPendingUpdate() [1/2]

PendingUpdateLookuptableIterator findPendingUpdate ( std::size_t  workerId,
std::size_t  updateId 
)
inlineprotected
Parameters
workerIdThe update's worker.
updateIdThe update's sub id.
Returns
An iterator tho the pending update. (If it does not exist to end.)

Definition at line 469 of file Tree.h.

+ Here is the caller graph for this function:

◆ findPendingUpdate() [2/2]

PendingUpdateLookuptableConstIterator findPendingUpdate ( std::size_t  workerId,
std::size_t  updateId 
) const
inlineprotected
Parameters
workerIdThe update's worker.
updateIdThe update's sub id.
Returns
An iterator tho the pending update. (If it does not exist to end.) (const version)

Definition at line 479 of file Tree.h.

◆ getAppliedUpdateIds()

const Ice::LongSeq& getAppliedUpdateIds ( ) const
inline
Returns
List of ids of applied updates.

Definition at line 758 of file Tree.h.

+ Here is the caller graph for this function:

◆ getBestCost()

float getBestCost ( ) const
Returns
The cost of the shortest solution.

Definition at line 399 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBestCostIt()

std::deque<GoalInfo>::const_iterator getBestCostIt ( ) const
inlineprotected
Returns
An iterator to the node that can reach the goal configuration and results in the lowest path cost. (end if no path was found)

Definition at line 669 of file Tree.h.

+ Here is the caller graph for this function:

◆ getBestPath()

PathWithCost getBestPath ( ) const
Returns
The path with the lowest cost.

Definition at line 406 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentUpdate()

const Update& getCurrentUpdate ( ) const
inline
Returns
The currently constructed update.

Definition at line 278 of file Tree.h.

+ Here is the caller graph for this function:

◆ getCurrentUpdateId()

Ice::Long getCurrentUpdateId ( ) const
inline
Returns
The update sub id of the current update. (The one currently constructed, not the last send)

Definition at line 261 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentUpdateNonConst()

Update& getCurrentUpdateNonConst ( )
inlineprotected
Returns
The currently constructed update. (non const version for internal use)

Definition at line 286 of file Tree.h.

+ Here is the caller graph for this function:

◆ getIceTree()

FullIceTree getIceTree ( ) const
Returns
The current RRT with all updates applied. (used to transmitt it through ice.)

Definition at line 458 of file Tree.cpp.

+ Here is the caller graph for this function:

◆ getIdOfIndex()

NodeId getIdOfIndex ( std::size_t  index) const
Parameters
indexThe index.
Returns
The id corresponding to the given node index.

Definition at line 372 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getKNearestNeighboursAndDistances()

std::vector< std::pair< NodeId, float > > getKNearestNeighboursAndDistances ( const ConfigType cfg,
std::size_t  k 
)
Parameters
cfgThe configuration.
kThe number of neighbours.
Returns
The k nearest neighbours of and their distance to the given configuration.

Definition at line 311 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalUpdates()

const std::deque<Update>& getLocalUpdates ( ) const
inline
Returns
Returns all updates send by this tree.

Definition at line 156 of file Tree.h.

+ Here is the caller graph for this function:

◆ getNearestNeighbourAndDistance()

std::pair<NodeId, float> getNearestNeighbourAndDistance ( const ConfigType cfg)
inline
Parameters
cfgThe configuration.
Returns
The nearest neighbour of and its distance to the given configuration.

Definition at line 593 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextNodeIdFor()

NodeId getNextNodeIdFor ( std::size_t  workerId)
inline
Parameters
workerIdThe worker's id.
Returns
The next node id for the given worker.

Definition at line 744 of file Tree.h.

+ Here is the caller graph for this function:

◆ getNode() [1/2]

Tree::NodeType & getNode ( const NodeId &  id)
Parameters
idThe node's id.
Returns
The requested node.

Definition at line 354 of file Tree.cpp.

+ Here is the caller graph for this function:

◆ getNode() [2/2]

const Tree::NodeType & getNode ( const NodeId &  id) const
Parameters
idThe node's id.
Returns
The requested node. (const)

Definition at line 363 of file Tree.cpp.

◆ getNodes()

const std::deque<std::deque<NodeType> >& getNodes ( ) const
inline
Returns
All nodes.

Definition at line 610 of file Tree.h.

+ Here is the caller graph for this function:

◆ getNthPathCost()

float getNthPathCost ( std::size_t  n) const
inline
Parameters
nThe paths index.
Returns
The cost of the given path.

Definition at line 717 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNthPathIds()

NodeIdList getNthPathIds ( std::size_t  n) const
Parameters
nThe path's index.
Returns
The node ids of nodes contained by the given path.

Definition at line 420 of file Tree.cpp.

+ Here is the call graph for this function:

◆ getNthPathWithCost()

PathWithCost getNthPathWithCost ( std::size_t  n) const
Parameters
nN
Returns
The nth path.

Definition at line 413 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPathCount()

std::size_t getPathCount ( ) const
inline
Returns
The number of paths found.

Definition at line 708 of file Tree.h.

+ Here is the caller graph for this function:

◆ getPathTo()

VectorXfSeq getPathTo ( NodeId  id) const
protected
Parameters
idThe node's id.
Returns
Returns a path to the requested node.

Definition at line 440 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPendingUpdate()

const Update& getPendingUpdate ( std::size_t  workerId,
std::size_t  updateId 
) const
inline
Parameters
workerIdThe update's worker id.
updateIdThe update's sub id.
Returns
Returns the requested update from the list of pending updates.

Definition at line 186 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPreviousUpdateId()

Ice::Long getPreviousUpdateId ( ) const
inline
Returns
The update sub id of the last send update.

Definition at line 270 of file Tree.h.

+ Here is the caller graph for this function:

◆ hasAppliedUpdate()

bool hasAppliedUpdate ( std::size_t  workerId,
Ice::Long  updateId 
)
inline
Parameters
workerIdThe update's worker id.
updateIdThe update's sub id.
Returns
Whether the given update was applied.

Definition at line 166 of file Tree.h.

+ Here is the caller graph for this function:

◆ hasGoalNode()

bool hasGoalNode ( const NodeId &  nodeId) const
inline
Parameters
nodeIdThe node to check.
Returns
Whether the given node is a node in the list of nodes able to reach the goal configuration.

Definition at line 693 of file Tree.h.

◆ hasPendingUpdate()

bool hasPendingUpdate ( std::size_t  workerId,
std::size_t  updateId 
) const
inline
Parameters
workerIdThe update's worker id.
updateIdThe update's sub id.
Returns
Whether the given update is in the list of pending updates.

Definition at line 176 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ increaseRadius()

void increaseRadius ( const NodeId &  id)
inline

Increases a node's radius.

(creates an appropriate update)

Parameters
idThe node.

Definition at line 518 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ increaseWorkerCountTo()

void increaseWorkerCountTo ( std::size_t  count)

Increases the storage of all data structures to be appropriate for count workers.

Parameters
countThe number of workers.

Definition at line 122 of file Tree.cpp.

+ Here is the caller graph for this function:

◆ init()

void init ( const FullIceTree &  iceTree,
AdaptiveDynamicDomainParameters  newaddParams,
std::size_t  newWorkerId 
)

Initailizes the tree from the given tree.

Parameters
iceTreeThe tree to use as initial state.
newaddParamsThe new adaptive dynamic domain parameters.
newWorkerIdThe owner's worker id.

Definition at line 65 of file Tree.cpp.

+ Here is the caller graph for this function:

◆ prepareNextUpdate()

void prepareNextUpdate ( )
protected

Prepares the next update.

(the update to be send)

Definition at line 233 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareUpdate()

void prepareUpdate ( Ice::LongSeq  dependetOnUpdateIds,
LockType &&  treeLock,
RemoteUpdateGetter  getRemoteUpdate,
UpdateConsumer  updateConsumer 
)
inline

Prepares an update by applying all dependet on updates.

Parameters
dependetOnUpdateIdsThe ids of dependet on updates.
treeLockThe lock used to protect the update structures. It will be unlocked when getting a remote update.
getRemoteUpdateFunction used to request a missing update.
updateConsumerFunction used to consume updates after they were added. (will be moved to the consumer)

Definition at line 423 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pushCosts()

void pushCosts ( const NodeId &  root)
protected

Updates fromStartCosts for all children from root.

Parameters
rootThe root node for the cost update.

Definition at line 252 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendCurrentUpdate()

void sendCurrentUpdate ( TreeUpdateInterfacePrx &  prx)

Sends the current update to the given proxy.

A new update is prepared afterwards.

Parameters
prxThe proxy to send the update to.

Definition at line 189 of file Tree.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNodeParent()

void setNodeParent ( const NodeId &  child,
const NodeId &  newParent,
float  fromParentCost 
)
inline

Sets the parent node of child to parent.

(costs are updated) (creates an appropriate update)

Parameters
childThe cild node.
newParentThe new parent node.
fromParentCostThe cost of the edge (child, new parent)

Definition at line 500 of file Tree.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

std::size_t size ( ) const
inline
Returns
The number of nodes in the tree.

Definition at line 623 of file Tree.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ addParams

AdaptiveDynamicDomainParameters addParams
protected

The parameters of adaptive dynamic domain)

Definition at line 789 of file Tree.h.

◆ appliedUpdateIds

Ice::LongSeq appliedUpdateIds
protected

List of ids of applied updates.

Definition at line 767 of file Tree.h.

◆ goalNodes

std::deque<GoalInfo> goalNodes
protected

List of nodes able to reach the goal configuration.

Definition at line 784 of file Tree.h.

◆ localUpdates

std::deque<Update> localUpdates
protected

Updates created by this tree.

Definition at line 774 of file Tree.h.

◆ nodeCount

std::size_t nodeCount
protected

The number of nodes in the rrt.

Definition at line 798 of file Tree.h.

◆ nodes

std::deque<std::deque<NodeType> > nodes
protected

Holds all nodes.

The node nodes[i][j] is the jth node created by worker i.

Definition at line 780 of file Tree.h.

◆ pendingUpdates

std::deque<Update> pendingUpdates
protected

Updates to apply to the tree.

Definition at line 803 of file Tree.h.

◆ pendingUpdatesLookupTable

PendingUpdateLookuptableType pendingUpdatesLookupTable
protected

Speeds up lookup for available updates.

(O(log(n)) instead of O(n))

maps from UpdateId to the corresponding index in the pendingUpdates vector

Definition at line 810 of file Tree.h.

◆ ROOT_ID

const NodeId ROOT_ID
static
Initial value:
{
0, 0
}

The root node's id.

Definition at line 753 of file Tree.h.

◆ workerId

std::size_t workerId
protected

The worker id of this trees owner.

(only used for sending updates and skipping updates send by this tree)

Definition at line 794 of file Tree.h.


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