Package horizons :: Package ai :: Package aiplayer :: Package goal :: Class Goal
[hide private]
[frames] | no frames]

Class Goal

source code

An object of this class describes a goal that an AI player attempts to fulfil.

Instance Methods [hide private]
 
__init__(self, owner) source code
 
get_personality_name(self)
Return the name of the goal's personality module.
source code
 
priority(self) source code
 
active(self)
Return True if and only if it is ok to execute this goal.
source code
 
can_be_activated(self)
Return True if and only if it is ok to update this goal.
source code
 
execute(self)
Do whatever is best to get closer to fulfilling the goal (usually involves building a building).
source code
 
update(self)
Update the goal to find out whether it is currently active and what its current priority is.
source code
 
__lt__(self, other) source code
 
__str__(self) source code
Class Methods [hide private]
 
_translate_build_result(cls, result)
Returns the goal execution state that corresponds to the given BUILD_RESULT constant.
source code
Class Variables [hide private]
  log = logging.getLogger("ai.aiplayer.goal")
Method Details [hide private]

priority(self)

source code 
Decorators:
  • @property

active(self)

source code 

Return True if and only if it is ok to execute this goal.

Decorators:
  • @property

can_be_activated(self)

source code 

Return True if and only if it is ok to update this goal.

Decorators:
  • @property