Skip to content

Struct walle::Node

ClassList > 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:

  • position location on grid of this node
  • g actual distance to get from start to this node
  • h heuristic guess for distance from this node to end location
  • parent Used 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