Package teamwork :: Package agent :: Module stereotypes :: Class Stereotyper
[hide private]
[frames] | no frames]

Class Stereotyper

source code

              Agent.Agent --+        
                            |        
RecursiveAgent.RecursiveAgent --+    
                                |    
         GoalBased.GoalBasedAgent --+
                                    |
                                   Stereotyper
Known Subclasses:

Mix-in class that supports stereotypical mental models

Nested Classes [hide private]

Inherited from Agent.Agent: actionClass

Instance Methods [hide private]
 
__copy__(self, new=None) source code
 
__init__(self, name) source code
 
__str__(self)
Returns a string representation of this entity
source code
 
__xml__(self) source code
 
clusterSpace(self, granularity, weightList=None, debug=None, finish=None, interrupt=None) source code
 
freezeModels(self)
Lock the model of this agent and all mental models it may have
source code
(dict:teamwork.reward.MinMaxGoal.MinMaxGoal→float)[]
generateSpace(self, granularity=10, goals=None, weightList=None, availableWeight=1.0)
Generates a space of possible goal weights for this agent
source code
 
hypotheticalPreCom(self, beliefs, actions, epoch=-1, debug=Debugger (0))
Returns the hypothetical model changes
source code
 
parse(self, element)
Extracts this agent's recursive belief structure from the given XML Element
source code
 
reachable(self, weightList, granularity, neighbors=None) source code
 
setModel(self, model, fixed=False)
Applies the named mental model to this entity
source code
 
updateModel(self, actual, debug=Debugger (0))
Updates the mental model in response to the single action
source code
 
updateModels(self, actions, debug)
Updates the mental models in response to the given dictionary of actions
source code
 
weightEqual(self, weight1, weight2) source code

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, preComStateEstimator, resetHistory, saveObservations, setBelief, setEntity, setName, setObservation, setRecursiveBelief, setSelfBelief, setState, stateEstimator, step, toHTML, updateStateDict

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

Class Variables [hide private]
boolean defaultModelChange = None
Class-wide default for modelChange attribute

Inherited from GoalBased.GoalBasedAgent: valueType

Instance Variables [hide private]
dictionary model
the current stereotype that this agent is following
boolean modelChange
Flag that specifies whether this agent will change its mental models or not
dictionary of name: model pairs models
the space of possible stereotypes that can be applied to this agent

Inherited from GoalBased.GoalBasedAgent: constraints, goals, horizon

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

Inherited from Agent.Agent: actions, name, omega

Method Details [hide private]

__copy__(self, new=None)

source code 
Overrides: Agent.Agent.__copy__

__init__(self, name)
(Constructor)

source code 
Parameters:
  • name - label for this instance
Overrides: Agent.Agent.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Returns a string representation of this entity

Overrides: RecursiveAgent.RecursiveAgent.__str__
(inherited documentation)

__xml__(self)

source code 
Overrides: Agent.Agent.__xml__

generateSpace(self, granularity=10, goals=None, weightList=None, availableWeight=1.0)

source code 

Generates a space of possible goal weights for this agent

Parameters:
  • granularity (dict) - the number of positive goal weights to consider for each goal (i.e., a granularity of n will generate values of [0,1/n,2/n, ..., 1]. This is a dictionary of numbers, indexed by individual goals.
  • goals (teamwork.reward.MinMaxGoal.MinMaxGoal[]) - the list of goals left to consider (typically omitted, the default is the current set of goals for this agent)
  • weightList (dict) - the initial list of possible goal weightings, to be extended in combination with the newly generated goal weightings (typically omitted)
  • availableWeight (float) - the weight to be distributed across the possible goals (typically omitted, the default is 1)
Returns: (dict:teamwork.reward.MinMaxGoal.MinMaxGoal→float)[]
all possible combinations of goal weights that sum to the availableWeight

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

source code 

Returns the hypothetical model changes

Returns the mental model changes that would result from the specified observed actions.

parse(self, element)

source code 

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

Overrides: Agent.Agent.parse

Instance Variable Details [hide private]

model

the current stereotype that this agent is following
  • name: the name of the current stereotype
  • fixed: a flag indicating whether this model is subject to change
Type:
dictionary