Tree.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package RobotComponents
19  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl.txt
22  * GNU General Public License
23  */
24 
25 #include <limits>
26 
27 #include "../../util/Metrics.h"
28 
29 #include "Tree.h"
30 #include "WorkerNode.h"
31 
33 
34 namespace armarx::addirrtstar
35 {
36  const NodeId Tree::ROOT_ID
37  {
38  0, 0
39  };
40 
41  Tree::Tree(const VectorXf& startCfg)
42  {
43  init(
44  FullIceTree
45  {
46  FullNodeDataListList{
47  FullNodeDataList{
48  FullNodeData{
49  startCfg, //config
50  ROOT_ID, //parent
51  std::numeric_limits<Ice::Float>::infinity(), //radius;
52  0.f //fromParentCost
53  }
54  }
55  },
56  Ice::LongSeq{ -1}
57  },
58  AdaptiveDynamicDomainParameters {1, 1, 1},
59  -1 //since this tree does no updates the id is not important
60  );
61  }
62 
63  //init
64  void Tree::init
65  (
66  const FullIceTree& iceTree,
67  AdaptiveDynamicDomainParameters newaddParams,
68  std::size_t newWorkerId
69  )
70  {
71  addParams = newaddParams;
72  workerId = newWorkerId;
73 
74  //goals
75  goalNodes.clear();
76 
77  //updates
78  localUpdates.clear();
79  prepareNextUpdate();
80  appliedUpdateIds.clear();
81  appliedUpdateIds = iceTree.updateIds;
82 
83  //get storage (+ default objects)
84  nodes.clear();
85  nodeCount = 0;
86 
87  for (const auto& workerNodes : iceTree.nodes)
88  {
89  nodeCount += workerNodes.size();
90  nodes.emplace_back();
91  nodes.back().resize(workerNodes.size());
92  }
93 
94  ARMARX_CHECK_EXPRESSION(nodes.size() == iceTree.nodes.size());
95 
96  //copy node data
97  for (std::size_t wId = 0; wId < nodes.size(); ++wId)
98  {
99  for (std::size_t nId = 0; nId < nodes.at(wId).size(); ++nId)
100  {
101  NodeType& localNode = nodes.at(wId).at(nId);
102  const FullNodeData& iceNode = iceTree.nodes.at(wId).at(nId);
103  localNode.config = iceNode.config;
104  localNode.parent = iceNode.parent;
105  localNode.radius = iceNode.radius;
106  localNode.fromParentCost = iceNode.fromParentCost;
107  //register as child !!This adds root as child of root!!
108  getNode(localNode.parent).children.insert(NodeId
109  {
110  static_cast<Ice::Long>(wId),
111  static_cast<Ice::Long>(nId)
112  });
113  }
114  }
115 
116  //remove root as child of root
117  getNode(ROOT_ID).children.erase(ROOT_ID);
118  //push all costs from root
119  pushCosts(ROOT_ID);
120  }
121 
122  void Tree::increaseWorkerCountTo(std::size_t count)
123  {
124  if (appliedUpdateIds.size() < count)
125  {
126  appliedUpdateIds.resize(count, -1);
127  }
128 
129  if (nodes.size() < count)
130  {
131  nodes.resize(count);
132  }
133  }
134 
135  //updating
136  bool Tree::canApplyUpdate(const Update& u)
137  {
138  ARMARX_CHECK_EXPRESSION(u.dependetOnUpdateIds.size() <= appliedUpdateIds.size());
139 
140  for (std::size_t i = 0; i < u.dependetOnUpdateIds.size(); ++i)
141  {
142  if (appliedUpdateIds.at(i) < u.dependetOnUpdateIds.at(i))
143  {
144  return false;
145  }
146  }
147 
148  return true;
149  }
150 
151  void Tree::applyUpdate(const Update& u)
152  {
153  const auto workerId = getUpdatesWorkerId(u);
156  ARMARX_CHECK_EXPRESSION(u.dependetOnUpdateIds.size() <= appliedUpdateIds.size());
158 
159  //do we need more worker?
160  if (workerId > nodes.size())
161  {
162  nodes.resize(workerId);
163  }
164 
165  //apply all nodeUpdates
166  for (const auto& nodeCreationUpdate : u.nodes)
167  {
168  applyNodeCreationUpdate(nodeCreationUpdate, workerId);
169  }
170 
171  //apply rewireUpdates
172  for (const auto& rewireUpdate : u.rewires)
173  {
174  applyRewireUpdate(rewireUpdate);
175  }
176 
177  //apply radiusUpdates
178  for (const auto& radiusUpdate : u.radii)
179  {
180  applyRadiusUpdate(radiusUpdate);
181  }
182 
183  //add new goal nodes
184  applyGoalReachedUpdates(u.newGoalNodes);
185  //increment status
186  ++(appliedUpdateIds.at(workerId));
187  }
188 
189  void Tree::sendCurrentUpdate(TreeUpdateInterfacePrx& prx)
190  {
192  getCurrentUpdateNonConst().dependetOnUpdateIds = appliedUpdateIds;
193  prx->updateTree(getCurrentUpdate());
194  //begin the next update
196  //the update of this tree now counts as applied
197  ++(appliedUpdateIds.at(workerId));
198  }
199 
200  void Tree::applyRadiusUpdate(const RadiusUpdate& u)
201  {
202  if (u.increase)
203  {
204  doIncreaseRadius(u.node);
205  }
206  else
207  {
208  doDecreaseRadius(u.node);
209  }
210  }
211 
212  void Tree::applyRewireUpdate(const RewireUpdate& rewireUpdate)
213  {
214  //only rewire if it improves the cost
215  const NodeId& child = rewireUpdate.child;
216  const NodeId& newParent = rewireUpdate.newParent;
217 
218  const auto costOld = getNode(child).fromStartCost;
219  const auto costNew = getNode(newParent).fromStartCost + rewireUpdate.fromNewParentCost;
220 
221  if (
222  costOld < costNew ||
223  ((costOld == costNew) && (rewireUpdate.newParent.workerId > getNode(child).parent.workerId)) //corner case
224  )
225  {
226  //skip this update
227  return;
228  }
229 
230  doSetNodeParent(child, newParent, rewireUpdate.fromNewParentCost);
231  }
232 
234  {
235  localUpdates.emplace_back();
236  getCurrentUpdateNonConst().workerId = workerId;
237  //dependent update ids gets set when the update is send
238  }
239 
240  //changing the tree from the rrt algorithm
241  NodeId Tree::addNode(ConfigType cfg, const NodeId& parent, float fromParentCost)
242  {
243  //add to current tree update
244  createNewNodeCreationUpdate(cfg, parent, fromParentCost);
245  //update parent
246  increaseRadius(parent);
247  //apply update
248  return doAddNode(cfg, parent, fromParentCost, workerId);
249  }
250 
251  //change the tree
252  void Tree::pushCosts(const NodeId& root)
253  {
254  for (const auto& child : getNode(root).children)
255  {
257  pushCosts(child);
258  }
259  }
260 
261  NodeId Tree::doAddNode(ConfigType cfg, const NodeId& parent, float fromParentCost, std::size_t workerId)
262  {
263  NodeId id = getNextNodeIdFor(workerId);
264  auto& parentNode = getNode(parent);
265  ++nodeCount;
266  nodes.at(workerId).emplace_back(NodeType
267  {
268  cfg,
269  parent,
270  std::numeric_limits<float>::infinity(),//radius
271  fromParentCost,
272  parentNode.fromStartCost + fromParentCost,
273  std::set<NodeId>{} //children
274  });
275 
276  parentNode.children.insert(id);
277 
278  return id;
279  }
280 
281  void Tree::doSetNodeParent(const NodeId& child, const NodeId& newParent, float fromParentCost, bool updateFromStartCost)
282  {
283  const auto oldParent = getNode(child).parent;
284  getNode(child).parent = newParent;
285  //update forward edges
286  getNode(oldParent).children.erase(child);
287  getNode(newParent).children.insert(child);
288  //update costs
289  getNode(child).fromParentCost = fromParentCost;
290 
291  if (updateFromStartCost)
292  {
293  getNode(child).fromStartCost = fromParentCost + getNode(newParent).fromStartCost;
294  pushCosts(child);
295  }
296  }
297 
298  void Tree::doDecreaseRadius(const NodeId& id)
299  {
300  if (getNode(id).radius < std::numeric_limits<float>::infinity())
301  {
302  getNode(id).radius = std::max(getNode(id).radius * (1.f - addParams.alpha), addParams.minimalRadius);
303  }
304  else
305  {
306  getNode(id).radius = addParams.initialBorderRadius;
307  }
308  }
309 
310  //querry the tree
311  std::vector<std::pair<NodeId, float>> Tree::getKNearestNeighboursAndDistances(const ConfigType& cfg, std::size_t k)
312  {
313  //change k to fit size
314  //k = std::min(k, size());
315  //calc all distances and use nth element + resize + shrik to fit to get the best k
316  std::vector<std::pair<NodeId, float>> idDistanceVector {};
317  idDistanceVector.reserve(size());
318 
319  for (std::size_t workerLevelIndex = 0; workerLevelIndex < nodes.size(); ++workerLevelIndex)
320  {
321  for (std::size_t nodeLevelIndex = 0; nodeLevelIndex < nodes.at(workerLevelIndex).size(); ++nodeLevelIndex)
322  {
323  const NodeId id
324  {
325  static_cast<Ice::Long>(workerLevelIndex), static_cast<Ice::Long>(nodeLevelIndex)
326  };
327  const auto dist = WorkerNode::distance(nodes.at(workerLevelIndex).at(nodeLevelIndex).config, cfg);
328  idDistanceVector.emplace_back(id, dist);
329  }
330  }
331 
332  ARMARX_CHECK_EXPRESSION(idDistanceVector.size() == size());
333 
334  //if we have <= k elements we dont need to search the smalles elements.
335  if (k < idDistanceVector.size())
336  {
337  std::nth_element(
338  idDistanceVector.begin(),
339  idDistanceVector.begin() + (k - 1),
340  idDistanceVector.end(),
341  [](const std::pair<NodeId, float>& lhs, const std::pair<NodeId, float>& rhs)
342  {
343  return lhs.second < rhs.second;
344  }
345  );
346  idDistanceVector.resize(k);
347  //we could be using a large amount of memory => try to free it
348  idDistanceVector.shrink_to_fit();
349  }
350 
351  return idDistanceVector;
352  }
353 
354  Tree::NodeType& Tree::getNode(const NodeId& id)
355  {
356  const auto worker = static_cast<std::size_t>(id.workerId);
357  const auto node = static_cast<std::size_t>(id.numberOfNode);
358  ARMARX_CHECK_EXPRESSION(worker < nodes.size());
359  ARMARX_CHECK_EXPRESSION(node < nodes.at(worker).size());
360  return nodes.at(worker).at(node);
361  }
362 
363  const Tree::NodeType& Tree::getNode(const NodeId& id) const
364  {
365  const auto worker = static_cast<std::size_t>(id.workerId);
366  const auto node = static_cast<std::size_t>(id.numberOfNode);
367  ARMARX_CHECK_EXPRESSION(worker < nodes.size());
368  ARMARX_CHECK_EXPRESSION(node < nodes.at(worker).size());
369  return nodes.at(worker).at(node);
370  }
371 
372  NodeId Tree::getIdOfIndex(std::size_t index) const
373  {
374  if (index >= size())
375  {
376  throw std::out_of_range {"index >= size"};
377  }
378 
379  Ice::Long worker = 0;
380 
381  for (const auto& workerNodes : nodes)
382  {
383  if (index < workerNodes.size())
384  {
385  return {worker, static_cast<Ice::Long>(index)};
386  }
387 
388  //adjust
389  worker++;
390  index -= workerNodes.size();
391  }
392 
393  //since this tree should never decrease its size this line of code should never be called!
394  //it could be called if a thread is concurrently changing the size of nodes,
395  //causing iterators to be invalidated (thus causing ub while iterating in for(...))
396  throw std::logic_error {"Tree size decreased during id calculation!"};
397  }
398 
399  float Tree::getBestCost() const
400  {
401  auto min_elem = getBestCostIt();
402  return ((min_elem == goalNodes.end()) ? std::numeric_limits<float>::infinity() : getNode(min_elem->node).fromStartCost + min_elem->costToGoToGoal);
403  }
404 
405  //querry for paths
406  PathWithCost Tree::getBestPath() const
407  {
408  auto min_elem = getBestCostIt();
409  ARMARX_CHECK_EXPRESSION(min_elem != goalNodes.end());
410  const auto id = min_elem->node;
411  return PathWithCost {getPathTo(id), getNode(id).fromStartCost + min_elem->costToGoToGoal, "bestPath"};
412  }
413  PathWithCost Tree::getNthPathWithCost(std::size_t n) const
414  {
416  //for client side request the index should be in bounds
417  return PathWithCost {getPathTo(goalNodes.at(n).node), getNthPathCost(n), "Path_" + to_string(n)};
418  }
419 
420  NodeIdList Tree::getNthPathIds(std::size_t n) const
421  {
423  NodeIdList pathIds;
424  auto id = goalNodes.at(n).node;
425 
426  //build reversed path
427  while (id != ROOT_ID)
428  {
429  const auto& node = getNode(id);
430  pathIds.emplace_back(id);
431  id = node.parent;
432  }
433 
434  //add the start node
435  pathIds.emplace_back(ROOT_ID);
436  std::reverse(pathIds.begin(), pathIds.end());
437  return pathIds;
438  }
439 
440  VectorXfSeq Tree::getPathTo(NodeId id) const
441  {
442  VectorXfSeq path;
443 
444  //build reversed path
445  while (id != ROOT_ID)
446  {
447  const auto& node = getNode(id);
448  path.emplace_back(node.config);
449  id = node.parent;
450  }
451 
452  //add the start node
453  path.emplace_back(getNode(ROOT_ID).config);
454  std::reverse(path.begin(), path.end());
455  return path;
456  }
457 
458  FullIceTree Tree::getIceTree() const
459  {
460  FullNodeDataListList allNodes {};
461  allNodes.resize(nodes.size());
462 
463  for (std::size_t workerLevelIndex = 0; workerLevelIndex < nodes.size(); ++workerLevelIndex)
464  {
465  FullNodeDataList& iceWorkerNodes = allNodes.at(workerLevelIndex);
466  const auto& workerNodes = nodes.at(workerLevelIndex);
467  iceWorkerNodes.resize(workerNodes.size());
468 
469  for (std::size_t nodeLevelIndex = 0; nodeLevelIndex < iceWorkerNodes.size(); ++nodeLevelIndex)
470  {
471  const auto& localNode = workerNodes.at(nodeLevelIndex);
472  FullNodeData& iceNode = iceWorkerNodes.at(nodeLevelIndex);
473  iceNode.config = localNode.config;
474  iceNode.parent = localNode.parent;
475  iceNode.radius = localNode.radius;
476  iceNode.fromParentCost = localNode.fromParentCost;
477  }
478  }
479 
480  return FullIceTree {allNodes, appliedUpdateIds};
481  }
482 
483  void Tree::addPendingUpdate(const Update& u)
484  {
485  //fill up last spaces with no update (-1)
486  // increaseWorkerCountTo(u.dependetOnUpdateIds.size());//can't be called here because it invalidates iterators on nodes
487  const auto nodeId = getUpdatesWorkerId(u);
488  const auto updateSubId = getUpdatesSubId(u);
489 
490  if (hasPendingUpdate(nodeId, updateSubId))
491  {
492  return;
493  }
494 
495  pendingUpdatesLookupTable[std::make_pair(nodeId, updateSubId)] = pendingUpdates.size();
496  pendingUpdates.emplace_back(u);
497  }
498 }
499 
armarx::addirrtstar::Tree::createNewNodeCreationUpdate
void createNewNodeCreationUpdate(const ConfigType &cfg, const NodeId &parent, float fromParentCost)
Adds a new node creation update to the current update.
Definition: Tree.h:339
armarx::addirrtstar::Tree::pendingUpdatesLookupTable
PendingUpdateLookuptableType pendingUpdatesLookupTable
Speeds up lookup for available updates.
Definition: Tree.h:810
armarx::addirrtstar::Tree::canApplyUpdate
bool canApplyUpdate(const Update &u)
Definition: Tree.cpp:136
WorkerNode.h
armarx::addirrtstar::Tree::size
std::size_t size() const
Definition: Tree.h:623
armarx::addirrtstar::Tree::getNthPathIds
NodeIdList getNthPathIds(std::size_t n) const
Definition: Tree.cpp:420
armarx::addirrtstar::Tree::doDecreaseRadius
void doDecreaseRadius(const NodeId &id)
Decreases a node's radius.
Definition: Tree.cpp:298
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::addirrtstar::Tree::getBestPath
PathWithCost getBestPath() const
Definition: Tree.cpp:406
armarx::addirrtstar::Tree::nodeCount
std::size_t nodeCount
The number of nodes in the rrt.
Definition: Tree.h:798
armarx::addirrtstar::Tree::addParams
AdaptiveDynamicDomainParameters addParams
The parameters of adaptive dynamic domain)
Definition: Tree.h:789
armarx::addirrtstar::Tree::init
void init(const FullIceTree &iceTree, AdaptiveDynamicDomainParameters newaddParams, std::size_t newWorkerId)
Initailizes the tree from the given tree.
Definition: Tree.cpp:65
armarx::addirrtstar::Tree::getNextNodeIdFor
NodeId getNextNodeIdFor(std::size_t workerId)
Definition: Tree.h:744
armarx::addirrtstar::Tree::NodeType::config
ConfigType config
The node's configuration.
Definition: Tree.h:65
armarx::addirrtstar::Tree::getNthPathCost
float getNthPathCost(std::size_t n) const
Definition: Tree.h:717
armarx::addirrtstar::Tree::appliedUpdateIds
Ice::LongSeq appliedUpdateIds
List of ids of applied updates.
Definition: Tree.h:767
armarx::addirrtstar::Tree::NodeType
Represents a node of thr rrt.
Definition: Tree.h:60
armarx::addirrtstar::Tree::addNode
NodeId addNode(ConfigType cfg, const NodeId &parent, float fromParentCost)
Adds a node to the tree.
Definition: Tree.cpp:241
armarx::addirrtstar::Tree::doAddNode
NodeId doAddNode(ConfigType cfg, const NodeId &parent, float fromParentCost, std::size_t workerId)
Adds a node to the tree.
Definition: Tree.cpp:261
armarx::addirrtstar::Tree::ConfigType
VectorXf ConfigType
The type of configurations.
Definition: Tree.h:56
Tree.h
armarx::addirrtstar::Tree::applyNodeCreationUpdate
void applyNodeCreationUpdate(const NodeCreationUpdate &u, std::size_t workerId)
Applies a node creation update to the tree.
Definition: Tree.h:301
armarx::addirrtstar::Tree::NodeType::radius
float radius
The node's radius.
Definition: Tree.h:73
armarx::addirrtstar::WorkerNode::distance
static float distance(const ConfigType &from, const ConfigType &to)
Calculates the euclidian distance between from and to.
Definition: WorkerNode.h:203
StringHelpers.h
armarx::addirrtstar::Tree::applyGoalReachedUpdates
void applyGoalReachedUpdates(const GoalInfoList newGoalNodes)
Applies multiple goal reached updates to the tree.
Definition: Tree.h:314
armarx::reverse
T reverse(const T &o)
Definition: container.h:32
armarx::addirrtstar::Tree::NodeType::parent
NodeId parent
The node's parent.
Definition: Tree.h:69
armarx::addirrtstar::Tree::applyUpdate
void applyUpdate(const Update &u)
Applies the given update.
Definition: Tree.cpp:151
armarx::addirrtstar::Tree::applyRewireUpdate
void applyRewireUpdate(const RewireUpdate &rewireUpdate)
Applies a rewire update to the tree.
Definition: Tree.cpp:212
armarx::addirrtstar::Tree::sendCurrentUpdate
void sendCurrentUpdate(TreeUpdateInterfacePrx &prx)
Sends the current update to the given proxy.
Definition: Tree.cpp:189
armarx::addirrtstar::Tree::getPathTo
VectorXfSeq getPathTo(NodeId id) const
Definition: Tree.cpp:440
armarx::addirrtstar::Tree::workerId
std::size_t workerId
The worker id of this trees owner.
Definition: Tree.h:794
armarx::addirrtstar::Tree::increaseRadius
void increaseRadius(const NodeId &id)
Increases a node's radius.
Definition: Tree.h:518
armarx::addirrtstar::Tree::applyRadiusUpdate
void applyRadiusUpdate(const RadiusUpdate &u)
Applies a radius update to the tree.
Definition: Tree.cpp:200
armarx::addirrtstar::Tree::Tree
Tree()=default
Default ctor.
armarx::addirrtstar::Tree::getLocalUpdates
const std::deque< Update > & getLocalUpdates() const
Definition: Tree.h:156
armarx::addirrtstar::Tree::doIncreaseRadius
void doIncreaseRadius(const NodeId &id)
Increases a node's radius.
Definition: Tree.h:567
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::addirrtstar::Tree::hasPendingUpdate
bool hasPendingUpdate(std::size_t workerId, std::size_t updateId) const
Definition: Tree.h:176
armarx::addirrtstar::Tree::getIceTree
FullIceTree getIceTree() const
Definition: Tree.cpp:458
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::addirrtstar::Tree::getNode
NodeType & getNode(const NodeId &id)
Definition: Tree.cpp:354
armarx::addirrtstar::Tree::getIdOfIndex
NodeId getIdOfIndex(std::size_t index) const
Definition: Tree.cpp:372
armarx::addirrtstar::Tree::localUpdates
std::deque< Update > localUpdates
Updates created by this tree.
Definition: Tree.h:774
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
armarx::addirrtstar::Tree::ROOT_ID
static const NodeId ROOT_ID
The root node's id.
Definition: Tree.h:753
armarx::addirrtstar::Tree::nodes
std::deque< std::deque< NodeType > > nodes
Holds all nodes.
Definition: Tree.h:780
armarx::addirrtstar::Tree::NodeType::fromStartCost
float fromStartCost
Cost of the path (sttart node, this node)
Definition: Tree.h:81
armarx::addirrtstar::Tree::getKNearestNeighboursAndDistances
std::vector< std::pair< NodeId, float > > getKNearestNeighboursAndDistances(const ConfigType &cfg, std::size_t k)
Definition: Tree.cpp:311
armarx::addirrtstar::Tree::goalNodes
std::deque< GoalInfo > goalNodes
List of nodes able to reach the goal configuration.
Definition: Tree.h:784
armarx::addirrtstar::Tree::NodeType::fromParentCost
float fromParentCost
Cost of the edge (parent node, this node)
Definition: Tree.h:77
armarx::addirrtstar::Tree::getCurrentUpdate
const Update & getCurrentUpdate() const
Definition: Tree.h:278
armarx::addirrtstar::Tree::getNthPathWithCost
PathWithCost getNthPathWithCost(std::size_t n) const
Definition: Tree.cpp:413
armarx::addirrtstar::Tree::doSetNodeParent
void doSetNodeParent(const NodeId &child, const NodeId &newParent, float fromParentCost, bool updateFromStartCost=true)
Sets the parent node of child to parent.
Definition: Tree.cpp:281
armarx::addirrtstar::Tree::getCurrentUpdateId
Ice::Long getCurrentUpdateId() const
Definition: Tree.h:261
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::addirrtstar::Tree::NodeType::children
std::set< NodeId > children
Link to all children nodes.
Definition: Tree.h:85
armarx::addirrtstar::Tree::addPendingUpdate
void addPendingUpdate(const Update &u)
Adds a new update to the list of pending updates.
Definition: Tree.cpp:483
armarx::addirrtstar::Tree::increaseWorkerCountTo
void increaseWorkerCountTo(std::size_t count)
Increases the storage of all data structures to be appropriate for count workers.
Definition: Tree.cpp:122
armarx::addirrtstar::Tree::getBestCost
float getBestCost() const
Definition: Tree.cpp:399
armarx::addirrtstar::Tree::getBestCostIt
std::deque< GoalInfo >::const_iterator getBestCostIt() const
Definition: Tree.h:669
armarx::addirrtstar::Tree::pendingUpdates
std::deque< Update > pendingUpdates
Updates to apply to the tree.
Definition: Tree.h:803
armarx::addirrtstar::Tree::getCurrentUpdateNonConst
Update & getCurrentUpdateNonConst()
Definition: Tree.h:286
armarx::addirrtstar::Tree::pushCosts
void pushCosts(const NodeId &root)
Updates fromStartCosts for all children from root.
Definition: Tree.cpp:252
armarx::addirrtstar::Tree::prepareNextUpdate
void prepareNextUpdate()
Prepares the next update.
Definition: Tree.cpp:233
armarx::addirrtstar
Definition: ManagerNode.cpp:35