Package teamwork :: Package agent :: Module DefaultBased :: Class GenericEntity
[hide private]
[frames] | no frames]

Class GenericEntity

source code

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

Generic entity class with general-purpose methods for instantiating an entity, using class-specific defaults

Nested Classes [hide private]

Inherited from Agent.Agent: actionClass

Instance Methods [hide private]
 
__init__(self, name) source code
 
setHierarchy(self, classes)
Sets the hierarchy of GenericModel instances that this agent uses for its default values
source code
 
applyDefaults(self, className=None, hierarchy=None)
Applies the generic model in the society of the given class name
source code
 
getDefault(self, feature)
Finds the most specific class defaults for the specified feature; raises KeyError exception if no default exists
source code
 
initState(self)
Instantiates all of the state defaults relevant to this entity
source code
 
initActions(self, decisions)
Initializes the actions to follow the form of the given DecisionSpace
source code
 
_initActions(self, mySpace, decisions) source code
 
initRelationships(self, entityList)
Instantiates the relationships of this entity regarding the provided list of entities
source code
 
initModels(self, entityList)
Instantiate all of the relevant models
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
 
initBeliefs(self, entity)
Sets the beliefs that this entity has about the given entity, following the various defaults
source code
 
applyBeliefs(self, beliefs) source code
 
initDynamics(self, entities={})
Sets world dynamics of this entity in response to all of the possible actions in the given multiagent system
source code
 
initGoals(self, entities=[])
Sets the goal weights of this entity based on class defaults.
source code
 
initObservations(self, entities=[])
Instantiates generic observation function with given entity list
source code
 
instantiateGoal(self, goal, entities=[])
Specializes the given goal to the given scenario context
source code
 
instantiateList(self, nameList, refList, entities=[])
Returns: a list of entity lists appropriate for recursive beliefs with all name references replaced by the appropriate entities
source code
str[]
instantiateName(self, name, entities=[])
Returns a list of instance names that match the given abstract entity reference (either 'self', relationship, or class name).
source code
 
addActions(self, entities)
Adds any actions that I can perform with respect to the given entities
source code
 
_addActions(self, entities, baseActions, realActions) source code
boolean
instanceof(self, className)
Returns: True iff this entity is a member of the specified class
source code
 
__copy__(self) 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 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, 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]
  copyCount = 0.0
  factors = []

Inherited from stereotypes.Stereotyper: defaultModelChange

Inherited from GoalBased.GoalBasedAgent: valueType

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

Method Details [hide private]

__init__(self, name)
(Constructor)

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

setHierarchy(self, classes)

source code 

Sets the hierarchy of GenericModel instances that this agent uses for its default values

Parameters:

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

initDynamics(self, entities={})

source code 

Sets world dynamics of this entity in response to all of the possible actions in the given multiagent system

Parameters:
  • entities (str→Agent) - the agents whose actions are relevant

initGoals(self, entities=[])

source code 

Sets the goal weights of this entity based on class defaults. The resulting goals depend on the group of entities passed in as the optional argument.

instantiateGoal(self, goal, entities=[])

source code 

Specializes the given goal to the given scenario context

Returns a list of goals created by instantiating the given goal template (i.e., it refers to classes or relationships) with respect to the provided list of entities and current relationships

instantiateList(self, nameList, refList, entities=[])

source code 
Parameters:
  • nameList (str[]) - list of names to be instantiated
  • refList (str[][]) - partial results of name lists instantiation so far
  • entities (Agent[]) - the entities from which to draw instances from
Returns:
a list of entity lists appropriate for recursive beliefs with all name references replaced by the appropriate entities

instantiateName(self, name, entities=[])

source code 

Returns a list of instance names that match the given abstract entity reference (either 'self', relationship, or class name).

Parameters:
  • name (str or str[]) - the reference(s) to be instantiated
  • entities (Agent[]) - the entities to search for the given reference. If no entities are provided, defaults to the list of entities that this entity has beliefs about
Returns: str[]

addActions(self, entities)

source code 

Adds any actions that I can perform with respect to the given entities

Parameters:

instanceof(self, className)

source code 
Parameters:
  • className (str) - name of class to test against
Returns: boolean
True iff this entity is a member of the specified class

__copy__(self)

source code 
Overrides: Agent.Agent.__copy__

__xml__(self)

source code 
Overrides: Agent.Agent.__xml__

parse(self, element)

source code 

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

Parameters:
  • element (Element)
Overrides: Agent.Agent.parse