Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Goreland ¶
type Goreland struct {
}
func (Goreland) RenderPath ¶
RenderPath renders a path on top of a Goreland world.
type Pather ¶
type Pather interface {
// PathNeighbors returns the direct neighboring nodes of this node which
// can be pathed to.
PathNeighbors(world interface{}) []Pather
// PathNeighbourCost calculates the exact movement Cost to neighbor nodes.
PathNeighborCost(world interface{}, to Pather) float64
// PathEstimatedCost is a heuristic method for estimating movement costs
// between non-adjacent nodes.
PathEstimatedCost(world interface{}, to Pather) float64
}
Pather is an interface which allows A* searching on arbitrary objects which can represent a weighted graph.
type Pathfinder ¶
type Pathfinder struct {
World interface{}
// contains filtered or unexported fields
}
func NewPathfinder ¶
func NewPathfinder() (pf *Pathfinder)
Public constructor for the Pathfinder struct, initializes the nodes
func (*Pathfinder) Get ¶
func (pf *Pathfinder) Get(p Pather) *node
Get returns the Pather object wrapped in a node, instantiating if required.
type Truck ¶
type Truck struct {
// X and Y are the coordinates of the truck.
X, Y int
// contains filtered or unexported fields
}
A Truck is a Truck in a grid which implements Grapher.
func (*Truck) PathEstimatedCost ¶
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance between non-adjacent nodes.
func (*Truck) PathNeighborCost ¶
PathNeighborCost returns the Cost of the tube leading to Truck.
func (*Truck) PathNeighbors ¶
PathNeighbors returns the neighbors of the Truck
Click to show internal directories.
Click to hide internal directories.