Public Member Functions | Protected Member Functions

ai::testing_ai_default::testing_move_to_targets_phase Class Reference

#include <ca_testing_move_to_targets.hpp>

Inheritance diagram for ai::testing_ai_default::testing_move_to_targets_phase:
Inheritance graph
[legend]
Collaboration diagram for ai::testing_ai_default::testing_move_to_targets_phase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 testing_move_to_targets_phase (rca_context &context, const config &cfg)
virtual ~testing_move_to_targets_phase ()
virtual double evaluate ()
 Evaluate the candidate action, resetting the internal state of the action.
virtual void execute ()
 Execute the candidate action.

Protected Member Functions

void access_points (const move_map &srcdst, const map_location &u, const map_location &dst, std::vector< map_location > &out)
std::pair< map_location,
map_location
choose_move (std::vector< target > &targets, const move_map &srcdst, const move_map &dstsrc, const move_map &enemy_dstsrc)
double compare_groups (const std::set< map_location > &our_group, const std::set< map_location > &their_group, const std::vector< map_location > &battlefield) const
void enemies_along_path (const std::vector< map_location > &route, const move_map &dstsrc, std::set< map_location > &res)
map_location form_group (const std::vector< map_location > &route, const move_map &dstsrc, std::set< map_location > &res)
bool move_group (const map_location &dst, const std::vector< map_location > &route, const std::set< map_location > &units)
double rate_group (const std::set< map_location > &group, const std::vector< map_location > &battlefield) const
double rate_target (const target &tg, const unit_map::iterator &u, const move_map &dstsrc, const move_map &enemy_dstsrc, const pathfind::plain_route &rt)
 rate a target, but can also return the maximal possible rating by passing a dummy route
bool should_retreat (const map_location &loc, const unit_map::const_iterator &un, const move_map &srcdst, const move_map &dstsrc, const move_map &enemy_dstsrc, double caution)

Detailed Description

Definition at line 44 of file ca_testing_move_to_targets.hpp.


Constructor & Destructor Documentation

ai::testing_ai_default::testing_move_to_targets_phase::testing_move_to_targets_phase ( rca_context context,
const config cfg 
)

Definition at line 120 of file ca_testing_move_to_targets.cpp.

ai::testing_ai_default::testing_move_to_targets_phase::~testing_move_to_targets_phase (  )  [virtual]

Definition at line 126 of file ca_testing_move_to_targets.cpp.


Member Function Documentation

void ai::testing_ai_default::testing_move_to_targets_phase::access_points ( const move_map srcdst,
const map_location u,
const map_location dst,
std::vector< map_location > &  out 
) [protected]
std::pair< map_location, map_location > ai::testing_ai_default::testing_move_to_targets_phase::choose_move ( std::vector< target > &  targets,
const move_map srcdst,
const move_map dstsrc,
const move_map enemy_dstsrc 
) [protected]
double ai::testing_ai_default::testing_move_to_targets_phase::compare_groups ( const std::set< map_location > &  our_group,
const std::set< map_location > &  their_group,
const std::vector< map_location > &  battlefield 
) const [protected]

Definition at line 647 of file ca_testing_move_to_targets.cpp.

References rate_group().

Referenced by choose_move().

Here is the call graph for this function:

Here is the caller graph for this function:

void ai::testing_ai_default::testing_move_to_targets_phase::enemies_along_path ( const std::vector< map_location > &  route,
const move_map dstsrc,
std::set< map_location > &  res 
) [protected]

Definition at line 655 of file ca_testing_move_to_targets.cpp.

References get_adjacent_tiles().

Referenced by choose_move(), and rate_target().

Here is the call graph for this function:

Here is the caller graph for this function:

double ai::testing_ai_default::testing_move_to_targets_phase::evaluate (  )  [virtual]

Evaluate the candidate action, resetting the internal state of the action.

Returns:
the score
Return values:
>0 if the action is good
<=0 if the action is not good

Implements ai::candidate_action.

Definition at line 131 of file ca_testing_move_to_targets.cpp.

References ai::candidate_action::get_score().

Here is the call graph for this function:

void ai::testing_ai_default::testing_move_to_targets_phase::execute (  )  [virtual]
map_location ai::testing_ai_default::testing_move_to_targets_phase::form_group ( const std::vector< map_location > &  route,
const move_map dstsrc,
std::set< map_location > &  res 
) [protected]

Definition at line 670 of file ca_testing_move_to_targets.cpp.

References unit_map::count(), unit_map::end(), unit_map::find(), and resources::units.

Referenced by choose_move().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ai::testing_ai_default::testing_move_to_targets_phase::move_group ( const map_location dst,
const std::vector< map_location > &  route,
const std::set< map_location > &  units 
) [protected]
double ai::testing_ai_default::testing_move_to_targets_phase::rate_group ( const std::set< map_location > &  group,
const std::vector< map_location > &  battlefield 
) const [protected]

Definition at line 815 of file ca_testing_move_to_targets.cpp.

References unit::attacks(), unit::defense_modifier(), unit_map::end(), unit_map::find(), resources::game_map, gamemap::get_terrain(), unit::hitpoints(), map_, unit::max_hitpoints(), and resources::units.

Referenced by compare_groups().

Here is the call graph for this function:

Here is the caller graph for this function:

double ai::testing_ai_default::testing_move_to_targets_phase::rate_target ( const target tg,
const unit_map::iterator u,
const move_map dstsrc,
const move_map enemy_dstsrc,
const pathfind::plain_route rt 
) [protected]

rate a target, but can also return the maximal possible rating by passing a dummy route

Definition at line 206 of file ca_testing_move_to_targets.cpp.

References enemies_along_path(), ai::readonly_context_proxy::get_scout_village_targeting(), ai::target::loc, pathfind::plain_route::move_cost, pathfind::plain_route::steps, ai::target::SUPPORT, ai::target::type, ai::target::value, and ai::target::VILLAGE.

Referenced by choose_move().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ai::testing_ai_default::testing_move_to_targets_phase::should_retreat ( const map_location loc,
const unit_map::const_iterator un,
const move_map srcdst,
const move_map dstsrc,
const move_map enemy_dstsrc,
double  caution 
) [protected]

Definition at line 852 of file ca_testing_move_to_targets.cpp.

References ai::readonly_context_proxy::best_defensive_position(), resources::game_map, and ai::readonly_context_proxy::power_projection().

Referenced by choose_move().

Here is the call graph for this function:

Here is the caller graph for this function:


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:19:12 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs