Documentation
¶
Index ¶
- func New(config Config) (*astar, error)
- type Config
- type List
- func (l *List) Add(nodes ...Node)
- func (l *List) All() []Node
- func (l *List) Clear()
- func (l *List) Contains(searchNode Node) bool
- func (l *List) GetIndex(searchNode Node) int
- func (l *List) GetIndexOfMinF() int
- func (l *List) GetMinFNode() (Node, error)
- func (l *List) IsEmpty() bool
- func (l *List) Remove(removeNode Node)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config holds important settings to perform the calculation
GridWidth and GridHeight are required and represents the size of the grid
InvalidNodes can be used to add not accessible nodes like obstacles etc. WeightedNodes can be used to add nodes to be avoided like mud or mountains
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents a list of nodes
func (*List) GetIndex ¶
GetIndex returns the index of the node in the list if the node is not found the return value is -1
func (*List) GetIndexOfMinF ¶
GetIndexOfMinF returns the index of the nodes list with the smallest node.F value
if no node is found it returns -1
func (*List) GetMinFNode ¶
GetMinFNode returns the node with the smallest node.F value
Click to show internal directories.
Click to hide internal directories.