#include <rca.hpp>


Public Member Functions | |
| candidate_action (rca_context &context, const config &cfg) | |
| Constructor. | |
| virtual | ~candidate_action () |
| Destructor. | |
| virtual double | evaluate ()=0 |
| Evaluate the candidate action, resetting the internal state of the action. | |
| virtual void | execute ()=0 |
| Execute the candidate action. | |
| bool | is_enabled () const |
| Is this candidate action enabled ? | |
| void | enable () |
| Enable the candidate action. | |
| void | disable () |
| Disable the candidate action. | |
| double | get_score () const |
| Get the usual score of the candidate action without re-evaluation. | |
| double | get_max_score () const |
| Get the upper bound of the score of the candidate action without re-evaluation. | |
| virtual std::string | get_name () const |
| Get the name of the candidate action (useful for debug purposes). | |
| const std::string & | get_type () const |
| Get the type of the candidate action (useful for debug purposes). | |
| virtual std::string | get_id () const |
| virtual std::string | get_engine () const |
| int | get_recursion_count () const |
| virtual config | to_config () const |
| serialize | |
| virtual void | set_to_be_removed () |
| virtual bool | to_be_removed () |
Static Public Attributes | |
| static const double | BAD_SCORE = 0 |
| static const double | HIGH_SCORE = 10000000 |
Private Attributes | |
| recursion_counter | recursion_counter_ |
| bool | enabled_ |
| std::string | engine_ |
| double | score_ |
| double | max_score_ |
| std::string | id_ |
| std::string | name_ |
| std::string | type_ |
| bool | to_be_removed_ |
Definition at line 36 of file rca.hpp.
| ai::candidate_action::candidate_action | ( | rca_context & | context, | |
| const config & | cfg | |||
| ) |
Constructor.
| ai | context of the candidate action | |
| name | name of the action (for debug purposes) | |
| type | type of the action (for debug purposes) |
Definition at line 36 of file rca.cpp.
References ai::rca_context_proxy::init_rca_context_proxy().
Referenced by ai::fai_candidate_action_wrapper::fai_candidate_action_wrapper().


| ai::candidate_action::~candidate_action | ( | ) | [virtual] |
| void ai::candidate_action::disable | ( | ) |
Disable the candidate action.
Definition at line 67 of file rca.cpp.
References enabled_.
Referenced by ai::lua_stage_wrapper::lua_stage_wrapper().

| void ai::candidate_action::enable | ( | ) |
| virtual double ai::candidate_action::evaluate | ( | ) | [pure virtual] |
Evaluate the candidate action, resetting the internal state of the action.
| >0 | if the action is good | |
| <=0 | if the action is not good |
Implemented in ai::fai_candidate_action_wrapper, ai::lua_candidate_action_wrapper, ai::lua_sticky_candidate_action_wrapper, ai::testing_ai_default::goto_phase, ai::testing_ai_default::aspect_recruitment_phase, ai::testing_ai_default::recruitment_phase, ai::testing_ai_default::combat_phase, ai::testing_ai_default::move_leader_to_goals_phase, ai::testing_ai_default::move_leader_to_keep_phase, ai::testing_ai_default::get_villages_phase, ai::testing_ai_default::get_healing_phase, ai::testing_ai_default::retreat_phase, ai::testing_ai_default::simple_move_and_targeting_phase, ai::testing_ai_default::leader_control_phase, ai::testing_ai_default::passive_leader_shares_keep_phase, ai::testing_ai_default::global_fallback_phase, ai::testing_ai_default::testing_move_to_targets_phase, and ai::testing_ai_default::testing_recruitment_phase.
| virtual void ai::candidate_action::execute | ( | ) | [pure virtual] |
Execute the candidate action.
Implemented in ai::fai_candidate_action_wrapper, ai::lua_candidate_action_wrapper, ai::lua_sticky_candidate_action_wrapper, ai::testing_ai_default::goto_phase, ai::testing_ai_default::aspect_recruitment_phase, ai::testing_ai_default::recruitment_phase, ai::testing_ai_default::combat_phase, ai::testing_ai_default::move_leader_to_goals_phase, ai::testing_ai_default::move_leader_to_keep_phase, ai::testing_ai_default::get_villages_phase, ai::testing_ai_default::get_healing_phase, ai::testing_ai_default::retreat_phase, ai::testing_ai_default::simple_move_and_targeting_phase, ai::testing_ai_default::leader_control_phase, ai::testing_ai_default::passive_leader_shares_keep_phase, ai::testing_ai_default::global_fallback_phase, ai::testing_ai_default::testing_move_to_targets_phase, and ai::testing_ai_default::testing_recruitment_phase.
| virtual std::string ai::candidate_action::get_engine | ( | ) | const [inline, virtual] |
| virtual std::string ai::candidate_action::get_id | ( | ) | const [inline, virtual] |
| double ai::candidate_action::get_max_score | ( | ) | const |
Get the upper bound of the score of the candidate action without re-evaluation.
Definition at line 79 of file rca.cpp.
References max_score_.
| virtual std::string ai::candidate_action::get_name | ( | ) | const [inline, virtual] |
Get the name of the candidate action (useful for debug purposes).
Implements ai::component.
Definition at line 100 of file rca.hpp.
References name_.
Referenced by ai::testing_ai_default::leader_control_phase::evaluate(), ai::testing_ai_default::move_leader_to_goals_phase::evaluate(), ai::testing_ai_default::passive_leader_shares_keep_phase::execute(), ai::testing_ai_default::leader_control_phase::execute(), ai::testing_ai_default::simple_move_and_targeting_phase::execute(), ai::testing_ai_default::retreat_phase::execute(), ai::testing_ai_default::get_healing_phase::execute(), ai::testing_ai_default::move_leader_to_keep_phase::execute(), ai::testing_ai_default::move_leader_to_goals_phase::execute(), ai::testing_ai_default::combat_phase::execute(), ai::testing_ai_default::goto_phase::execute(), and operator<<().

| int ai::candidate_action::get_recursion_count | ( | ) | const |
Definition at line 62 of file rca.cpp.
References ai::recursion_counter::get_count(), and recursion_counter_.

| double ai::candidate_action::get_score | ( | ) | const |
Get the usual score of the candidate action without re-evaluation.
Definition at line 73 of file rca.cpp.
References score_.
Referenced by ai::testing_ai_default::testing_recruitment_phase::evaluate(), ai::testing_ai_default::testing_move_to_targets_phase::evaluate(), ai::testing_ai_default::global_fallback_phase::evaluate(), ai::testing_ai_default::passive_leader_shares_keep_phase::evaluate(), ai::testing_ai_default::simple_move_and_targeting_phase::evaluate(), ai::testing_ai_default::retreat_phase::evaluate(), ai::testing_ai_default::get_healing_phase::evaluate(), ai::testing_ai_default::get_villages_phase::evaluate(), ai::testing_ai_default::move_leader_to_keep_phase::evaluate(), ai::testing_ai_default::move_leader_to_goals_phase::evaluate(), ai::testing_ai_default::combat_phase::evaluate(), ai::testing_ai_default::recruitment_phase::evaluate(), ai::testing_ai_default::aspect_recruitment_phase::evaluate(), and ai::testing_ai_default::goto_phase::evaluate().

| const std::string & ai::candidate_action::get_type | ( | ) | const |
| bool ai::candidate_action::is_enabled | ( | ) | const |
| void ai::candidate_action::set_to_be_removed | ( | ) | [virtual] |
Definition at line 101 of file rca.cpp.
References to_be_removed_.
| bool ai::candidate_action::to_be_removed | ( | ) | [virtual] |
Definition at line 106 of file rca.cpp.
References to_be_removed_.
| config ai::candidate_action::to_config | ( | ) | const [virtual] |
serialize
Reimplemented in ai::fai_candidate_action_wrapper, and ai::lua_candidate_action_wrapper.
Definition at line 89 of file rca.cpp.
References enabled_, engine_, max_score_, name_, score_, and type_.
const double ai::candidate_action::BAD_SCORE = 0 [static] |
Definition at line 39 of file rca.hpp.
Referenced by ai::testing_ai_default::candidate_action_evaluation_loop::do_play_stage(), ai::testing_ai_default::testing_recruitment_phase::evaluate(), ai::testing_ai_default::passive_leader_shares_keep_phase::evaluate(), ai::testing_ai_default::leader_control_phase::evaluate(), ai::testing_ai_default::simple_move_and_targeting_phase::evaluate(), ai::testing_ai_default::retreat_phase::evaluate(), ai::testing_ai_default::get_healing_phase::evaluate(), ai::testing_ai_default::get_villages_phase::evaluate(), ai::testing_ai_default::move_leader_to_keep_phase::evaluate(), ai::testing_ai_default::move_leader_to_goals_phase::evaluate(), ai::testing_ai_default::combat_phase::evaluate(), ai::testing_ai_default::recruitment_phase::evaluate(), ai::testing_ai_default::aspect_recruitment_phase::evaluate(), and ai::testing_ai_default::goto_phase::evaluate().
bool ai::candidate_action::enabled_ [private] |
Definition at line 130 of file rca.hpp.
Referenced by disable(), enable(), is_enabled(), and to_config().
std::string ai::candidate_action::engine_ [private] |
Definition at line 133 of file rca.hpp.
Referenced by get_engine(), and to_config().
const double ai::candidate_action::HIGH_SCORE = 10000000 [static] |
std::string ai::candidate_action::id_ [private] |
Reimplemented in ai::testing_ai_default::move_leader_to_goals_phase.
Definition at line 142 of file rca.hpp.
Referenced by get_id().
double ai::candidate_action::max_score_ [private] |
Definition at line 139 of file rca.hpp.
Referenced by get_max_score(), and to_config().
std::string ai::candidate_action::name_ [private] |
Definition at line 145 of file rca.hpp.
Referenced by get_name(), and to_config().
Definition at line 128 of file rca.hpp.
Referenced by get_recursion_count().
double ai::candidate_action::score_ [private] |
Definition at line 136 of file rca.hpp.
Referenced by get_score(), and to_config().
bool ai::candidate_action::to_be_removed_ [private] |
Definition at line 151 of file rca.hpp.
Referenced by set_to_be_removed(), and to_be_removed().
std::string ai::candidate_action::type_ [private] |
Definition at line 148 of file rca.hpp.
Referenced by get_type(), and to_config().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:18:30 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |