Package teamwork :: Package examples :: Package Games :: Module PublicGood :: Class PublicGoodAgent
[hide private]
[frames] | no frames]

Class PublicGoodAgent

source code

              agent.Agent.Agent --+                    
                                  |                    
agent.RecursiveAgent.RecursiveAgent --+                
                                      |                
         agent.GoalBased.GoalBasedAgent --+            
                                          |            
              agent.stereotypes.Stereotyper --+        
                                              |        
               agent.DefaultBased.GenericEntity --+    
                                                  |    
                  agent.Agent.Agent --+           |    
                                      |           |    
    agent.RecursiveAgent.RecursiveAgent --+       |    
                                          |       |    
             agent.GoalBased.GoalBasedAgent --+   |    
                                              |   |    
                        agent.support.Supporter --+    
                                                  |    
                  agent.Agent.Agent --+           |    
                                      |           |    
    agent.RecursiveAgent.RecursiveAgent --+       |    
                                          |       |    
              agent.MemoryAgent.MemoryAgent --+   |    
                                              |   |    
              agent.consistency.ConsistentAgent --+    
                                                  |    
                         agent.Entities.PsychEntity --+
                                                      |
                                                     PublicGoodAgent

Nested Classes [hide private]
  beliefClass
Domain-specific class that sets up the game stages
Action subclass (default is action) actionClass
the Python class for this agent's option instances
Instance Methods [hide private]
 
freeze(self)
These agents don't really do any backward projection, so let's shortcut through the annoying copying that is required when freezing the initial version of myself
source code
dict
preComStateEstimator(self, beliefs, actions, epoch=-1, debug=Debugger())
Updates beliefs in response to observation (Within this model, the agent and its belief state are one and the same)
source code
 
initEntities(self, entityList, depth=1)
Sets the entities known to be the list provided, and makes the appropriate updates to goals, policy depth, etc.
source code
 
initRelationships(self, entityList)
Instantiates the relationships of this entity regarding the provided list of entities
source code
 
updateModels(self, actions, debug)
Updates the mental models in response to the given dictionary of actions
source code
 
extractModels(self) source code

Inherited from agent.Entities.PsychEntity: __cmp__, __copy__, __getstate__, __init__, __setstate__, __xml__, acceptMessage, acceptability, extendPolicy, getPolicyDepth, hypotheticalPostCom, parse, postComStateEstimator, setPolicyDepth, stateEstimator

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

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

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

Inherited from agent.RecursiveAgent.RecursiveAgent: __deepcopy__, __eq__, __getitem__, __ne__, ancestry, applyChanges, applyPolicy, beliefDepth, findObservation, 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.Agent: generateAllObservations, generateHistories, legalActions, legalMessages, observable

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

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

Inherited from agent.MemoryAgent.MemoryAgent: updateMemory

Class Variables [hide private]
boolean modelChange = 1
Flag that specifies whether this agent will change its mental models or not
  learningRate = 0.2
  valueType = 'final'
  mentalType = 'aggregate'

Inherited from agent.Entities.PsychEntity: beliefWeights, consistencyWeights

Inherited from agent.DefaultBased.GenericEntity: copyCount, factors

Inherited from agent.stereotypes.Stereotyper: defaultModelChange

Inherited from agent.support.Supporter: supportLimit, supportWeights

Instance Variables [hide private]

Inherited from agent.stereotypes.Stereotyper: model, models

Inherited from agent.GoalBased.GoalBasedAgent: constraints, goals, horizon

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

Inherited from agent.Agent.Agent: actions, name, omega

Inherited from agent.support.Supporter: linkDynamics, linkTypes, links

Method Details [hide private]

freeze(self)

source code 

These agents don't really do any backward projection, so let's shortcut through the annoying copying that is required when freezing the initial version of myself

Overrides: agent.RecursiveAgent.RecursiveAgent.freeze

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

source code 

Updates beliefs in response to observation (Within this model, the agent and its belief state are one and the same)

Parameters:
  • beliefs - the beliefs to be updated (traditionally, the result from getAllBeliefs)
  • actions - the actions observed by this agent
  • epoch - the current epoch in which these observations occurred (currently ignored, but potentially important)
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: agent.support.Supporter.preComStateEstimator

initEntities(self, entityList, depth=1)

source code 

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

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

initRelationships(self, entityList)

source code 

Instantiates the relationships of this entity regarding the provided list of entities

Overrides: agent.DefaultBased.GenericEntity.initRelationships

updateModels(self, actions, debug)

source code 

Updates the mental models in response to the given dictionary of actions

Overrides: agent.stereotypes.Stereotyper.updateModels
(inherited documentation)