Package teamwork :: Package agent :: Module Entities :: Class PsychEntity
[hide private]
[frames] | no frames]

Class PsychEntity

source code

              Agent.Agent --+                
                            |                
RecursiveAgent.RecursiveAgent --+            
                                |            
         GoalBased.GoalBasedAgent --+        
                                    |        
              stereotypes.Stereotyper --+    
                                        |    
               DefaultBased.GenericEntity --+
                                            |
                  Agent.Agent --+           |
                                |           |
    RecursiveAgent.RecursiveAgent --+       |
                                    |       |
             GoalBased.GoalBasedAgent --+   |
                                        |   |
                        support.Supporter --+
                                            |
                  Agent.Agent --+           |
                                |           |
    RecursiveAgent.RecursiveAgent --+       |
                                    |       |
              MemoryAgent.MemoryAgent --+   |
                                        |   |
              consistency.ConsistentAgent --+
                                            |
                                           PsychEntity
Known Subclasses:

Entity class

  1. Creating a new agent mode:
  2. Picking a specific stereotypical mental model:
  3. Manipulating the goals:
  4. Manipulating the recursive belief structure:
  5. Manipulating the state:
  6. Manipulating the actions (see teamwork.action.PsychActions.Action):
  7. Manipulating the dynamics (see teamwork.dynamics.pwlDynamics.PWLDynamics):
Nested Classes [hide private]

Inherited from Agent.Agent: actionClass

Instance Methods [hide private]
 
__init__(self, name)
Constructor
source code
 
initEntities(self, entityList, maxDepth=-1)
Sets the entities known to be the list provided, and makes the appropriate updates to goals, policy depth, etc.
source code
 
stateEstimator(self, beliefs, actions, epoch=-1, debug=Debugger (0))
Calls the superclass state estimator, but also handles messages
source code
dict
preComStateEstimator(self, beliefs, actions, epoch=-1, debug=Debugger (0))
Computes the hypothetical changes to the given beliefs in response to the given actions
source code
 
postComStateEstimator(self, beliefs, msgs, epoch=-1, debug=Debugger (0))
Updates the agent's beliefs based on received messages
source code
 
hypotheticalPostCom(self, beliefs, msgs, epoch=-1, debug=Debugger (0))
Returns: the potential change in the agent's beliefs based on received messages
source code
 
acceptMessage(self, sender, msg, debug=Debugger (0))
Boolean test that returns true iff this entity will accept (i.e., believe) the message sent by the specified sender entity
source code
 
acceptability(self, sender=None, distance=-0.0, filter=None, debug=Debugger (0))
Quantitative assessment of the acceptability of my current beliefs
source code
 
extendPolicy(self, subpolicy)
Extends the lookup policy within the overall composite policy
source code
 
setPolicyDepth(self, depth)
Sets the lookahead policy depth within the overall composite policy (creates a lookahead subpolicy if none pre-existing)
source code
int
getPolicyDepth(self)
Returns: the lookahead policy depth within the overall composite policy (returns 0 if no such subpolicy)
source code
 
__cmp__(self, agent)
Default comparison function...treats all agents equally
source code
 
__copy__(self) source code
 
__getstate__(self)
Remove any image info before pickling
source code
 
__setstate__(self, newDict)
Restore image info after unpickling
source code
 
__xml__(self) source code
 
parse(self, element)
Extracts this agent's recursive belief structure from the given XML Element
source code

Inherited from DefaultBased.GenericEntity: addActions, applyBeliefs, applyDefaults, getDefault, initActions, initBeliefs, initDynamics, initGoals, initModels, initObservations, initRelationships, initState, instanceof, instantiateGoal, instantiateList, instantiateName, setHierarchy

Inherited from stereotypes.Stereotyper: __str__, clusterSpace, freezeModels, generateSpace, hypotheticalPreCom, reachable, setModel, updateModel, updateModels, weightEqual

Inherited from GoalBased.GoalBasedAgent: actionValue, applyGoals, expectedValue, fit, generateConstraints, getGoalTree, getGoalVector, getGoalWeight, getGoals, getNormalization, normalizeGoals, setGoalWeight, setGoals

Inherited from RecursiveAgent.RecursiveAgent: __deepcopy__, __eq__, __getitem__, __ne__, ancestry, applyChanges, applyPolicy, beliefDepth, findObservation, freeze, getActionKeys, getAllBeliefs, getBelief, getBeliefKeys, getDynamics, getEntities, getEntity, getEntityBeliefs, getNestedBelief, getObservation, getObservations, getSelfBelief, getState, getStateFeatures, hasBelief, incorporateMessage, initialStateEstimator, invalidateCache, multistep, observe, resetHistory, saveObservations, setBelief, setEntity, setName, setObservation, setRecursiveBelief, setSelfBelief, setState, step, toHTML, updateStateDict

Inherited from Agent.Agent: generateAllObservations, generateHistories, legalActions, legalMessages, observable

Inherited from support.Supporter: getLink, getLinkKey, getLinkTypes, getLinkees, getSupport, getTrust, removeLink, setLink, setSupport, setTrust, updateLinks, updateTrust

Inherited from consistency.ConsistentAgent: __getMessageContentKey__, __getStateIntegratedWithMessage__, __propagateBeliefsBackInTime__, __propagateBeliefsForwardInTime__, __solveForUniqueTreePath__, calculateMessageConsistency, getMemoryConsistency

Inherited from MemoryAgent.MemoryAgent: updateMemory

Class Variables [hide private]
  beliefWeights = {'consistency': 1.0, 'liking': 0.075, 'self-in...
  consistencyWeights = {'consistency': 0.9, 'self-interest': 0.1...

Inherited from DefaultBased.GenericEntity: copyCount, factors

Inherited from stereotypes.Stereotyper: defaultModelChange

Inherited from GoalBased.GoalBasedAgent: valueType

Inherited from support.Supporter: supportLimit, supportWeights

Inherited from support.Supporter (private): _supportFeature, _trustFeature

Instance Variables [hide private]

Inherited from stereotypes.Stereotyper: model, modelChange, models

Inherited from GoalBased.GoalBasedAgent: constraints, goals, horizon

Inherited from RecursiveAgent.RecursiveAgent: dynamics, parent, relationships, state

Inherited from Agent.Agent: actions, name, omega

Inherited from support.Supporter: linkDynamics, linkTypes, links

Method Details [hide private]

__init__(self, name)
(Constructor)

source code 

Constructor

Takes a string name, a list of action type strings, and a list of message factors. The final parameters is a flag indicating whether Tk variables should be used (default is yes).

Parameters:
  • name - label for this instance
Overrides: MemoryAgent.MemoryAgent.__init__

initEntities(self, entityList, maxDepth=-1)

source code 

Sets the entities known to be the list provided, and makes the appropriate updates to goals, policy depth, etc.

Parameters:
  • maxDepth (int) - the maximum depth of this agent's recursive models
Overrides: support.Supporter.initEntities

stateEstimator(self, beliefs, actions, epoch=-1, debug=Debugger (0))

source code 

Calls the superclass state estimator, but also handles messages

Overrides: RecursiveAgent.RecursiveAgent.stateEstimator

preComStateEstimator(self, beliefs, actions, epoch=-1, debug=Debugger (0))

source code 

Computes the hypothetical changes to the given beliefs in response to the given actions

Parameters:
  • beliefs (dict) - the beliefs to be updated (traditionally, the result from getAllBeliefs)
  • actions (dict:str→Action) - the actions observed by this agent
  • epoch (int) - the current epoch in which these observations occurred (currently ignored, but potentially important)
  • debug (Debugger)
Returns: dict
the belief changes that would result from the specified observed actions, in dictionary form:
  • beliefs: results as returned by hypotheticalAct
  • observations: the given actions
Overrides: support.Supporter.preComStateEstimator

postComStateEstimator(self, beliefs, msgs, epoch=-1, debug=Debugger (0))

source code 

Updates the agent's beliefs based on received messages

Overrides: Agent.Agent.postComStateEstimator

hypotheticalPostCom(self, beliefs, msgs, epoch=-1, debug=Debugger (0))

source code 
Returns:
the potential change in the agent's beliefs based on received messages

setPolicyDepth(self, depth)

source code 

Sets the lookahead policy depth within the overall composite policy (creates a lookahead subpolicy if none pre-existing)

Parameters:
  • depth (int) - the desired horizon

getPolicyDepth(self)

source code 
Returns: int
the lookahead policy depth within the overall composite policy (returns 0 if no such subpolicy)

__cmp__(self, agent)
(Comparison operator)

source code 

Default comparison function...treats all agents equally

Overrides: Agent.Agent.__cmp__

Note: This is just a string compare on names. Feel free to override with a more domain-specific comparison

__copy__(self)

source code 
Overrides: Agent.Agent.__copy__

__xml__(self)

source code 
Overrides: support.Supporter.__xml__

parse(self, element)

source code 

Extracts this agent's recursive belief structure from the given XML Element

Overrides: support.Supporter.parse

Class Variable Details [hide private]

beliefWeights

Value:
{'consistency': 1.0,
 'liking': 0.075,
 'self-interest': 0.1,
 'sender-interest': -0.0,
 'threshold': -0.0001,
 'trust': 0.15}

consistencyWeights

Value:
{'consistency': 0.9,
 'self-interest': 0.1,
 'sender-interest': -0.1,
 'threshold': -0.0}