class AStar::Node(T)

Overview

Represents one node from a graph. Every Node(T) can store something in its data getter e.g. coordinates.

Defined in:

a-star.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(data : T = nil) #

Create a new node and optionally set its data field.


[View source]

Instance Method Detail

def connect(node : self, distance : Number::Primitive) #

Connect self to another node with a distance.


[View source]
def data : T #

[View source]
def f : Number::Primitive #

[View source]
def f=(f : Number::Primitive) #

[View source]
def g : Number::Primitive #

[View source]
def g=(g : Number::Primitive) #

[View source]
def neighbor #

[View source]
def parent : self | Nil #

[View source]
def parent=(parent : self | Nil) #

[View source]
def reset #

Resets F and G values back to its initial state Float64::INFINITY. Returns self.


[View source]
def to_s(io : IO) : Nil #

Appends #data to the given IO object.


[View source]