on-internet
← Community

In an A* algo how to find the min f value contained in a list of classes

Stack Overflow ·

I'm trying to write my first pathfinding algorithim based on pseudocode here https://www.datacamp.com/tutorial/a-star-algorithm. The game this is being implemented into is tile based and each tile contains an f, h and g int. I'm trying to figure out how to retrieve the tile with the lowest f value in my openSet of tiles. My current implementation gets the lowest value of something using *min_element but I want to specify that the element I need is the tiles f value. #include "Pathfinder.h" #include "Tile.h" #include <iostream> #include <cmath> #include <algorithm> #include <list> std::list<Til

Comments

Sign in or sign up to comment and upvote.

No comments yet.