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

Class IdentityKey

source code

object --+        
         |        
      dict --+    
             |    
           Key --+
                 |
                IdentityKey

A Key indicating the entry corresponding to a role flag. The relationship slot can take on the following values:

Instance Methods [hide private]
new empty dictionary

__init__(self, args={})
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
Key
instantiate(self, table)
Utility method that takes a mapping from entity references (e.g., 'self', 'actor') to actual entity names (e.g., 'Bill', 'agent0').
source code
 
simpleText(self) source code

Inherited from Key: __copy__, __hash__, __str__, __xml__, parse

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Class Variables [hide private]
  keyType = 'identity'
  slots = {'entity': 1, 'relationship': 6}

Inherited from Key: ACTION, CLASS, ENTITIES, ENTITY, STATE, TEST, VALUE

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, args={})
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

instantiate(self, table)

source code 

Utility method that takes a mapping from entity references (e.g., 'self', 'actor') to actual entity names (e.g., 'Bill', 'agent0'). It returns a new key string with the substitution applied. It also reduces any 'identity' keys to be either constant or null depending on whether the key matches the identity of the entity represented in the dictionary provided. Subclasses should override this method for more instantiation of more specialized fields.

Parameters:
  • table (dict) - A dictionary of label-value pairs. Any slot in the key whose filler matches a label in the given table will be replaced by the associated value.
Returns: Key
A new Key instance with the appropriate label substitutions
Overrides: Key.instantiate

simpleText(self)

source code 
Overrides: Key.simpleText