Package teamwork :: Package math :: Module Keys
[hide private]
[frames] | no frames]

Module Keys

source code

A class of unique identifiers for symbolic identification of rows and columns in the PWL representations of state, dynamics, reward, etc.

Classes [hide private]
  Key
Superclass for all different keys, used for indexing the various symbolic matrices and hyperplanes
  ConstantKey
A Key indicating the entry corresponding to a constant factor
  StateKey
A Key indicating the entry corresponding to a state feature value
  ModelKey
A Key indicating the mental model corresponding to a given entity
  BinaryKey
A StateKey whose values will be either 0.
  ObservationKey
A Key indicating the entry corresponding to an observation flag
  ActionKey
A Key indicating the entry corresponding to an observed action flag
  IdentityKey
A Key indicating the entry corresponding to a role flag.
  ClassKey
A Key indicating the entry corresponding to a class membership flag
  RelationshipKey
A Key indicating the entry corresponding to the slot for the corresponding inter-agent relationship
  LinkKey
A Key corresponding to a slot for a pairwise link between two entities
  WorldKey
A Key indexing into a sample space of possible worlds
Functions [hide private]
 
makeStateKey(entity, feature)
Helper function for creating StateKey objects
source code
 
makeActionKey(action)
Helper function for creating ActionKey objects
source code
 
makeIdentityKey(entity)
Helper funtion for creating IdentityKey objects
source code
 
makeClassKey(entity, className)
Helper function for creating ClassKey objects
source code
 
temporaryTest(original)
Debugging code
source code
Variables [hide private]
  keyDelete = '__delete__'
a flag string used internally
  keyConstant = {}
a ConstantKey instance to be reused (i.e., so as not to have to create millions of new instances
  EMPTY_NAMESPACE = None
  EMPTY_PREFIX = None
  StringTypes = (<type 'str'>, <type 'unicode'>)
  XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
Function Details [hide private]

makeStateKey(entity, feature)

source code 

Helper function for creating StateKey objects

Parameters:
  • entity (string) - The entity to be pointed to by this key
  • feature (string) - The state feature to be pointed to by this key
Returns:
the corresponding StateKey object

makeActionKey(action)

source code 

Helper function for creating ActionKey objects

Parameters:
  • action (Action instance (though a generic dictionary will work, too)) - The action to be flagged by this Key
Returns:
an ActionKey instance corresponding to the given action

makeIdentityKey(entity)

source code 

Helper funtion for creating IdentityKey objects

Parameters:
  • entity (string (e.g., 'actor','object')) - the relationship that should be matched on
Returns:
an IdentityInstance testing for the given relationship

makeClassKey(entity, className)

source code 

Helper function for creating ClassKey objects

Parameters:
  • entity (string (e.g., 'actor','object','self')) - the entity to be tested
  • className (string) - the class name to test membership for
Returns:
a ClassKey instance with the appropriate class test

Warning: may not actually work