Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/beefsack/go-astar
/ functions
Functions
37 in github.com/beefsack/go-astar
⨍
Functions
37
◇
Types & classes
9
↓ 6 callers
Function
testPath
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 callers
Function
AddTruck
(x int, y int, label string)
goreland_test.go:7
↓ 3 callers
Function
AddTube
(t1, t2 *Truck, cost float64)
goreland_test.go:15
↓ 3 callers
Function
Path
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 callers
Method
RenderPath
RenderPath renders a path on top of a world.
pather_test.go:156
↓ 3 callers
Method
get
get gets the Pather object wrapped in a node, instantiating if required.
astar.go:35
↓ 2 callers
Method
FirstOfKind
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 callers
Method
From
From gets the from tile from the world.
pather_test.go:146
↓ 2 callers
Function
ParseWorld
ParseWorld parses a textual representation of a world into a world map.
pather_test.go:184
↓ 2 callers
Method
Push
(x interface{})
priority_queue.go:21
↓ 2 callers
Method
Tile
Tile gets the tile at the given coordinates in the world.
pather_test.go:114
↓ 2 callers
Method
To
To gets the to tile from the world.
pather_test.go:151
↓ 2 callers
Function
createGorelandGraphPath_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 callers
Method
Len
()
priority_queue.go:7
↓ 1 callers
Method
PathEstimatedCost
PathEstimatedCost is a heuristic method for estimating movement costs between non-adjacent nodes.
astar.go:17
↓ 1 callers
Method
PathNeighborCost
PathNeighborCost calculates the exact movement cost to neighbor nodes.
astar.go:14
↓ 1 callers
Method
PathNeighbors
PathNeighbors returns the direct neighboring nodes of this node which can be pathed to.
astar.go:12
↓ 1 callers
Method
Pop
()
priority_queue.go:28
↓ 1 callers
Method
SetTile
SetTile sets a tile at the given coordinates in the world.
pather_test.go:122
Function
BenchmarkLarge
(b *testing.B)
path_test.go:101
Method
Less
(i, j int)
priority_queue.go:11
Method
PathEstimatedCost
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance between non-adjacent nodes.
pather_test.go:97
Method
PathEstimatedCost
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance between non-adjacent nodes.
goreland_example.go:71
Method
PathNeighborCost
PathNeighborCost returns the movement cost of the directly neighboring tile.
pather_test.go:90
Method
PathNeighborCost
PathNeighborCost returns the cost of the tube leading to Truck.
goreland_example.go:59
Method
PathNeighbors
PathNeighbors returns the neighbors of the tile, excluding blockers and tiles off the edge of the board.
pather_test.go:73
Method
PathNeighbors
PathNeighbors returns the neighbors of the Truck
goreland_example.go:48
Method
RenderPath
RenderPath renders a path on top of a Goreland world.
goreland_example.go:88
Method
Swap
(i, j int)
priority_queue.go:15
Function
TestBlocked
TestBlocked checks that no path is returned when there is no possible path.
path_test.go:54
Function
TestGraphPaths_LongDiagonal
(t *testing.T)
goreland_test.go:82
Function
TestGraphPaths_ShortDiagonal
(t *testing.T)
goreland_test.go:79
Function
TestMaze
TestMaze checks that paths can double back on themselves to reach the goal.
path_test.go:65
Function
TestMountainClimber
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
Function
TestPathAroundMountain
TestPathAroundMountain checks that having a round mountain in the path results in a path around the mountain.
path_test.go:43
Function
TestRiverSwimmer
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
Function
TestStraightLine
TestStraightLine checks that having no obstacles results in a straight line path.
path_test.go:31