28 #define DBG_AI_STAGE_RCA LOG_STREAM(debug, log_ai_stage_rca)
29 #define LOG_AI_STAGE_RCA LOG_STREAM(info, log_ai_stage_rca)
30 #define ERR_AI_STAGE_RCA LOG_STREAM(err, log_ai_stage_rca)
36 recursion_counter_(context.get_recursion_count()),
37 enabled_(cfg[
"enabled"].to_bool(true)), engine_(cfg[
"engine"]),
38 score_(cfg[
"score"].to_double(BAD_SCORE)),
39 max_score_(cfg[
"max_score"].to_double(HIGH_SCORE)),
40 id_(cfg[
"id"]), name_(cfg[
"name"]), type_(cfg[
"type"]), to_be_removed_(false)
115 ERR_AI_STAGE_RCA <<
"Error: Attempt to double-register candidate action " << name << std::endl;
124 s <<
"candidate action with name ["<< ca.
get_name() <<
"]";
static factory_map & get_list()
double get_max_score() const
Get the upper bound of the score of the candidate action without re-evaluation.
static lg::log_domain log_ai_stage_rca("ai/stage/rca")
virtual std::string get_name() const
Get the name of the candidate action (useful for debug purposes)
double get_score() const
Get the usual score of the candidate action without re-evaluation.
AI Support engine - creating specific ai components from config.
std::ostream & operator<<(std::ostream &s, ai::candidate_action const &ca)
A small explanation about what's going on here: Each action has access to two game_info objects First...
bool is_enabled() const
Is this candidate action enabled ?
recursion_counter recursion_counter_
Composite AI with turn sequence which is a vector of stages.
void enable()
Enable the candidate action.
virtual config to_config() const
serialize
virtual void set_to_be_removed()
int get_recursion_count() const
Get the value of the recursion counter.
void init_rca_context_proxy(rca_context &target)
virtual bool to_be_removed()
static const double HIGH_SCORE
candidate_action(rca_context &context, const config &cfg)
bool is_duplicate(const std::string &name)
int get_count() const
Get the current value of the recursion counter.
GLuint const GLchar * name
void disable()
Disable the candidate action.
bool find(E event, F functor)
Tests whether an event handler is available.
const std::string & get_type() const
Get the type of the candidate action (useful for debug purposes)
virtual ~candidate_action()
Destructor.
Standard logging facilities (interface).
static const double BAD_SCORE
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
candidate action framework