public static class AStar.DefaultCosts extends Object implements AStar.Costs
Number an must be translatable to a double value. This implementation
always return 0 for the H value. This makes the A* algorithm an
equivalent of the Dijkstra algorithm.| Constructor and Description |
|---|
AStar.DefaultCosts()
New default costs for the A* algorithm.
|
AStar.DefaultCosts(String weightAttributeName)
New default costs for the A* algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cost(org.graphstream.graph.Node parent,
org.graphstream.graph.Edge edge,
org.graphstream.graph.Node next)
The cost of moving from parent to next.
|
double |
heuristic(org.graphstream.graph.Node node,
org.graphstream.graph.Node target)
The heuristic.
|
public AStar.DefaultCosts()
public AStar.DefaultCosts(String weightAttributeName)
weightAttributeName - The name of cost attributes on edges.public double heuristic(org.graphstream.graph.Node node,
org.graphstream.graph.Node target)
heuristic in interface AStar.Costsnode - A node.target - The target node.public double cost(org.graphstream.graph.Node parent,
org.graphstream.graph.Edge edge,
org.graphstream.graph.Node next)
cost in interface AStar.Costsparent - The node we come from.edge - The edge between parent and next.next - The node we go to.Copyright © 2015. All rights reserved.