20 #ifndef AI_COMPOSITE_RCA_HPP_INCLUDED
21 #define AI_COMPOSITE_RCA_HPP_INCLUDED
29 #pragma warning(disable:4250)
160 static factory_map *candidate_action_factories;
161 if (candidate_action_factories==
nullptr) {
164 return *candidate_action_factories;
174 factory_ptr ptr_to_this(
this);
175 get_list().insert(make_pair(name,ptr_to_this));
182 template<
class CANDIDATE_ACTION>
static factory_map & get_list()
double get_max_score() const
Get the upper bound of the score of the candidate action without re-evaluation.
virtual std::string get_id() const
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.
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...
virtual candidate_action_ptr get_new_instance(rca_context &ai, const config &cfg)
bool is_enabled() const
Is this candidate action enabled ?
recursion_counter recursion_counter_
A component of the AI framework.
candidate_action_factory(const std::string &name)
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.
virtual candidate_action_ptr get_new_instance(rca_context &context, const config &cfg)=0
virtual bool to_be_removed()
virtual std::string get_engine() const
static const double HIGH_SCORE
candidate_action(rca_context &context, const config &cfg)
std::map< std::string, factory_ptr > factory_map
bool is_duplicate(const std::string &name)
virtual ~candidate_action_factory()
boost::shared_ptr< candidate_action > candidate_action_ptr
GLuint const GLchar * name
virtual double evaluate()=0
Evaluate the candidate action, resetting the internal state of the action.
void disable()
Disable the candidate action.
const std::string & get_type() const
Get the type of the candidate action (useful for debug purposes)
virtual ~candidate_action()
Destructor.
std::pair< const std::string, factory_ptr > factory_map_pair
static const double BAD_SCORE
boost::shared_ptr< candidate_action_factory > factory_ptr
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
register_candidate_action_factory(const std::string &name)
virtual void execute()=0
Execute the candidate action.