Package teamwork :: Package examples :: Package Thespian :: Module ThespianMessage :: Class ThespianMessage
[hide private]
[frames] | no frames]

Class ThespianMessage

source code

            object --+            
                     |            
                  dict --+        
                         |        
action.PsychActions.Action --+    
                             |    
 messages.PsychMessage.Message --+
                                 |
                                ThespianMessage

Instance Methods [hide private]
new empty dictionary

__init__(self, arg='', theme=None)
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
 
extractFromString(self, str)
The string representation of a non-command message is: <key11>:<key12>:...:<key1n>=<value1>;<key21>:<key22>:...:<key2m>=<value2>;...
source code
 
__copy__(self) source code
 
__repr__(self)
repr(x)
source code
 
pretty(self)
Returns a more user-friendly string rep of this message
source code

Inherited from messages.PsychMessage.Message: __cmp__, __setitem__, __str__, __xml__, force, forceAccept, forceReject, mustAccept, mustReject, parse

Inherited from action.PsychActions.Action: __deepcopy__, __delitem__, __getitem__, __hash__, addField, instantiate, keys, makeRange, matchTemplate, simpleText

Inherited from dict: __contains__, __eq__, __ge__, __getattribute__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, 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]
  fields = {'_observed': {}, '_unobserved': {}, 'actor': {}, 'ad...
the available keys for messages of this class (unless otherwise noted, the value under each key is a string)
  acceptString = 'accept'
the flag indicating that a hearer should be forced to believe this message
  rejectString = 'reject'
the flag indicating that a hearer should be forced to disbelieve this message

Inherited from action.PsychActions.Action: format, nop

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, arg='', theme=None)
(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__
(inherited documentation)

extractFromString(self, str)

source code 

The string representation of a non-command message is: <key11>:<key12>:...:<key1n>=<value1>;<key21>:<key22>:...:<key2m>=<value2>;... e.g., entities:Psyops:state:power=0.7;entities:Paramilitary:entities:Psyops:state:power=0.7 e.g., message Psyops Paramilitary entities:Psyops:policy:observation depth 3 actor Paramilitary type violence object UrbanPoor violence-to-Paramilitary For commands, the syntax is 'command;<key1>=<val1>;<key2>=<val2>;...', where the usual keys are 'object' (e.g., 'opponent') and 'type' (e.g., 'violence'). This same format is expected by the constructor and returned by the string converter.

Overrides: messages.PsychMessage.Message.extractFromString

__copy__(self)

source code 
Overrides: messages.PsychMessage.Message.__copy__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

pretty(self)

source code 

Returns a more user-friendly string rep of this message

Returns:
a more user-friendly string rep of this message
Overrides: messages.PsychMessage.Message.pretty

Class Variable Details [hide private]

fields

the available keys for messages of this class (unless otherwise noted, the value under each key is a string)
  • sender: the agent sending the message (i.e., the actor)
  • receiver: the sender's intended hearer (i.e., the object)
  • type: the action type (default is _message)
  • performative: as defined by ACL conventions (default is tell)
  • command: the action that the sender is commanding the receiver to perform (probably doesn't work)
  • force: dictionary (over receivers) of flags indicating whether acceptance/rejection of the message should be forced. For each name key, if the value is None, then the agent decides for itself; if acceptString, then theagent must believe the message; if rejectString, then the agent must reject the message. You should not set this field's value directly; rather, use the forceAccept, forceReject, mustAccept, and mustReject methods as appropriate
  • factors: the content of the message, in the form of a list of dictionaries, specifying the intended change to individual beliefs
Value:
{'_observed': {},
 '_unobserved': {},
 'actor': {},
 'addressee': {},
 'attitude': {'neg_face': 0.0, 'pos_face': 0.0},
 'command': {},
 'factors': {},
 'force': {},
...