MCPcopy Create free account

hub / github.com/beefsack/go-astar / functions

Functions37 in github.com/beefsack/go-astar

↓ 6 callersFunctiontestPath
testPath takes a string encoded world, decodes it, calculates a path and checks the expected distance matches. An expectedDist of -1 expects that no
path_test.go:12
↓ 3 callersFunctionAddTruck
(x int, y int, label string)
goreland_test.go:7
↓ 3 callersFunctionAddTube
(t1, t2 *Truck, cost float64)
goreland_test.go:15
↓ 3 callersFunctionPath
Path calculates a short path and the distance between the two Pather nodes. If no path is found, found will be false.
astar.go:49
↓ 3 callersMethodRenderPath
RenderPath renders a path on top of a world.
pather_test.go:156
↓ 3 callersMethodget
get gets the Pather object wrapped in a node, instantiating if required.
astar.go:35
↓ 2 callersMethodFirstOfKind
FirstOfKind gets the first tile on the board of a kind, used to get the from and to tiles as there should only be one of each.
pather_test.go:134
↓ 2 callersMethodFrom
From gets the from tile from the world.
pather_test.go:146
↓ 2 callersFunctionParseWorld
ParseWorld parses a textual representation of a world into a world map.
pather_test.go:184
↓ 2 callersMethodPush
(x interface{})
priority_queue.go:21
↓ 2 callersMethodTile
Tile gets the tile at the given coordinates in the world.
pather_test.go:114
↓ 2 callersMethodTo
To gets the to tile from the world.
pather_test.go:151
↓ 2 callersFunctioncreateGorelandGraphPath_Diagonal
Consider a world with Nodes (Trucks) and Edges (Tubes), Edges each having a cost E | | S--M S=Start at (0,0) E=End at (1,1) M=Middle at (0,1) S-M a
goreland_test.go:50
↓ 1 callersMethodLen
()
priority_queue.go:7
↓ 1 callersMethodPathEstimatedCost
PathEstimatedCost is a heuristic method for estimating movement costs between non-adjacent nodes.
astar.go:17
↓ 1 callersMethodPathNeighborCost
PathNeighborCost calculates the exact movement cost to neighbor nodes.
astar.go:14
↓ 1 callersMethodPathNeighbors
PathNeighbors returns the direct neighboring nodes of this node which can be pathed to.
astar.go:12
↓ 1 callersMethodPop
()
priority_queue.go:28
↓ 1 callersMethodSetTile
SetTile sets a tile at the given coordinates in the world.
pather_test.go:122
FunctionBenchmarkLarge
(b *testing.B)
path_test.go:101
MethodLess
(i, j int)
priority_queue.go:11
MethodPathEstimatedCost
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance between non-adjacent nodes.
pather_test.go:97
MethodPathEstimatedCost
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance between non-adjacent nodes.
goreland_example.go:71
MethodPathNeighborCost
PathNeighborCost returns the movement cost of the directly neighboring tile.
pather_test.go:90
MethodPathNeighborCost
PathNeighborCost returns the cost of the tube leading to Truck.
goreland_example.go:59
MethodPathNeighbors
PathNeighbors returns the neighbors of the tile, excluding blockers and tiles off the edge of the board.
pather_test.go:73
MethodPathNeighbors
PathNeighbors returns the neighbors of the Truck
goreland_example.go:48
MethodRenderPath
RenderPath renders a path on top of a Goreland world.
goreland_example.go:88
MethodSwap
(i, j int)
priority_queue.go:15
FunctionTestBlocked
TestBlocked checks that no path is returned when there is no possible path.
path_test.go:54
FunctionTestGraphPaths_LongDiagonal
(t *testing.T)
goreland_test.go:82
FunctionTestGraphPaths_ShortDiagonal
(t *testing.T)
goreland_test.go:79
FunctionTestMaze
TestMaze checks that paths can double back on themselves to reach the goal.
path_test.go:65
FunctionTestMountainClimber
TestMountainClimber checks that a path will choose to go over a mountain, which has a movement penalty of 3, if it's faster than going around the moun
path_test.go:78
FunctionTestPathAroundMountain
TestPathAroundMountain checks that having a round mountain in the path results in a path around the mountain.
path_test.go:43
FunctionTestRiverSwimmer
TestRiverSwimmer checks that the path will prefer to cross a river, which has a movement penalty of 2, over a mountain which has a movement penalty of
path_test.go:91
FunctionTestStraightLine
TestStraightLine checks that having no obstacles results in a straight line path.
path_test.go:31