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

Class BehaviorRegular

source code

BehaviorComponent --+
                    |
                   BehaviorRegular

A well-balanced way to respond to situations in game.

Instance Methods [hide private]
 
__init__(self, owner) source code
 
pirate_ships_in_sight(self, **environment)
Attacks pirates only if they are enemies already and the power balance is advantageous.
source code
 
fighting_ships_in_sight(self, **environment)
Attacks frigates only if they are enemies already and the power balance is advantageous.
source code
 
working_ships_in_sight(self, **environment)
Attacks working ships only if they are hostile.
source code
 
_certainty_player_shares_island(self, **environment)
Dummy certainty that checks for a fleets size only.
source code
 
_certainty_ship_amount(self, **environment) source code
 
_certainty_hostile_player(self, **environment) source code
 
player_shares_island(self, **environment)
Response to player that shares an island with AI player.
source code
 
hostile_player(self, **environment)
Arrage an attack for hostile ships.
source code
 
neutral_player(self, **environment)
Not concerned about neutral players.
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 Variables [hide private]
  power_balance_threshold = 1.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)
(Constructor)

source code 
Overrides: BehaviorComponent.__init__

player_shares_island(self, **environment)

source code 

Response to player that shares an island with AI player. Regular AI should simply attack given player.