Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# PotentialfieldAStarNode Class Reference

A class describing a node in an A* search tree. More...

`#include <AStarSearch.h>`

Collaboration diagram for PotentialfieldAStarNode:

[legend]
List of all members.

## Public Member Functions
| PotentialfieldAStarNode ()
| Constructor.
| PotentialfieldAStarNode (const PotentialfieldAStarNode &node)
| Copy-Constructor.
void | setParentNode (unsigned int parentNode)
| Sets the index of the parent node of this node.
unsigned int | getParentNode () const
| Returns the index of the parent node.
void | setFunctionValues (double g, double h)
| Sets the function values.
double | f () const
| Returns the value of this node.
double | g () const
| Returns the costs of the path to this node.
void | setPose (const PfPose &pose)
| Sets the pose of this node.
PfPose | getPose () const
| Returns the pose of this node.
void | setValueAtPos (const PotentialfieldAStarParameterSet &parameterSet)
| Sets the value of the potential field at the position of the node.
void | expand (std::vector< PotentialfieldAStarNode > &searchTree, const std::vector< unsigned int > &expandedNodes, const PotentialfieldAStarNode &goal, const PotentialfieldAStarParameterSet &parameterSet, unsigned int ownNodeNum)
| Expands this node.
bool | hasBeenExpanded () const
| Checks if this node has been expanded.
bool | hasReached (const PotentialfieldAStarNode &goal, const PotentialfieldAStarParameterSet &parameterSet) const
| Checks if this node has reached the goal.
double | distToOtherNode (const PotentialfieldAStarNode &other)
| Computes the distance to another node.
## Protected Member Functions
double | getExpansionRadius () const
| Returns the expansion radius of the node.
double | computeCostsTo (const PotentialfieldAStarNode &node, const PotentialfieldAStarParameterSet &parameterSet) const
| Computes the path costs to another node.
double | computeHeuristicBetween (const PfPose &p1, const PfPose &p2, unsigned int currentBranchingFactor) const
| Computes the heuristic costs between two positions.
void | computeCurrentParameters (double &currentExpansionRadius, unsigned int &currentBranchingFactor, const PotentialfieldAStarParameterSet &parameterSet) const
| Computes current parameters for expansion.
bool | tooCloseToAnotherNode (std::vector< PotentialfieldAStarNode > &searchTree, const std::vector< unsigned int > &expandedNodes, const PfPose &pose) const
| Checks if a new node is too close to another previously expanded node.
## Protected Attributes
PfPose | pose
| The pose of the node.
double | fValue
| The value of the node.
double | gValue
| The path costs to the node.
unsigned int | parentNode
| The index of the parent node.
bool | expanded
| Flag: true, if the node has been expanded.
double | valueAtPos
| The potential field value at the position of the node.
double | expansionRadius
| The expansion radius of the node.

## Detailed Description

A class describing a node in an A* search tree.

Definition at line 71 of file AStarSearch.h.

## Constructor & Destructor Documentation

PotentialfieldAStarNode::PotentialfieldAStarNode | ( |  | ) | `[inline]`

| Constructor. Definition at line 75 of file AStarSearch.h. References expanded, and parentNode.

PotentialfieldAStarNode::PotentialfieldAStarNode | ( | const PotentialfieldAStarNode & | node | ) | `[inline]`

  | Copy-Constructor. Parameters:
  node | Another node to copy data from
Definition at line 81 of file AStarSearch.h. References expanded, expansionRadius, fValue, gValue, parentNode, pose, and valueAtPos.

## Member Function Documentation

void PotentialfieldAStarNode::setParentNode | ( | unsigned int | parentNode | ) | `[inline]`

  | Sets the index of the parent node of this node. Parameters:
  parentNode | The index of the parent node
Definition at line 95 of file AStarSearch.h. Referenced by expand().

unsigned int PotentialfieldAStarNode::getParentNode | ( |  | ) | const`[inline]`

| Returns the index of the parent node. Returns: The parent node Definition at line 101 of file AStarSearch.h. References parentNode.

void PotentialfieldAStarNode::setFunctionValues | ( | double | g,
|  | double | h
| ) | `[inline]`

  | Sets the function values. Parameters:
  g | The costs of the path to this node
  h | The heuristic costs from this node to the goal
Definition at line 108 of file AStarSearch.h. References fValue, and gValue. Referenced by expand(), and Motionfield::getFieldVecFromAStarSearch().

double PotentialfieldAStarNode::f | ( |  | ) | const`[inline]`

| Returns the value of this node. Returns: The value f Definition at line 114 of file AStarSearch.h. References fValue.

double PotentialfieldAStarNode::g | ( |  | ) | const`[inline]`

| Returns the costs of the path to this node. Returns: The path costs g Definition at line 120 of file AStarSearch.h. References gValue.

void PotentialfieldAStarNode::setPose | ( | const PfPose & | pose | ) | `[inline]`

  | Sets the pose of this node. Parameters:
  pose | The pose
Definition at line 126 of file AStarSearch.h. Referenced by expand(), and Motionfield::getFieldVecFromAStarSearch().

PfPose PotentialfieldAStarNode::getPose | ( |  | ) | const`[inline]`

| Returns the pose of this node. Returns: The pose Definition at line 132 of file AStarSearch.h. References pose. Referenced by distToOtherNode(), expand(), Motionfield::getFieldVecFromAStarSearch(), and hasReached().

void PotentialfieldAStarNode::setValueAtPos | ( | const PotentialfieldAStarParameterSet & | parameterSet | ) |

  | Sets the value of the potential field at the position of the node. Parameters:
  parameterSet | The parameter set
Definition at line 14 of file AStarSearch.cpp. References PotentialFieldsObject::computeChargeAt(), PotentialfieldAStarParameterSet::field, Potentialfield::getFieldValueAt(), PotentialfieldAStarParameterSet::numberOfCalls, pose, PotentialfieldAStarParameterSet::stabilizationObject, PotentialfieldAStarParameterSet::useStabilization, and valueAtPos. Referenced by expand(), and Motionfield::getFieldVecFromAStarSearch().

Here is the call graph for this function:

void PotentialfieldAStarNode::expand | ( | std::vector< PotentialfieldAStarNode > & | searchTree,
|  | const std::vector< unsigned int > & | expandedNodes,
|  | const PotentialfieldAStarNode & | goal,
|  | const PotentialfieldAStarParameterSet & | parameterSet,
|  | unsigned int | ownNodeNum
| ) |

  | Expands this node. Parameters:
  searchTree | The search tree of A* search, new nodes will be inserted
  expandedNodes | A list of previously expanded nodes
  goal | The goal of the search
  parameterSet | The parameter set for the search
  ownNodeNum | The index of this node (in the seachTree)
Definition at line 25 of file AStarSearch.cpp. References PfPose::addVector(), computeCostsTo(), computeCurrentParameters(), computeHeuristicBetween(), expanded, expansionRadius, PfPose::getAngleTo(), getPose(), gValue, parentNode, pi, pi2, PfPose::pos, pose, PfVec::rotate(), setFunctionValues(), setParentNode(), setPose(), setValueAtPos(), and tooCloseToAnotherNode().

Here is the call graph for this function:

bool PotentialfieldAStarNode::hasBeenExpanded | ( |  | ) | const`[inline]`

| Checks if this node has been expanded. Returns: true, if the node has been expanded Definition at line 156 of file AStarSearch.h. References expanded.

bool PotentialfieldAStarNode::hasReached | ( | const PotentialfieldAStarNode & | goal,
|  | const PotentialfieldAStarParameterSet & | parameterSet
| ) | const

  | Checks if this node has reached the goal. Parameters:
  goal | The goal
  parameterSet | The parameter set
Returns: true, if the node has reached the goal Definition at line 63 of file AStarSearch.cpp. References PotentialfieldAStarParameterSet::distanceToGoal, expansionRadius, getPose(), PfPose::pos, and pose.

Here is the call graph for this function:

double PotentialfieldAStarNode::distToOtherNode | ( | const PotentialfieldAStarNode & | other | ) | `[inline]`

  | Computes the distance to another node. Parameters:
  other | The other node
Returns: The distance Definition at line 171 of file AStarSearch.h. References getPose(), PfPose::pos, and pose.

Here is the call graph for this function:

double PotentialfieldAStarNode::getExpansionRadius | ( |  | ) | const`[inline, protected]`

| Returns the expansion radius of the node. Returns: The expansion radius Definition at line 193 of file AStarSearch.h. References expansionRadius.

double PotentialfieldAStarNode::computeCostsTo | ( | const PotentialfieldAStarNode & | node,
|  | const PotentialfieldAStarParameterSet & | parameterSet
| ) | const`[inline, protected]`

  | Computes the path costs to another node. Parameters:
  node | The other node
  parameterSet | The parameter set
Returns: The path costs Definition at line 73 of file AStarSearch.cpp. References expansionRadius, and valueAtPos. Referenced by expand().

double PotentialfieldAStarNode::computeHeuristicBetween | ( | const PfPose & | p1,
|  | const PfPose & | p2,
|  | unsigned int | currentBranchingFactor
| ) | const`[inline, protected]`

  | Computes the heuristic costs between two positions. Parameters:
  p1 | The first position
  p2 | The second position
  currentBranchingFactor | The current branching factor
Returns: The heuristic costs Definition at line 88 of file AStarSearch.cpp. References EPSILON, expansionRadius, PfPose::getAngleTo(), pi2, PfPose::pos, PfVec::rotate(), PfVec::x, and PfVec::y. Referenced by expand().

Here is the call graph for this function:

void PotentialfieldAStarNode::computeCurrentParameters | ( | double & | currentExpansionRadius,
|  | unsigned int & | currentBranchingFactor,
|  | const PotentialfieldAStarParameterSet & | parameterSet
| ) | const`[inline, protected]`

  | Computes current parameters for expansion. Parameters:
  currentExpansionRadius | The current expansion radius
  currentBranchingFactor | The current branching factor
  parameterSet | The parameter set
Definition at line 136 of file AStarSearch.cpp. References PfVec::distanceTo(), PotentialfieldAStarParameterSet::endOfFar, PotentialfieldAStarParameterSet::endOfNear, PotentialfieldAStarParameterSet::maxBranchingFactor, PotentialfieldAStarParameterSet::maxExpansionRadius, PotentialfieldAStarParameterSet::minBranchingFactor, PotentialfieldAStarParameterSet::minExpansionRadius, PfPose::pos, pose, and PotentialfieldAStarParameterSet::startPosition. Referenced by expand().

Here is the call graph for this function:

bool PotentialfieldAStarNode::tooCloseToAnotherNode | ( | std::vector< PotentialfieldAStarNode > & | searchTree,
|  | const std::vector< unsigned int > & | expandedNodes,
|  | const PfPose & | pose
| ) | const`[protected]`

  | Checks if a new node is too close to another previously expanded node. Parameters:
  searchTree | The search tree
  expandedNodes | A list containing all previously expanded nodes
  pose | The pose of the new node
Returns: true, if the pose is too close Definition at line 163 of file AStarSearch.cpp. References PfPose::pos. Referenced by expand().

## Member Data Documentation

PfPose PotentialfieldAStarNode::pose`[protected]`

| The pose of the node. Definition at line 176 of file AStarSearch.h. Referenced by computeCurrentParameters(), distToOtherNode(), expand(), getPose(), hasReached(), PotentialfieldAStarNode(), and setValueAtPos().

double PotentialfieldAStarNode::fValue`[protected]`

| The value of the node. Definition at line 178 of file AStarSearch.h. Referenced by f(), PotentialfieldAStarNode(), and setFunctionValues().

double PotentialfieldAStarNode::gValue`[protected]`

| The path costs to the node. Definition at line 180 of file AStarSearch.h. Referenced by expand(), g(), PotentialfieldAStarNode(), and setFunctionValues().

unsigned int PotentialfieldAStarNode::parentNode`[protected]`

| The index of the parent node. Definition at line 182 of file AStarSearch.h. Referenced by expand(), getParentNode(), and PotentialfieldAStarNode().

bool PotentialfieldAStarNode::expanded`[protected]`

| Flag: true, if the node has been expanded. Definition at line 184 of file AStarSearch.h. Referenced by expand(), hasBeenExpanded(), and PotentialfieldAStarNode().

double PotentialfieldAStarNode::valueAtPos`[protected]`

| The potential field value at the position of the node. Definition at line 186 of file AStarSearch.h. Referenced by computeCostsTo(), PotentialfieldAStarNode(), and setValueAtPos().

double PotentialfieldAStarNode::expansionRadius`[protected]`

| The expansion radius of the node. Definition at line 188 of file AStarSearch.h. Referenced by computeCostsTo(), computeHeuristicBetween(), expand(), getExpansionRadius(), hasReached(), and PotentialfieldAStarNode().

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

- Tools/PotentialFields/AStarSearch.h
- Tools/PotentialFields/AStarSearch.cpp