astar

package
v0.0.0-...-7909fbe Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AStar

func AStar(start, goal string, client ClientInterface) []string

Types

type ClientInterface

type ClientInterface interface {
	// Returns all neighbors of a given node.
	AllNeighbors(start string) []string

	// Estimates the distance between a node and the goal.
	EstimateDistance(start, goal string) uint

	// Determines the distance between a node and its neighbor.
	NeighborDistance(n1, n2 string) uint

	// Determines whether the goal has been reached -- whether cand
	// represents the goal state. The `goal` value passed to GoalReached is
	// the same one that was passed to AStar.
	GoalReached(cand, goal string) bool

	// Used for debugging. Translates the key into something that
	// can be printed.
	PrintableKey(key string) string
	MarkClosed(key string)
}

Jump to

Keyboard shortcuts

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