class AStar::Node(T)
- AStar::Node(T)
- Reference
- Object
Overview
Represents one node from a graph.
Every Node(T)
can store something in its data getter e.g. coordinates.
Defined in:
a-star.crConstructors
-
.new(data : T = nil)
Create a new node and optionally set its data field.
Instance Method Summary
-
#connect(node : self, distance : Number::Primitive)
Connect
self
to anothernode
with adistance
. - #data : T
- #f : Number::Primitive
- #f=(f : Number::Primitive)
- #g : Number::Primitive
- #g=(g : Number::Primitive)
- #neighbor
- #parent : self | Nil
- #parent=(parent : self | Nil)
-
#reset
Resets F and G values back to its initial state
Float64::INFINITY
. -
#to_s(io : IO) : Nil
Appends
#data
to the given IO object.
Constructor Detail
Instance Method Detail
def connect(node : self, distance : Number::Primitive)
#
Connect self
to another node
with a distance
.