Package horizons :: Package ai :: Package aiplayer :: Package strategy :: Module condition :: Class ConditionNeutral
[hide private]
[frames] | no frames]

Class ConditionNeutral

source code

Condition --+
            |
           ConditionNeutral

States whether given player is neutral. What it aims to do is not only find if given player is neutral, but also sort them, i.e. penalize if given neutral is ally with our enemies etc. This way in case of any diplomatic actions it's possible to have a "safe" ally

Instance Methods [hide private]
 
check(self, **environment)
Based on information contained in **environment, determine wheter given condition occurs.
source code
str
get_identifier(self, **environment)
Based on information contained in **environment return an Unique identifier for given condition.
source code
    Inherited from Condition
 
__init__(self, owner) source code
Class Variables [hide private]
    Inherited from Condition
  default_certainty = 1.0
  log = logging.getLogger("ai.aiplayer.combat.condition")
Method Details [hide private]

check(self, **environment)

source code 

Based on information contained in **environment, determine wheter given condition occurs.

Returns:
If the condition occurs: dictionary, else: None
Overrides: Condition.check
(inherited documentation)

get_identifier(self, **environment)

source code 

Based on information contained in **environment return an Unique identifier for given condition. User for checking whether given condition is already being resolved by a mission in progress.

Returns: str
unique identifier
Overrides: Condition.get_identifier
(inherited documentation)