Noah-Schoonover / cse326-final-project-treemoval

A forest analyzer for removing unsafe trees with graphical representation.
0 stars 1 forks source link

initial ThinningAlgorithm created #3

Closed ThopClayton closed 3 years ago

ThopClayton commented 3 years ago

added a new variable to tree, "dist", which is used by the thinning algorithm. Also added setter for cut since it appeared to be missing

Created a new class "SortByDist" which is needed to run the thinningAlgorithm

modified class "Tree"'s ToString method: made it so you can now see the "cut" variable and it's value

Added "safeDistance" variable to forest. It is the distance deemed safe between trees. Hard set to 5 right now for testing. Need to implement a way for user to specify (perhaps from file input? GUI?)

Added "ThinningAlgorithm" method to Forest. It marks every tree to be cut or not based on the "safeDistance" variable. I stepped through it a couple of times to make sure it works how it should, and while I do want to test it a lot more, it seems correct from what I've seen.

ThopClayton commented 3 years ago

added an enum to avoid overworking integers. Types are UNMARKED, CUT and SAFE. Forest's Thinning Algorithm method and the Tree class were modified to accommodate this new change.

The exportToFile method was removed from this branch for clarification. Josiah should create a new branch for that method very soon.