Struct walle::Node
Node class to hold information about positions for A* search.
#include <AgentLibary.hpp>
Public Attributes
| Type | Name |
|---|---|
| double | g Cost from start to current node. |
| double | h Heuristic (estimated cost from current node to goal) |
| std::shared_ptr< Node > | parent How we got to this node (Used to construct final path) |
| cse491::GridPosition | position Where node is located. |
Public Functions
| Type | Name |
|---|---|
| Node (const cse491::GridPosition & position, double g, double h, std::shared_ptr< Node > parent) |
|
| double | f () const Calculate the total cost (f) of the node. |
Public Attributes Documentation
variable g
double g;
variable h
double h;
variable parent
std::shared_ptr<Node> parent;
variable position
cse491::GridPosition position;
Public Functions Documentation
function Node
inline walle::Node::Node (
const cse491::GridPosition & position,
double g,
double h,
std::shared_ptr< Node > parent
)
Constructor for a node
Parameters:
positionlocation on grid of this nodegactual distance to get from start to this nodehheuristic guess for distance from this node to end locationparentUsed to construct path back at end
function f
Calculate the total cost (f) of the node.
inline double walle::Node::f () const
Returns:
sum of actual distance and heuristic distance
The documentation for this class was generated from the following file source/Agents/AgentLibary.hpp