Unused code and old notes cleanup

main
Bryson Zimmerman 11 months ago
parent 7380aa6192
commit 8b0fa7f404

@ -1,26 +1,7 @@
package technology.zim
import technology.zim.data.Tile
import kotlin.times
import kotlin.toString
/*
Adjacency matrix for graph representation. 5k x 5k or 10k x 10k are safe goals, for memory
Working with a gigantic grid that's mostly full: better to have a up/right/down/left data in each one or a huge adjacency matrix?
Minimum int size is probably 32 or 64 bit, so huge memory waste if that's used
Abandon fancy stretch goals, just get pathfinding done and scale it up to demonstrate large scale
*/
//TODO: Figure out why attempted connections out of bounds are happening
/*
Building world
Start
Attempted to connect to outside bounds: <44, 50> From Tile: <44, 49>
no explored found
*/
class HierarchicalPathfinding {
companion object {

@ -82,17 +82,4 @@ object PathFinder {
World.update(start, start.getProperties() + Directions.INPATH)
}
//Heuristic value, to estimate the cost of a given tile
fun hValue(prospect: Tile, end: Tile): Int {
return abs(prospect.x() - end.x()) + abs(prospect.y() - end.y())
}
//Step through the path, marking each Tile with INPATH
fun finalizePath() {
}
}

@ -1,7 +1,6 @@
package technology.zim.data
import technology.zim.World
import java.util.HashMap
//Tile is a ULong that represents the X,Y coordinates of a Tile
//Contains functions necessary for accessing and manipulating Tiles
@ -117,7 +116,6 @@ value class Tile(private val value: ULong) {
fun getConnections(): Set<Tile> {
val connections = mutableSetOf<Tile>()
val properties = getProperties()
val north = Directions.UP.dir
if(properties.connections and(Directions.UP.dir) != 0) {
connections.add(this + Directions.NORTH)
}

@ -63,21 +63,6 @@ class TileHeap(val end: Tile, val gVals: HashMap<Tile, Int>) {
}
}
fun peekMax(): Tile {
if(dat.isEmpty()) {
throw ArrayIndexOutOfBoundsException()
}
return dat.last()
}
fun peekMin(): Tile {
if(dat.isEmpty()) {
throw ArrayIndexOutOfBoundsException()
}
return dat[1]
}
//Helper functions for navigating the heap
private fun parent(index: Int): Int = index / 2
private fun leftChild(index: Int): Int = index * 2

Loading…
Cancel
Save