Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFloat32 ¶
Types ¶
type GridPos ¶
type GridPos struct {
X, Y int16
}
Type representing positions in a grid
func (GridPos) ChebyshevDistance ¶
Returns the Chebyshev distance between two points
d = max(abs(a.X-b.X), abs(a.Y-b.Y))
func (GridPos) TaxicabDistance ¶ added in v0.2.0
Returns the "Taxicab" distance between two points aka L0 metric
d = abs(a.X-b.X) + abs(a.Y-b.Y)
type PriorityQueue ¶
type PriorityQueue[T any] struct { // contains filtered or unexported fields }
PriorityQueue is a heap-based priority queue using the standard library heap
func (*PriorityQueue[T]) Empty ¶
func (pq *PriorityQueue[T]) Empty() bool
Empty returns true when the queue is empty
func (*PriorityQueue[T]) Pop ¶
func (pq *PriorityQueue[T]) Pop() (*T, bool)
Remove the item at the top of the queue and return it Returns (nil, false) if the queue is empty
func (*PriorityQueue[T]) Push ¶
func (pq *PriorityQueue[T]) Push(data T, priority int)
Push a new element with the given priority
Click to show internal directories.
Click to hide internal directories.