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

Class Condition

source code

Condition's goal is to aid StrategyManager in figuring out what kind of strategy/mission is applicable to given state of world, e.g. instead of having a really long method that decides what kind of reasoning should be done at given point, we have a collection of Conditions (with priorities) that are easier to handle.

Instance Methods [hide private]
 
__init__(self, owner) source code
 
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
Class Variables [hide private]
  log = logging.getLogger("ai.aiplayer.combat.condition")
  default_certainty = 1.0
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

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