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

Class BehaviorPirateRoutine

source code

BehaviorComponent --+
                    |
                   BehaviorPirateRoutine

Idle behavior for Pirate player. It has to be specialized for Pirate since general AI does not have home_point. Responsible for pirate ships routine when no one is around. States change in a loop: idle -> moving_random -> going_home -> idle

Instance Methods [hide private]
 
__init__(self, owner) source code
 
no_one_in_sight(self, **environment)
Idle action, sail randomly when no ship was spotted nearby.
source code
 
trading_ships_in_sight(self, **environment) source code
 
_arrived(self, ship)
Callback function executed once ship arrives at the destination after certain action.
source code
 
_chase_closest_ship(self, pirate_ship) source code
 
_sail_home(self, pirate_ship) source code
 
_sail_random(self, pirate_ship) 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]
  sail_home_chance = 0.3
  pirate_caught_ship_radius = 5
  pirate_home_radius = 2
    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__

_arrived(self, ship)

source code 

Callback function executed once ship arrives at the destination after certain action. Practically only changes ship state to idle.