Path Finder (2D/3D) 1.0.1
Create and use simple navigation graphs for 2D/3D path finding with choice of 4 search algorithms.
pathfinder.GraphEdge Class Reference
Inheritance diagram for pathfinder.GraphEdge:

Public Member Functions

 GraphEdge (GraphNode from, GraphNode to)
 
 GraphEdge (GraphEdge edge)
 
 GraphEdge (GraphEdge edge, double costSoFar)
 
 GraphEdge (GraphNode from, GraphNode to, double cost)
 
double getCost ()
 
void setCost (double cost)
 
GraphNode from ()
 
GraphNode to ()
 
int compareTo (Object o)
 

Protected Member Functions

 GraphEdge ()
 

Protected Attributes

GraphNode from
 
GraphNode to
 
double cost = 1.0
 

Detailed Description

This class is used to represent a directed edge between 2 nodes and the cost of traversing this edge.

Author
Peter Lager

Constructor & Destructor Documentation

◆ GraphEdge() [1/5]

pathfinder.GraphEdge.GraphEdge ( )
protected

Make protected to prevent its use outside the class.

◆ GraphEdge() [2/5]

pathfinder.GraphEdge.GraphEdge ( GraphNode  from,
GraphNode  to 
)

Create an edge of cost 1.0f

Parameters
from'from' node
to'to' node

◆ GraphEdge() [3/5]

pathfinder.GraphEdge.GraphEdge ( GraphEdge  edge)

Copy constructor.

Parameters
edge

◆ GraphEdge() [4/5]

pathfinder.GraphEdge.GraphEdge ( GraphEdge  edge,
double  costSoFar 
)

This constructor is used to create new edges for use with the path finding algorithms Dijkstra and A*
It should not be used directly.

Parameters
edgethe existing edge
costSoFarthe cost to the destination node so far.

◆ GraphEdge() [5/5]

pathfinder.GraphEdge.GraphEdge ( GraphNode  from,
GraphNode  to,
double  cost 
)

Create an edge from 2 existing nodes. If the cost is 0.0 then calculate the cost based on the physical distance between the nodes.

Parameters
from'from' node
to'to' node
costtraversal cost

Member Function Documentation

◆ compareTo()

int pathfinder.GraphEdge.compareTo ( Object  o)

Compare two graph edges.

◆ from()

GraphNode pathfinder.GraphEdge.from ( )
Returns
the 'from' node

◆ getCost()

double pathfinder.GraphEdge.getCost ( )
Returns
the cost

◆ setCost()

void pathfinder.GraphEdge.setCost ( double  cost)

Change the traversal cost.

Parameters
costthe new traversal cost.

◆ to()

GraphNode pathfinder.GraphEdge.to ( )
Returns
the 'to' node

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