a_star

package a_star
A* pathfinding in graphs

Concerns

  • a_star: A* pathfinding in graphs
    • a_star: A* pathfinding in graphs

a_star::a_star

module a_star

A* pathfinding in graphs

A single graph may have different properties according to the PathContext used

Usage:

var graph = new Graph[Node,WeightedLink]

var na = new Node(graph)
var nb = new Node(graph)
var nc = new Node(graph)
var nd = new Node(graph)
var ne = new Node(graph)

var lab = new WeightedLink(graph, na, nb, 2)
var lac = new WeightedLink(graph, na, nc, 3)
var lbd = new WeightedLink(graph, nb, nd, 1)
var lcd = new WeightedLink(graph, nc, nd, 3)
var lde = new WeightedLink(graph, nd, ne, 8)

var context = new WeightedPathContext(graph)

var path = na.path_to(ne, 100, context)
assert path != null else print "No possible path"

assert path.step == nb
assert path.step == nd
assert path.step == ne
assert path.at_end_of_path