33 #define DBG_AI_ENGINE_FAI LOG_STREAM(debug, log_ai_engine_fai) 34 #define LOG_AI_ENGINE_FAI LOG_STREAM(info, log_ai_engine_fai) 35 #define ERR_AI_ENGINE_FAI LOG_STREAM(err, log_ai_engine_fai) 83 DBG_AI_ENGINE_FAI <<
"config snippet contains: " << std::endl << cfg << std::endl;
86 auto ca = std::make_shared<fai_candidate_action_wrapper>(context, cfg, fai_ca, *
formula_ai_);
96 const std::string &name = cfg[
"name"];
103 if (name==
"side_formulas") {
104 st_ptr = std::make_shared<stage_side_formulas>(context, cfg, *
formula_ai_);
105 }
else if (name==
"unit_formulas") {
106 st_ptr = std::make_shared<stage_unit_formulas>(context, cfg, *
formula_ai_);
108 ERR_AI_ENGINE_FAI <<
"unknown type of formula_ai stage: ["<< name <<
"]"<<std::endl;
123 if (context!=
nullptr) {
std::shared_ptr< candidate_action > candidate_action_ptr
std::shared_ptr< stage > stage_ptr
Defines formula ai candidate actions - headers.
virtual void do_parse_candidate_action_from_config(rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr >> b)
virtual void execute()
Execute the candidate action.
#define ERR_AI_ENGINE_FAI
FAI AI Support engine - creating specific ai components from config.
virtual config to_config() const
serialize
virtual void do_parse_stage_from_config(ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr >> b)
virtual config to_config() const
serialize
wfl::candidate_action_ptr fai_ca_
virtual ~fai_candidate_action_wrapper()
A small explanation about what's going on here: Each action has access to two game_info objects First...
std::shared_ptr< formula_ai > formula_ai_
virtual std::string evaluate(const std::string &str)
#define DBG_AI_ENGINE_FAI
virtual double evaluate()
Evaluate the candidate action, resetting the internal state of the action.
engine_fai(readonly_context &context, const config &cfg)
config & add_child(config_key_type key)
static lg::log_domain log_ai_engine_fai("ai/engine/fai")
Standard logging facilities (interface).
virtual side_number get_side() const =0
Get the side number.
fai_candidate_action_wrapper(rca_context &context, const config &cfg, wfl::candidate_action_ptr fai_ca, formula_ai &_formula_ai)
virtual config to_config() const
serialize
A config object defines a single node in a WML file, with access to child nodes.
virtual void set_ai_context(ai_context *context)
candidate action framework