Documentation ¶
Index ¶
- Variables
- func AStarInit[T any](end Coordinate, initialData [][]T, emptyMap IAStarMap[T])
- func AStarReset[T any](aStarMap IAStarMap[T])
- func AStarRun[T any](start, end Coordinate, aStarMap IAStarMap[T])
- func DifferenceDistance[T stockings.Integral](a T, b T) int
- func ManhattanDistance(a, b Coordinate) int
- type AStarMap
- type Coordinate
- type IAStarMap
- type MapNode
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorCoordinate = Coordinate{math.MinInt, math.MinInt}
Functions ¶
func AStarInit ¶
func AStarInit[T any](end Coordinate, initialData [][]T, emptyMap IAStarMap[T])
func AStarReset ¶
func AStarRun ¶
func AStarRun[T any](start, end Coordinate, aStarMap IAStarMap[T])
func DifferenceDistance ¶
func ManhattanDistance ¶
func ManhattanDistance(a, b Coordinate) int
Types ¶
type Coordinate ¶
type Coordinate struct {
Col, Row int
}
func ParseCoordinate ¶
func ParseCoordinate(coord string) (Coordinate, error)
func (*Coordinate) Equals ¶
func (c *Coordinate) Equals(other Coordinate) bool
func (*Coordinate) String ¶
func (c *Coordinate) String() string
type IAStarMap ¶
type IAStarMap[T any] interface { TravelCost(src, dst Coordinate) int Heuristic(src, dst Coordinate) int GetConnectedNodes(src Coordinate) []Coordinate Get(coords Coordinate) *MapNode[T] SetMap(m [][]*MapNode[T]) GetMap() [][]*MapNode[T] }
type MapNode ¶
type MapNode[T any] struct { Value T TravelScore int HeuristicScore int Self Coordinate Predecessor Coordinate }
Click to show internal directories.
Click to hide internal directories.