#include <ca_testing_move_to_targets.hpp>


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) |
Definition at line 44 of file ca_testing_move_to_targets.hpp.
| 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.
| 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] |
Definition at line 622 of file ca_testing_move_to_targets.cpp.
References pathfind::a_star_search(), ai::readonly_context_proxy::current_team(), distance_between(), unit_map::end(), unit_map::find(), resources::game_map, gamemap::h(), map_, pathfind::plain_route::steps, resources::teams, resources::units, and gamemap::w().
Referenced by choose_move().


| 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] |
Definition at line 272 of file ca_testing_move_to_targets.cpp.
References pathfind::a_star_search(), access_points(), ai::target::BATTLE_AID, unit_map::begin(), ai::readonly_context_proxy::calculate_possible_moves(), compare_groups(), ai::readonly_context_proxy::current_team(), unit::defense_modifier(), gui2::distance(), distance_between(), unit_map::end(), enemies_along_path(), unit_map::find(), form_group(), resources::game_map, ai::readonly_context_proxy::get_caution(), ai::readonly_context_proxy::get_grouping(), ai::side_context_proxy::get_side(), ai::readonly_context_proxy::get_simple_targeting(), gamemap::get_terrain(), gamemap::h(), unit::hitpoints(), team::is_enemy(), ai::target::loc, LOG_AI, ai::testing_ai_default::log_ai_testing_ca_testing_move_to_targets, log_scope2, map_, ai::target::MASS, pathfind::plain_route::move_cost, move_group(), gamemap::on_board(), ai::readonly_context_proxy::power_projection(), ai::readonly_context_proxy::raise_user_interact(), rate_target(), should_retreat(), pathfind::plain_route::steps, ai::target::SUPPORT, resources::units, map_location::valid(), ai::target::value, and gamemap::w().
Referenced by execute().


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


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


| double ai::testing_ai_default::testing_move_to_targets_phase::evaluate | ( | ) | [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 |
Implements ai::candidate_action.
Definition at line 131 of file ca_testing_move_to_targets.cpp.
References ai::candidate_action::get_score().

| void ai::testing_ai_default::testing_move_to_targets_phase::execute | ( | ) | [virtual] |
Execute the candidate action.
Implements ai::candidate_action.
Definition at line 137 of file ca_testing_move_to_targets.cpp.
References ai::default_ai_context_proxy::additional_targets(), choose_move(), ai::readwrite_context_proxy::execute_move_action(), unit_map::find_leader(), ai::default_ai_context_proxy::find_targets(), resources::game_map, ai::readonly_context_proxy::get_dstsrc(), ai::readonly_context_proxy::get_enemy_dstsrc(), ai::side_context_proxy::get_side(), ai::readonly_context_proxy::get_srcdst(), LOG_AI, gamemap::on_board(), resources::units, and WRN_AI.

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


| 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] |
Definition at line 713 of file ca_testing_move_to_targets.cpp.
References ai::readonly_context_proxy::calculate_possible_moves(), preferences::editor::TransitionUpdateMode::count, unit_map::count(), unit_map::end(), ai::readwrite_context_proxy::execute_move_action(), unit_map::find(), gui2::event::find(), resources::game_map, get_adjacent_tiles(), gamemap::get_terrain(), LOG_AI, map_, gamemap::on_board(), resources::units, map_location::valid(), map_location::x, and map_location::y.
Referenced by choose_move().


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


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


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


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