Utility AI is a planning algorithm that can be used to find the best action to perform in a given situation. The algorithm works by assigning a score to each action based on how well it will achieve the goal. The algorithm is guaranteed to find a solution.
Usage
First, include the header file:
#include <aitoolkit/utility.hpp>
Then, create a blackboard type:
struct blackboard_type {
int food{0};
int wood{0};
int stone{0};
int gold{0};
};
Next, create a class for each action that you want to be able to perform:
using namespace aitoolkit::utility;
class collect_food final : publicaction<blackboard_type> {