delegate handling of recently broken formula ai...
...command-line console commands to fai engine (which is temporary disabled)
This commit is contained in:
parent
e6bd8a69a4
commit
fbaee6202f
6 changed files with 34 additions and 0 deletions
|
@ -67,6 +67,18 @@ void ai_composite::play_turn(){
|
|||
}
|
||||
|
||||
|
||||
std::string ai_composite::evaluate(const std::string& str)
|
||||
{
|
||||
config cfg;
|
||||
cfg["engine"] = "fai";//@todo 1.9 : consider allowing other engines to evaluate
|
||||
engine_ptr e_ptr = get_engine(cfg);
|
||||
if (!e_ptr) {
|
||||
return interface::evaluate(str);
|
||||
}
|
||||
return e_ptr->evaluate(str);
|
||||
}
|
||||
|
||||
|
||||
void ai_composite::new_turn()
|
||||
{
|
||||
//@todo 1.7 replace with event system
|
||||
|
|
|
@ -64,6 +64,11 @@ public:
|
|||
void play_turn();
|
||||
|
||||
|
||||
/**
|
||||
* Evaluate command (using fai)
|
||||
*/
|
||||
virtual std::string evaluate(const std::string& str);
|
||||
|
||||
/**
|
||||
* On new turn
|
||||
*/
|
||||
|
|
|
@ -113,6 +113,11 @@ void engine::do_parse_stage_from_config( ai_context &/*context*/, const config &
|
|||
|
||||
}
|
||||
|
||||
std::string engine::evaluate(const std::string& /*str*/)
|
||||
{
|
||||
return "evaluate command is not implemented by this engine";
|
||||
}
|
||||
|
||||
|
||||
std::string engine::get_name() const
|
||||
{
|
||||
|
|
|
@ -76,6 +76,9 @@ public:
|
|||
//do not override that method in subclasses which cannot create stages
|
||||
virtual void do_parse_stage_from_config( ai_context &context, const config &cfg, std::back_insert_iterator<std::vector< stage_ptr > > b );
|
||||
|
||||
//do not override that method in subclasse which cannot evaluate formulas
|
||||
virtual std::string evaluate(const std::string& str);
|
||||
|
||||
|
||||
virtual std::string get_name() const;
|
||||
|
||||
|
|
|
@ -98,6 +98,13 @@ void engine_fai::do_parse_candidate_action_from_config( rca_context &/*context*/
|
|||
}
|
||||
|
||||
|
||||
std::string engine_fai::evaluate(const std::string &/*str*/)
|
||||
{
|
||||
/*return formula_ai_.evaluate(str);*/
|
||||
return "formula ai evaluation is temporary disabled";
|
||||
}
|
||||
|
||||
|
||||
std::string engine_fai::get_name() const
|
||||
{
|
||||
return "fai";
|
||||
|
|
|
@ -38,6 +38,8 @@ public:
|
|||
|
||||
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 std::string evaluate(const std::string &str);
|
||||
|
||||
virtual std::string get_name() const;
|
||||
|
||||
virtual config to_config() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue