Now have the ability to do partial solutions that will create potential paths to the goal, and a test that runs the scripts from plans in different scenarios. Also, this ai_debug thing needs some work.

This commit is contained in:
Zed A. Shaw 2025-03-11 15:33:14 -04:00
parent 3f83d3f0bb
commit fc66d221d4
11 changed files with 252 additions and 107 deletions

View file

@ -8,6 +8,9 @@
#include "config.hpp"
namespace ai {
// ZED: I don't know if this is the best place for this
using AIProfile = std::unordered_map<std::string, int>;
constexpr const int SCORE_MAX = std::numeric_limits<int>::max();
constexpr const size_t STATE_MAX = 32;
@ -56,11 +59,16 @@ namespace ai {
}
};
struct ActionPlan {
bool complete = false;
Script script;
};
bool is_subset(State& source, State& target);
int distance_to_goal(State& from, State& to);
std::optional<Script> plan_actions(std::vector<Action>& actions, State& start, State& goal);
ActionPlan plan_actions(std::vector<Action>& actions, State start, State goal);
}
template<> struct std::hash<ai::Action> {