dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType > Class Template Reference

AStarNode is a data container for a single node in an AStar Path. More...

#include <astarnode.h>

Inheritance diagram for dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >:

dtAI::WaypointNode

List of all members.

Public Types

typedef _DataType data_type
typedef _CostType cost_type
typedef _IterType iterator
typedef _NodeType node_type
typedef AStarNode< _NodeType,
_DataType, _IterType,
_CostType > 
BaseType

Public Member Functions

 AStarNode (node_type *pParent, data_type pData, cost_type pGn, cost_type pHn)
virtual ~AStarNode ()
bool operator== (const AStarNode &pNode) const
 equality is based on the class data_type's operator ==
bool operator!= (const AStarNode &pNode)
bool operator< (const AStarNode &pType) const
 we use operator < to compare costs between nodes
node_typeGetParent ()
cost_type GetCostToNode () const
 This is the cost to get to the node from the start in common AStar terms it is called cost g(n).
cost_type GetCostToGoal () const
 This is the cost to get from the node to the end in common AStar terms it is called cost h(n).
data_type GetData ()
const data_type GetData () const
virtual iterator begin () const =0
 returns an iterator to the first acceptable point from this node
virtual iterator end () const =0
 returns an iterator one past the last acceptable point from this node

Protected Member Functions

 AStarNode (const AStarNode &pNode)
AStarNodeoperator= (const AStarNode &pNode)

Protected Attributes

data_type mData
cost_type mCostToNode
cost_type mCostToGoal
node_typemParent


Detailed Description

template<class _NodeType, class _DataType, class _IterType, class _CostType>
class dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >

AStarNode is a data container for a single node in an AStar Path.

This class is the base node type for AStar, it holds the cost of the path the actual data type, and a pointer to its parent for bookkeeping.

Derive this class and implement the pure virtual begin() and end() functions which should return iterators of type _IterType and support operator++ to iterate through the data types that this data type can get to.

See also:
AStar.h

Member Typedef Documentation

template<class _NodeType, class _DataType, class _IterType, class _CostType>
typedef _DataType dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::data_type

template<class _NodeType, class _DataType, class _IterType, class _CostType>
typedef _CostType dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::cost_type

template<class _NodeType, class _DataType, class _IterType, class _CostType>
typedef _IterType dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::iterator

template<class _NodeType, class _DataType, class _IterType, class _CostType>
typedef _NodeType dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::node_type

template<class _NodeType, class _DataType, class _IterType, class _CostType>
typedef AStarNode<_NodeType, _DataType, _IterType, _CostType> dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::BaseType


Constructor & Destructor Documentation

template<class _NodeType, class _DataType, class _IterType, class _CostType>
dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::AStarNode ( node_type pParent,
data_type  pData,
cost_type  pGn,
cost_type  pHn 
) [inline]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
virtual dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::~AStarNode (  )  [inline, virtual]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::AStarNode ( const AStarNode< _NodeType, _DataType, _IterType, _CostType > &  pNode  )  [protected]


Member Function Documentation

template<class _NodeType, class _DataType, class _IterType, class _CostType>
bool dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::operator== ( const AStarNode< _NodeType, _DataType, _IterType, _CostType > &  pNode  )  const [inline]

equality is based on the class data_type's operator ==

template<class _NodeType, class _DataType, class _IterType, class _CostType>
bool dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::operator!= ( const AStarNode< _NodeType, _DataType, _IterType, _CostType > &  pNode  )  [inline]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
bool dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::operator< ( const AStarNode< _NodeType, _DataType, _IterType, _CostType > &  pType  )  const [inline]

we use operator < to compare costs between nodes

template<class _NodeType, class _DataType, class _IterType, class _CostType>
node_type* dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::GetParent (  )  [inline]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
cost_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::GetCostToNode (  )  const [inline]

This is the cost to get to the node from the start in common AStar terms it is called cost g(n).

template<class _NodeType, class _DataType, class _IterType, class _CostType>
cost_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::GetCostToGoal (  )  const [inline]

This is the cost to get from the node to the end in common AStar terms it is called cost h(n).

template<class _NodeType, class _DataType, class _IterType, class _CostType>
data_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::GetData (  )  [inline]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
const data_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::GetData (  )  const [inline]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
virtual iterator dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::begin (  )  const [pure virtual]

returns an iterator to the first acceptable point from this node

Implemented in dtAI::WaypointNode.

template<class _NodeType, class _DataType, class _IterType, class _CostType>
virtual iterator dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::end (  )  const [pure virtual]

returns an iterator one past the last acceptable point from this node

Implemented in dtAI::WaypointNode.

template<class _NodeType, class _DataType, class _IterType, class _CostType>
AStarNode& dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::operator= ( const AStarNode< _NodeType, _DataType, _IterType, _CostType > &  pNode  )  [protected]


Member Data Documentation

template<class _NodeType, class _DataType, class _IterType, class _CostType>
data_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::mData [protected]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
cost_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::mCostToNode [protected]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
cost_type dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::mCostToGoal [protected]

template<class _NodeType, class _DataType, class _IterType, class _CostType>
node_type* dtAI::AStarNode< _NodeType, _DataType, _IterType, _CostType >::mParent [protected]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008