Package teamwork :: Package dynamics :: Module pwlDynamics :: Class PWLDynamics
[hide private]
[frames] | no frames]

Class PWLDynamics

source code

arbitraryDynamics.BaseDynamics --+
                                 |
                                PWLDynamics

Class of objects that represent the dynamics of a specific state/belief feature in the simulation

Instance Methods [hide private]
 
__init__(self, args=None) source code
dict
extractTable(self, entity, action)
Helper function that extracts the context used in instantiating dynamics
source code
PWLDynamics
instantiate(self, entity, action)
Returns a new PWLDynamics instance that has been specialized to apply to only the specified entity in response to the specified instantiated action.
source code
Distribution(KeyedMatrix)
instantiateAndApply(self, state, entity=None, action=None, table={}, tree=None)
Performs both instantiate and apply in a single call, but does a minimal instantiation, by ignoring branches that are irrelevant in the given state
source code
ProbabilityTree
getTree(self)
Returns: the decision tree for this dynamics object
source code
Distribution(KeyedMatrix)
apply(self, state, debug=0)
Applies this dynamics function to the given state
source code
 
merge(self, other)
Merges the new dynamics into this one by calling KeyedMatrix.merge on the leaves of the decision trees
source code
 
renameEntity(self, old, new, tree=None) source code
 
__add__(self, other) source code
 
__sub__(self, other) source code
 
__xml__(self) source code
 
parse(self, element) source code
 
__str__(self) source code

Inherited from arbitraryDynamics.BaseDynamics: getIncrement, invert, reset

Instance Variables [hide private]
str→bool effects
table of roles affected, containing keys 'actor','object','other'.
Method Details [hide private]

__init__(self, args=None)
(Constructor)

source code 
Overrides: arbitraryDynamics.BaseDynamics.__init__

instantiate(self, entity, action)

source code 

Returns a new PWLDynamics instance that has been specialized to apply to only the specified entity in response to the specified instantiated action. This produces a more compact decision tree where branches irrelevant to the given entity and action have been pruned away.

Parameters:
  • action (dict)
Returns: PWLDynamics
Overrides: arbitraryDynamics.BaseDynamics.instantiate

instantiateAndApply(self, state, entity=None, action=None, table={}, tree=None)

source code 

Performs both instantiate and apply in a single call, but does a minimal instantiation, by ignoring branches that are irrelevant in the given state

Parameters:
Returns: Distribution(KeyedMatrix)

getTree(self)

source code 
Returns: ProbabilityTree
the decision tree for this dynamics object

apply(self, state, debug=0)

source code 

Applies this dynamics function to the given state

Returns: Distribution(KeyedMatrix)
Overrides: arbitraryDynamics.BaseDynamics.apply

merge(self, other)

source code 

Merges the new dynamics into this one by calling KeyedMatrix.merge on the leaves of the decision trees

Parameters:

renameEntity(self, old, new, tree=None)

source code 
Parameters:
  • old - the current name of the entity
  • new - the new name of the entity
  • old,new (str)

Instance Variable Details [hide private]

effects

table of roles affected, containing keys 'actor','object','other'. If the value is True, then the dynamics object affects that role
Type:
str→bool