ai::attack_analysis Struct Reference

#include <ai.hpp>

Inheritance diagram for ai::attack_analysis:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

void analyze (const gamemap &map, unit_map &units, const std::vector< team > &teams, const gamestatus &status, class ai &ai_obj, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc, double aggression)
double rating (double aggression, class ai &ai_obj) const
variant get_value (const std::string &key) const
void get_inputs (std::vector< game_logic::formula_input > *inputs) const

Public Attributes

gamemap::location target
std::vector< std::pair
< gamemap::location,
gamemap::location > > 
movements
double target_value
 The value of the unit being targeted.
double avg_losses
 The value on average, of units lost in the combat.
double chance_to_kill
 Estimated % chance to kill the unit.
double avg_damage_inflicted
 The average hitpoints damage inflicted.
int target_starting_damage
double avg_damage_taken
 The average hitpoints damage taken.
double resources_used
 The sum of the values of units used in the attack.
double terrain_quality
 The weighted average of the % chance to hit each attacking unit.
double alternative_terrain_quality
 The weighted average of the % defense of the best possible terrain that the attacking units could reach this turn, without attacking (good for comparison to see just how good/bad 'terrain_quality' is).
double vulnerability
 The vulnerability is the power projection of enemy units onto the hex we're standing on.
double support
bool leader_threat
 Is true if the unit is a threat to our leader.
bool uses_leader
 Is true if this attack sequence makes use of the leader.
bool is_surrounded
 Is true if the units involved in this attack sequence are surrounded.


Detailed Description

Definition at line 130 of file ai.hpp.


Member Function Documentation

void ai::attack_analysis::analyze ( const gamemap map,
unit_map units,
const std::vector< team > &  teams,
const gamestatus status,
class ai ai_obj,
const move_map dstsrc,
const move_map srcdst,
const move_map enemy_dstsrc,
double  aggression 
)

double ai::attack_analysis::rating ( double  aggression,
class ai ai_obj 
) const

variant ai::attack_analysis::get_value ( const std::string &  key  )  const [virtual]

void ai::attack_analysis::get_inputs ( std::vector< game_logic::formula_input > *  inputs  )  const [virtual]

Reimplemented from game_logic::formula_callable.

Definition at line 2331 of file ai.cpp.

References game_logic::FORMULA_READ_ONLY.


Member Data Documentation

Definition at line 143 of file ai.hpp.

Referenced by ai::analyze_targets(), and formula_ai::execute_variant().

The value of the unit being targeted.

Definition at line 147 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The value on average, of units lost in the combat.

Definition at line 150 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

Estimated % chance to kill the unit.

Definition at line 153 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The average hitpoints damage inflicted.

Definition at line 156 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

Definition at line 158 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The average hitpoints damage taken.

Definition at line 161 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The sum of the values of units used in the attack.

Definition at line 164 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The weighted average of the % chance to hit each attacking unit.

Definition at line 167 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The weighted average of the % defense of the best possible terrain that the attacking units could reach this turn, without attacking (good for comparison to see just how good/bad 'terrain_quality' is).

Definition at line 172 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

The vulnerability is the power projection of enemy units onto the hex we're standing on.

support is the power projection of friendly units.

Definition at line 176 of file ai.hpp.

Referenced by ai::analyze_targets(), ai::do_attack_analysis(), get_value(), and rating().

Definition at line 176 of file ai.hpp.

Referenced by ai::analyze_targets(), ai::do_attack_analysis(), get_value(), and rating().

Is true if the unit is a threat to our leader.

Definition at line 179 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

Is true if this attack sequence makes use of the leader.

Definition at line 182 of file ai.hpp.

Referenced by analyze(), get_value(), and rating().

Is true if the units involved in this attack sequence are surrounded.

Definition at line 185 of file ai.hpp.

Referenced by ai::do_attack_analysis(), get_value(), and rating().


The documentation for this struct was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs