Package teamwork :: Package action :: Module PsychActions :: Class Action
[hide private]
[frames] | no frames]

Class Action

source code

object --+    
         |    
      dict --+
             |
            Action
Known Subclasses:

Instance Methods [hide private]
new empty dictionary

__init__(self, arg={})
Translates an action in string form into a structured representation of that same action (e.g., 'CLF-violence-to-UrbanPoor' becomes a PsychAction object {'actor':CLF,'type':'violence','object':UrbanPoor}
source code
 
instantiate(self, entities=[]) source code
 
makeRange(self, actType={})
Returns a list of all possible instantiations of this partially specified action.
source code
 
addField(self, key, value)
Returns a *copy* of this action with the given key,value pair
source code
 
__getitem__(self, index)
x[y]
source code
 
__setitem__(self, index, value)
x[i]=y
source code
 
__delitem__(self, index)
del x[y]
source code
list of D's keys
keys(self) source code
 
__deepcopy__(self, memo) source code
 
__str__(self)
Translates a structured dictionary representation of an action into a standardized string format (e.g., {'actor':CLF,'type':'violence','object':UrbanPoor} becomes 'CLF-violence-to-UrbanPoor'
source code
 
simpleText(self) source code
bool
matchTemplate(self, template)
Returns: true iff the action matches the given template
source code
 
__xml__(self) source code
 
parse(self, doc) source code
 
__hash__(self)
hash(x)
source code

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

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Class Variables [hide private]
  nop = 'wait'
  fields = {'_observed': {}, '_unobserved': {}, 'actor': {}, 'co...
  format = ['actor', 'type', 'object', 'command']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Translates an action in string form into a structured representation of that same action (e.g., 'CLF-violence-to-UrbanPoor' becomes a PsychAction object {'actor':CLF,'type':'violence','object':UrbanPoor}

Returns:
new empty dictionary

Overrides: object.__init__

__getitem__(self, index)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__
(inherited documentation)

__setitem__(self, index, value)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

__delitem__(self, index)
(Index deletion operator)

source code 

del x[y]

Overrides: dict.__delitem__
(inherited documentation)

keys(self)

source code 
Returns: list of D's keys
Overrides: dict.keys
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Translates a structured dictionary representation of an action into a standardized string format (e.g., {'actor':CLF,'type':'violence','object':UrbanPoor} becomes 'CLF-violence-to-UrbanPoor'

Overrides: object.__str__

matchTemplate(self, template)

source code 
Returns: bool
true iff the action matches the given template

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

Class Variable Details [hide private]

fields

Value:
{'_observed': {},
 '_unobserved': {},
 'actor': {},
 'command': {},
 'object': {},
 'repeatable': <type 'bool'>,
 'self': <type 'bool'>,
 'type': {}}