21 #ifndef AI_TESTING_CA_HPP_INCLUDED
22 #define AI_TESTING_CA_HPP_INCLUDED
32 #pragma warning(disable:4250)
37 namespace ai_default_rca {
140 typedef std::vector<std::pair<map_location ,
149 void dispatch(treachmap& reachmap, tmoves& moves);
164 treachmap& reachmap, tmoves& moves,
size_t& village_count);
169 treachmap& reachmap, tmoves& moves,
const map_location& village);
179 treachmap& reachmap, tmoves& moves,
const size_t village_count);
198 const std::multimap<map_location,map_location>& dstsrc,
199 const std::multimap<map_location,map_location>& enemy_dstsrc);
virtual void execute()
Execute the candidate action.
virtual void execute()
Execute the candidate action.
std::vector< std::pair< map_location, map_location > > tmoves
void dispatch(treachmap &reachmap, tmoves &moves)
Dispatches all units to their best location.
goto_phase(rca_context &context, const config &cfg)
map_location best_leader_loc_
The best possible location for our leader if it can't reach a village.
void dump_reachmap(treachmap &reachmap)
Shows which villages every unit can reach (debug function).
leader_shares_keep_phase(rca_context &context, const config &cfg)
map_location keep_loc_
Location of the keep the closest to our leader.
bool dispatch_village_simple(treachmap &reachmap, tmoves &moves, size_t &village_count)
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
virtual ~move_leader_to_keep_phase()
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
virtual ~move_leader_to_goals_phase()
move_leader_to_keep_phase(rca_context &context, const config &cfg)
retreat_phase(rca_context &context, const config &cfg)
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
bool remove_village(treachmap &reachmap, tmoves &moves, const map_location &village)
Removes a village for all units, returns true if anything is deleted.
virtual void execute()
Execute the candidate action.
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
std::multimap< map_location, map_location > move_map
The standard way in which a map of possible moves is recorded.
A small explanation about what's going on here: Each action has access to two game_info objects First...
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
bool should_retreat(const map_location &loc, const unit_map::const_iterator &un, const move_map &srcdst, const move_map &dstsrc, double caution)
virtual void execute()
Execute the candidate action.
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
leader_control_phase(rca_context &context, const config &cfg)
Encapsulates the map of the game.
map_location leader_loc_
Locaton of our leader.
void dispatch_complex(treachmap &reachmap, tmoves &moves, const size_t village_count)
Dispatches the units to a village after the simple dispatching failed.
virtual ~leader_control_phase()
get_healing_phase(rca_context &context, const config &cfg)
bool debug_
debug log level for AI enabled?
bool dispatch_unit_simple(treachmap &reachmap, tmoves &moves)
Dispatches all units who can reach one village.
virtual ~leader_shares_keep_phase()
virtual ~get_villages_phase()
virtual void execute()
Execute the candidate action.
std::map< map_location, std::vector< map_location > > treachmap
void get_villages(const move_map &dstsrc, const move_map &enemy_dstsrc, unit_map::const_iterator &leader)
virtual ~get_healing_phase()
void full_dispatch(treachmap &reachmap, tmoves &moves)
Dispatches all units to a village, every unit can reach every village.
treachmap::iterator remove_unit(treachmap &reachmap, tmoves &moves, treachmap::iterator unit)
Removes a unit which can't reach any village anymore.
get_villages_phase(rca_context &context, const config &cfg)
virtual void execute()
Execute the candidate action.
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
virtual void execute()
Execute the candidate action.
A config object defines a single node in a WML file, with access to child nodes.
combat_phase(rca_context &context, const config &cfg)
virtual void execute()
Execute the candidate action.
virtual void execute()
Execute the candidate action.
void remove_goal(const std::string &id)
GLsizei const GLcharARB ** string
void find_villages(treachmap &reachmap, tmoves &moves, const std::multimap< map_location, map_location > &dstsrc, const std::multimap< map_location, map_location > &enemy_dstsrc)
move_leader_to_goals_phase(rca_context &context, const config &cfg)
candidate action framework
attack_analysis best_analysis_