core

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path(
	equal func(a, b interface{}) bool,
	from *Node, to *Node, heuristic Heuristic, edgeWeight Heuristic,
) set.GenericOrderedDataSet[*Node]

Types

type Heuristic

type Heuristic func(node1, node2 *Node) float64

Heuristic function to calculate cost

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node node description

func GetPath

func GetPath(s set.GenericOrderedDataSet[*Node], _ func(a, b interface{}) bool, _ *Node, r bool) []*Node

GetPath return path

func NewNode

func NewNode(value interface{}, previous *Node, neighbors ...*Node) *Node

NewNode return new node

func (*Node) AddNeighbors

func (n *Node) AddNeighbors(neighbors ...*Node) *Node

func (*Node) AddNeighborsFn

func (n *Node) AddNeighborsFn(
	neighbors func(set.GenericOrderedDataSet[*Node],
		*sortedset.SortedSet[*Node, *Node],
		*Node,
	) []*Node,
) *Node

func (*Node) Cost

func (n *Node) Cost(gCost, heuristic float64)

Cost calculate cost of node

func (*Node) Neighbors

func (n *Node) Neighbors(visited set.GenericOrderedDataSet[*Node], unvisited *sortedset.SortedSet[*Node, *Node]) []*Node

Neighbors return graph neighbors

func (*Node) Value

func (n *Node) Value() interface{}

Value return node value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL