Package teamwork :: Package reward :: Module goal :: Class PWLGoal
[hide private]
[frames] | no frames]

Class PWLGoal

source code

A reward subfunction represented as a PWL function of some vector (typically the world state)

Instance Methods [hide private]
 
__init__(self) source code
 
addDependency(self, condition, tree=None)
Adds a new dependency to this subfunction
source code
 
toKey(self) source code
 
reward(self, context, actions=[]) source code
float
_sign(self, value)
Applies the appropriate sign to a goal magnitude
source code
 
__str__(self) source code
 
__hash__(self) source code
 
__xml__(self) source code
 
parse(self, element) source code
Instance Variables [hide private]
list dependency
set of decision trees that represent the reward subfunction over possible action triggers
Key[] keys
set of Key instances that this goal depends on
bool max
True iff this goal represents a positive incentive; otherwise, it is a disincentive (default is True)
Method Details [hide private]

addDependency(self, condition, tree=None)

source code 

Adds a new dependency to this subfunction

Parameters:
  • condition (ActionCondition) - the trigger condition for this dependency
  • tree (ProbabilityTree) - the PWL function to compute when triggered (ignored if the condition is a counting one)

_sign(self, value)

source code 

Applies the appropriate sign to a goal magnitude

Parameters:
  • value (float) - the (presumably nonnegative) magnitude of the reward
Returns: float
the appropriately signed reward value