Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

aiunit2.h File Reference

Unit and Unit Type Analysis and Worth Functions for AIs. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  Xconq

Functions

int seer_worth (int u)
 Basic worth as a seer.

void set_seer_worth (int u, int n)
 Set basic worth as a seer.

void maybe_set_seer_worths (void)
 Set basic worths as seers, if necessary.

int could_meet_size_goal (int u, int x, int y)
 Could u meet its size goal, if located at the given position?

int acp_max_wo_effects (int u)
 Maximum ACP u can have without enhancing effects.

int acp_per_turn_max_wo_effects (int u)
 Maximum ACP per turn u can have without enhancing effects.

int speed_max_wo_effects (int u)
 Maximum speed u can have without enhancing effects.

int mp_per_turn_max (int u)
 Maximum MP u can get per turn.

int moves_per_turn_max (int u, int t)
 Maximum moves u can make per turn on t.

int move_range_max_on (int u, int t, int m, int amt)
 Max movement range of u if producing m on t, and given an amount of m.

int move_range_max (int u, int t, int *amt)
 Max movement range of u on t, and given amounts of mtypes.

int move_range_best (int u, int *amt)
 Best movement range of u, given amounts of mtypes.

int move_range_worst (int u, int *amt)
 Worst movement range of u, given amounts of mtypes.

int mover_worth (int u)
 Basic worth as a mover.

void set_mover_worth (int u, int n)
 Set basic worth as a mover.

void maybe_set_mover_worths (void)
 Set basic worths as movers, if necessary.

int depot_worth (int u)
 Basic worth as a depot.

void set_depot_worth (int u, int n)
 Set basic worth as a depot.

void maybe_set_depot_worths (void)
 Set basic worths as depots, if necessary.

int distributor_worth (int u)
 Basic worth as a distributor.

void set_distributor_worth (int u, int n)
 Set basic worth as a distributor.

void maybe_set_distributor_worths (void)
 Set basic worths as distributors, if necessary.

int producer_worth (int u)
 Basic worth as a producer.

void set_producer_worth (int u, int n)
 Set basic worth as a producer.

void maybe_set_producer_worths (void)
 Set basic worths as producers, if necessary.

int producer_worth_on_known (Unit *producer, int x, int y)
 Given unit's worth as a producer on a given known cell.

int prod_enhancer_worth (int u)
 Basic worth as a production enhancer.

void set_prod_enhancer_worth (int u, int n)
 Set basic worth as a production enhancer.

void maybe_set_prod_enhancer_worths (void)
 Set basic worths as production enhancers, if necessary.

int base_worth_for (int u, int u2)
 Basic worth as a base for u2.

void set_base_worth_for (int u, int n)
 Set basic worth as a base for u2.

void maybe_set_base_worths_for (void)
 Set basic worths as bases for utypes, if necessary.

int base_worth (int u)
 Basic worth as a base.

void set_base_worth (int u, int n)
 Set basic worth as a base.

void maybe_set_base_worths (void)
 Set basic worths as bases, if necessary.

int can_create_in (Unit *actor, Unit *creator, int u3, Unit *transport)
 Does a given side seem to be able to create u3 in a given transport?

int can_create_at (Unit *actor, Unit *creator, int u3, int x, int y)
 Does a given side seem to be able to create u3 at a given location?

int tp_per_turn_est (Unit *unit, int u2)
 How many TP for a given utype can a given unit add to itself per turn?

int cp_per_turn_est (Unit *unit, int u2)
 How many CP can a given unit add to a given utype per turn?

int cp_gained_per_turn_est (Unit *unit, Side *side)
 How many CP can a given side add to a given unit per turn?

int hp_per_turn_est (Unit *unit, int u2)
 How many HP can a given unit add to a given utype per turn?

int hp_gained_per_turn_est (Unit *unit, Side *side)
 How many HP can a given side add to a given unit per turn?

int firings_per_turn_est (int u, int u2)
 Estimated number of times u can fire at u2 in a turn.

int attacks_per_turn_est (int u, int u2)
 Estimated number of times u can attack u2 in a turn.

int detonations_per_turn_est (int u, int u2)
 Estimated number of times u can detonate against u2 in a turn.

int capture_attempts_per_turn_est (int u, int u2, Side *side2)
 Estimated number of times u can attempt capture of u2 in a turn.

int firings_mean_to_destroy (int u, int u2, int hp2, int dm=100, int hcm=100)
 Mean number of firings for u to destroy u2 with given modifiers.

int firings_mean_to_destroy (int u, UnitView *uview)
 Mean number of firings for u to destroy given uview.

int firings_mean_to_destroy (int u2, Unit *unit)
 Mean number of firings for u2 to destroy given unit.

int fire_turns_mean_to_destroy (int u, UnitView *uview)
 Mean number of turns for u to destroy given uview by firing.

int fire_turns_mean_to_destroy (int u2, Unit *unit)
 Mean number of turns for u2 to destroy given unit by firing.

int attacks_mean_to_destroy (int u, int u2, int hp2, int dm=100, int hcm=100)
 Mean number of attacks for u to destroy u2 with given modifiers.

int attacks_mean_to_destroy (int u, UnitView *uview)
 Mean number of attacks for u to destroy given uview.

int attacks_mean_to_destroy (int u2, Unit *unit)
 Mean number of attacks for u2 to destroy given unit.

int attack_turns_mean_to_destroy (int u, UnitView *uview)
 Mean number of turns for u to destroy given uview by attacks.

int attack_turns_mean_to_destroy (int u2, Unit *unit)
 Mean number of turns for u2 to destroy given unit by attacks.

int detonations_mean_to_destroy (int u, int u2, int hp2, int dm=100)
 Mean number of detonations for u to destroy u2 with given modifiers.

int detonations_mean_to_destroy (int u, UnitView *uview)
 Mean number of detonations for u to destroy given uview.

int detonations_mean_to_destroy (int u2, Unit *unit)
 Mean number of detonations for u2 to destroy given unit.

int detonate_turns_mean_to_destroy (int u, UnitView *uview)
 Mean number of turns for u to destroy given uview by detonations.

int detonate_turns_mean_to_destroy (int u2, Unit *unit)
 Mean number of turns for u2 to destroy given unit by detonations.

int firings_mean_to_capture (int u, int u2, Side *side2, int ccm=100)
 Mean number of attempts u needs to capture u2 by firing.

int firings_mean_to_capture (int u, UnitView *uview)
 Mean number of attempts u needs to capture given uview by firing.

int firings_mean_to_capture (int u2, Unit *unit)
 Mean number of attempts u2 needs to capture given unit by firing.

int fire_turns_mean_to_capture (int u, UnitView *uview)
 Mean number of turns u needs to capture given uview by firing.

int fire_turns_mean_to_capture (int u2, Unit *unit)
 Mean number of turns u2 needs to capture given unit by firing.

int attacks_mean_to_capture (int u, int u2, Side *side2, int ccm=100)
 Mean number of attempts u needs to capture u2 by attacks.

int attacks_mean_to_capture (int u, UnitView *uview)
 Mean number of attempts u needs to capture given uview by attacks.

int attacks_mean_to_capture (int u2, Unit *unit)
 Mean number of attempts u2 needs to capture given unit by attacks.

int attack_turns_mean_to_capture (int u, UnitView *uview)
 Mean number of turns u needs to capture given uview by attacks.

int attack_turns_mean_to_capture (int u2, Unit *unit)
 Mean number of turns u2 needs to capture given unit by attacks.

int attempts_mean_to_capture (int u, int u2, Side *side2, int ccm=100)
 Mean number of attempts u needs to directly capture u2.

int attempts_mean_to_capture (int u, UnitView *uview)
 Mean number of attempts u needs to directly capture given uview.

int attempts_mean_to_capture (int u2, Unit *unit)
 Mean number of attempts u2 needs to directly capture given unit.

int capture_turns_mean_to_capture (int u, UnitView *uview)
 Mean number of turns u needs to directly capture given uview.

int capture_turns_mean_to_capture (int u2, Unit *unit)
 Mean number of turns u2 needs to directly capture given unit.

int explorer_worth (int u)
 Basic worth as an explorer.

void set_explorer_worth (int u, int n)
 Set basic worth as an explorer.

void maybe_set_explorer_worths (void)
 Set basic worths as explorers, if necessary.

int total_worth (int u)
 Sum of all the basic worths.


Detailed Description

Unit and Unit Type Analysis and Worth Functions for AIs.

Part of the AI API, Level 2.

Provides useful functions that an AI implementation may use to analyze and to assign a worth to units and unit types.

The functions in this file provide evaluations regarding units and unit types that are useful in decision-making.

Note:
Nothing in this file should ever be required to implement an AI; everything here is optional.

Function Documentation

int acp_max_wo_effects int  u  ) 
 

Maximum ACP u can have without enhancing effects.

int acp_per_turn_max_wo_effects int  u  ) 
 

Maximum ACP per turn u can have without enhancing effects.

int attack_turns_mean_to_capture int  u2,
Unit unit
 

Mean number of turns u2 needs to capture given unit by attacks.

int attack_turns_mean_to_capture int  u,
UnitView uview
 

Mean number of turns u needs to capture given uview by attacks.

int attack_turns_mean_to_destroy int  u2,
Unit unit
 

Mean number of turns for u2 to destroy given unit by attacks.

int attack_turns_mean_to_destroy int  u,
UnitView uview
 

Mean number of turns for u to destroy given uview by attacks.

int attacks_mean_to_capture int  u2,
Unit unit
 

Mean number of attempts u2 needs to capture given unit by attacks.

int attacks_mean_to_capture int  u,
UnitView uview
 

Mean number of attempts u needs to capture given uview by attacks.

int attacks_mean_to_capture int  u,
int  u2,
Side side2,
int  ccm = 100
 

Mean number of attempts u needs to capture u2 by attacks.

int attacks_mean_to_destroy int  u2,
Unit unit
 

Mean number of attacks for u2 to destroy given unit.

int attacks_mean_to_destroy int  u,
UnitView uview
 

Mean number of attacks for u to destroy given uview.

int attacks_mean_to_destroy int  u,
int  u2,
int  hp2,
int  dm = 100,
int  hcm = 100
 

Mean number of attacks for u to destroy u2 with given modifiers.

int attacks_per_turn_est int  u,
int  u2
 

Estimated number of times u can attack u2 in a turn.

int attempts_mean_to_capture int  u2,
Unit unit
 

Mean number of attempts u2 needs to directly capture given unit.

int attempts_mean_to_capture int  u,
UnitView uview
 

Mean number of attempts u needs to directly capture given uview.

int attempts_mean_to_capture int  u,
int  u2,
Side side2,
int  ccm = 100
 

Mean number of attempts u needs to directly capture u2.

int base_worth int  u  ) 
 

Basic worth as a base.

int base_worth_for int  u,
int  u2
 

Basic worth as a base for u2.

int can_create_at Unit actor,
Unit creator,
int  u3,
int  x,
int  y
 

Does a given side seem to be able to create u3 at a given location?

int can_create_in Unit actor,
Unit creator,
int  u3,
Unit transport
 

Does a given side seem to be able to create u3 in a given transport?

int capture_attempts_per_turn_est int  u,
int  u2,
Side side2
 

Estimated number of times u can attempt capture of u2 in a turn.

int capture_turns_mean_to_capture int  u2,
Unit unit
 

Mean number of turns u2 needs to directly capture given unit.

int capture_turns_mean_to_capture int  u,
UnitView uview
 

Mean number of turns u needs to directly capture given uview.

int could_meet_size_goal int  u,
int  x,
int  y
 

Could u meet its size goal, if located at the given position?

Todo:
Should consider contribution of side treasury.

int cp_gained_per_turn_est Unit unit,
Side side
 

How many CP can a given side add to a given unit per turn?

int cp_per_turn_est Unit unit,
int  u2
 

How many CP can a given unit add to a given utype per turn?

int depot_worth int  u  ) 
 

Basic worth as a depot.

int detonate_turns_mean_to_destroy int  u2,
Unit unit
 

Mean number of turns for u2 to destroy given unit by detonations.

int detonate_turns_mean_to_destroy int  u,
UnitView uview
 

Mean number of turns for u to destroy given uview by detonations.

int detonations_mean_to_destroy int  u2,
Unit unit
 

Mean number of detonations for u2 to destroy given unit.

int detonations_mean_to_destroy int  u,
UnitView uview
 

Mean number of detonations for u to destroy given uview.

int detonations_mean_to_destroy int  u,
int  u2,
int  hp2,
int  dm = 100
 

Mean number of detonations for u to destroy u2 with given modifiers.

int detonations_per_turn_est int  u,
int  u2
 

Estimated number of times u can detonate against u2 in a turn.

int distributor_worth int  u  ) 
 

Basic worth as a distributor.

int explorer_worth int  u  ) 
 

Basic worth as an explorer.

Note:
We could consider range like the old 'exploring_worth' function does. However, a fast, short-range explorer, such as a Fighter in the Default game, should not be undervalued against a slower, longe-range explorer, such as a Bomber.

int fire_turns_mean_to_capture int  u2,
Unit unit
 

Mean number of turns u2 needs to capture given unit by firing.

int fire_turns_mean_to_capture int  u,
UnitView uview
 

Mean number of turns u needs to capture given uview by firing.

int fire_turns_mean_to_destroy int  u2,
Unit unit
 

Mean number of turns for u2 to destroy given unit by firing.

int fire_turns_mean_to_destroy int  u,
UnitView uview
 

Mean number of turns for u to destroy given uview by firing.

int firings_mean_to_capture int  u2,
Unit unit
 

Mean number of attempts u2 needs to capture given unit by firing.

int firings_mean_to_capture int  u,
UnitView uview
 

Mean number of attempts u needs to capture given uview by firing.

int firings_mean_to_capture int  u,
int  u2,
Side side2,
int  ccm = 100
 

Mean number of attempts u needs to capture u2 by firing.

int firings_mean_to_destroy int  u2,
Unit unit
 

Mean number of firings for u2 to destroy given unit.

int firings_mean_to_destroy int  u,
UnitView uview
 

Mean number of firings for u to destroy given uview.

int firings_mean_to_destroy int  u,
int  u2,
int  hp2,
int  dm = 100,
int  hcm = 100
 

Mean number of firings for u to destroy u2 with given modifiers.

int firings_per_turn_est int  u,
int  u2
 

Estimated number of times u can fire at u2 in a turn.

int hp_gained_per_turn_est Unit unit,
Side side
 

How many HP can a given side add to a given unit per turn?

int hp_per_turn_est Unit unit,
int  u2
 

How many HP can a given unit add to a given utype per turn?

void maybe_set_base_worths void   ) 
 

Set basic worths as bases, if necessary.

void maybe_set_base_worths_for void   ) 
 

Set basic worths as bases for utypes, if necessary.

void maybe_set_depot_worths void   ) 
 

Set basic worths as depots, if necessary.

void maybe_set_distributor_worths void   ) 
 

Set basic worths as distributors, if necessary.

void maybe_set_explorer_worths void   ) 
 

Set basic worths as explorers, if necessary.

void maybe_set_mover_worths void   ) 
 

Set basic worths as movers, if necessary.

void maybe_set_prod_enhancer_worths void   ) 
 

Set basic worths as production enhancers, if necessary.

void maybe_set_producer_worths void   ) 
 

Set basic worths as producers, if necessary.

void maybe_set_seer_worths void   ) 
 

Set basic worths as seers, if necessary.

int move_range_best int  u,
int *  amt
 

Best movement range of u, given amounts of mtypes.

int move_range_max int  u,
int  t,
int *  amt
 

Max movement range of u on t, and given amounts of mtypes.

int move_range_max_on int  u,
int  t,
int  m,
int  amt
 

Max movement range of u if producing m on t, and given an amount of m.

int move_range_worst int  u,
int *  amt
 

Worst movement range of u, given amounts of mtypes.

int mover_worth int  u  ) 
 

Basic worth as a mover.

int moves_per_turn_max int  u,
int  t
 

Maximum moves u can make per turn on t.

int mp_per_turn_max int  u  ) 
 

Maximum MP u can get per turn.

int prod_enhancer_worth int  u  ) 
 

Basic worth as a production enhancer.

int producer_worth int  u  ) 
 

Basic worth as a producer.

Todo:
Consider occupant consumption.

int producer_worth_on_known Unit producer,
int  x,
int  y
 

Given unit's worth as a producer on a given known cell.

int seer_worth int  u  ) 
 

Basic worth as a seer.

void set_base_worth int  u,
int  n
 

Set basic worth as a base.

void set_base_worth_for int  u,
int  n
 

Set basic worth as a base for u2.

void set_depot_worth int  u,
int  n
 

Set basic worth as a depot.

void set_distributor_worth int  u,
int  n
 

Set basic worth as a distributor.

void set_explorer_worth int  u,
int  n
 

Set basic worth as an explorer.

void set_mover_worth int  u,
int  n
 

Set basic worth as a mover.

void set_prod_enhancer_worth int  u,
int  n
 

Set basic worth as a production enhancer.

void set_producer_worth int  u,
int  n
 

Set basic worth as a producer.

void set_seer_worth int  u,
int  n
 

Set basic worth as a seer.

int speed_max_wo_effects int  u  ) 
 

Maximum speed u can have without enhancing effects.

int total_worth int  u  ) 
 

Sum of all the basic worths.

int tp_per_turn_est Unit unit,
int  u2
 

How many TP for a given utype can a given unit add to itself per turn?


Generated on Sat Sep 17 10:29:00 2005 for XconqKernel by doxygen 1.3.6