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

Class ClassKey

source code

object --+        
         |        
      dict --+    
             |    
           Key --+
                 |
                ClassKey

A Key indicating the entry corresponding to a class membership flag

Instance Methods [hide private]
 
simpleText(self) 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

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

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __init__, __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 = 'class'
  slots = {'entity': 1, 'value': 0}

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

simpleText(self)

source code 
Overrides: Key.simpleText

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