Public Member Functions | Static Public Attributes | Private Attributes

ai::candidate_action Class Reference

#include <rca.hpp>

Inheritance diagram for ai::candidate_action:
Inheritance graph
[legend]
Collaboration diagram for ai::candidate_action:
Collaboration graph
[legend]

List of all members.

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_

Detailed Description

Definition at line 36 of file rca.hpp.


Constructor & Destructor Documentation

ai::candidate_action::candidate_action ( rca_context context,
const config cfg 
)

Constructor.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

ai::candidate_action::~candidate_action (  )  [virtual]

Destructor.

Definition at line 46 of file rca.cpp.


Member Function Documentation

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().

Here is the caller graph for this function:

void ai::candidate_action::enable (  ) 

Enable the candidate action.

Definition at line 57 of file rca.cpp.

References enabled_.

virtual double ai::candidate_action::evaluate (  )  [pure virtual]
virtual void ai::candidate_action::execute (  )  [pure virtual]
virtual std::string ai::candidate_action::get_engine (  )  const [inline, virtual]

Implements ai::component.

Definition at line 111 of file rca.hpp.

References engine_.

virtual std::string ai::candidate_action::get_id (  )  const [inline, virtual]

Implements ai::component.

Definition at line 108 of file rca.hpp.

References id_.

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]
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_.

Here is the call graph for this function:

double ai::candidate_action::get_score (  )  const
const std::string & ai::candidate_action::get_type (  )  const

Get the type of the candidate action (useful for debug purposes).

Definition at line 84 of file rca.cpp.

References type_.

bool ai::candidate_action::is_enabled (  )  const

Is this candidate action enabled ?

Definition at line 51 of file rca.cpp.

References enabled_.

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_.


Member Data Documentation

const double ai::candidate_action::BAD_SCORE = 0 [static]

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]

Definition at line 42 of file rca.hpp.

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().

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().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:18:30 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs