Package horizons :: Package ai :: Package aiplayer :: Package behavior :: Module behaviorcomponents :: Class BehaviorEvil
[hide private]
[frames] | no frames]

Class BehaviorEvil

source code

BehaviorComponent --+    
   BehaviorDiplomatic --+

Diplomatic behavior. Evil AI likes players that are:

Neutral towards:


Instance Methods [hide private]
__init__(self, owner) source code
    Inherited from BehaviorDiplomatic
_choose_random_from_tuple(self, tuple)
Choose random action from tuple of (name, value)
source code
_get_action(self, relationship_score, **parameters) source code
_perform_action(self, action, **environment)
Execute action from actions Enum.
source code
allied_player(self, **environment) source code
calculate_relationship_score(self, balance, weights)
Calculate total relationship_score based on balances and their weights.
source code
handle_diplomacy(self, parameters, **environment)
Main function responsible for handling diplomacy.
source code
hostile_player(self, **environment)
Calculate balance, and change diplomacy towards a player to neutral or ally.
source code
neutral_player(self, **environment) source code
    Inherited from BehaviorComponent
_certainty_has_boat_builder(self, **environment) source code
_certainty_has_fleet(self, **environment) source code
certainty(self, action_name, **environment) source code
Class Methods [hide private]
    Inherited from BehaviorDiplomatic
_get_quadratic_function(cls, mid, root, peek=1.0)
Functions for border distributions such as enemy or ally (left or right parabola).
source code
_move_f(cls, f, v_x, v_y)
Return function f moved by vector (v_x, v_y)
source code
get_ally_function(cls, root, peek=1.0) source code
get_enemy_function(cls, root, peek=1.0) source code
get_neutral_function(cls, mid, root, peek=1.0) source code
Class Variables [hide private]
  weights = {'power':-0.6, 'wealth':-0.3, 'terrain':-0.1,}
  parameters_hostile = {'neutral': {'mid': 0.0, 'root': 2.0, 'pe...
  parameters_neutral = {'enemy': {'root':-2.5,}, 'ally': {'root'...
  parameters_allied = {'neutral': {'mid':-2.0, 'root':-0.5, 'pee...
    Inherited from BehaviorDiplomatic
  actions = Enum('wait', 'war', 'peace', 'neutral')
  upper_boundary = 5.0
    Inherited from BehaviorComponent
  default_certainty = 1.0
  log = logging.getLogger('ai.aiplayer.behavior.behaviorcomponen...
  minimal_fleet_size = 1
Method Details [hide private]

__init__(self, owner)

source code 
Overrides: BehaviorComponent.__init__

Class Variable Details [hide private]


{'neutral': {'mid': 0.0, 'root': 2.0, 'peek': 0.2}, 'ally': {'root': 7\


{'enemy': {'root':-2.5,}, 'ally': {'root': 5.0, 'peek': 0.7,},}


{'neutral': {'mid':-2.0, 'root':-0.5, 'peek': 0.2,}, 'enemy': {'root':\