Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter[T comparable] interface { // to return the next reachable steps from the given T Neighbours(T) []T // to return the estimated cost to reach the finish from the given T. // this function is currently only used when using the astar algorithm CostToFinish(T) int // indicating whether the given T is the finish or not IsFinish(T) bool }
type EventCandidateAdded ¶
type EventCandidateAdded[T comparable] struct { CandidateID T }
type EventCandidateVisited ¶
type EventCandidateVisited[T comparable] struct { CandidateID T }
type EventFinishReached ¶
type EventFinishReached[T comparable] struct { Path []T }
type EventMaxCostReached ¶
type EventMaxCostReached struct{}
type EventUnsolvable ¶
type EventUnsolvable struct{}
type FuncAdapter ¶
type FuncAdapter[T comparable] struct { NeighboursFn func(T) []T CostToFinishFn func(T) int IsFinishFn func(T) bool }
func (*FuncAdapter[T]) CostToFinish ¶
func (a *FuncAdapter[T]) CostToFinish(c T) int
func (*FuncAdapter[T]) IsFinish ¶
func (a *FuncAdapter[T]) IsFinish(c T) bool
func (*FuncAdapter[T]) Neighbours ¶
func (a *FuncAdapter[T]) Neighbours(c T) []T
type SolveContext ¶
type SolveContext[T comparable] struct { MaxCost int Publish func(Event) Adapter func() Adapter[T] IsVisited func(T) bool Visit func(T) }
type Solver ¶
type Solver[T comparable] struct { // some runtime options MaxCost int // contains filtered or unexported fields }
type Walker ¶
type Walker[T comparable] interface { Walk(SolveContext[T]) []T }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.