Adjust Directions constants for pathfinding needs, add notes on algorithm to PathFinder

main
Bryson Zimmerman 11 months ago
parent 55e1f66daa
commit 045b3defb2

@ -22,9 +22,19 @@ object PathFinder {
return return
} }
//Figure out what open and closed queues are for //Data structure to define the frontier
//Frontier tiles know their current cost: cost of the path until now g(t) + its own distance from the end h(t)
//Always grab the lowest value from the frontier, mark it visited, add its unvisited neighbors
//Probably best to just make an array of integers, where the coordinates store the tile's g(t)
//Data structure to hold the g values
//Data structure to mark parents
//Two choices that I see:
//Dual arrays, one for g-val and one for parent node, take advantage of bitflags in Directions
//or add a flag for DEADEND, use a more dynamic data structure to store tile data (map?)
//then prune tiles from the data structure when they're marked as dead ends, backtracking until a fork is available

@ -6,9 +6,10 @@ enum class Directions(val dir: Int) {
DOWN(2), DOWN(2),
LEFT(4), LEFT(4),
RIGHT(8), RIGHT(8),
INPATH(16), //Chosen by the pathfinder MANIFEST(16),//Checked by MazeFinder, the imperialist way
CHECKED(32), //Checked by the pathfinder MARKED(32), //Marked as an item to check, from pathfinder
MANIFEST(64), //Checked by MazeFinder, the imperialist way CHECKED(64), //Checked by the pathfinder
INPATH(128), //Chosen by the pathfinder
; ;
companion object { companion object {

Loading…
Cancel
Save