Package teamwork :: Package agent :: Module Generic :: Class GenericModel
[hide private]
[frames] | no frames]

Class GenericModel

source code

              Agent.Agent --+            
                            |            
RecursiveAgent.RecursiveAgent --+        
                                |        
         GoalBased.GoalBasedAgent --+    
                                    |    
                    support.Supporter --+
                                        |
              Agent.Agent --+           |
                            |           |
RecursiveAgent.RecursiveAgent --+       |
                                |       |
         GoalBased.GoalBasedAgent --+   |
                                    |   |
              stereotypes.Stereotyper --+
                                        |
                                       GenericModel
Known Subclasses:

A container of default values for an Agent

  1. Creating a new generic model: model = GenericModel(name)
  2. Society-specific methods
  3. Picking a specific stereotypical mental model
  4. Manipulating the space of stereotypical mental models:
  5. Manipulating the goals
  6. Manipulating the recursive belief structure
  7. Manipulating the state
  8. Manipulating the actions
  9. Manipulating the dynamics
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
 
merge(self, entity)
Merge the contents of another GenericModel into this one
source code
 
renameEntity(self, old, new) source code
str[]
getParents(self)
Move up through the generic model hierarchy
source code
boolean
isSubclass(self, cls)
Returns: True iff this class is a subclass (inclusive) of the named class
source code
str[]
getAllFillers(self, attribute)
Returns: all fillers of a slot (e.g, 'state', 'action', 'goal') on this model and all superclasses
source code
str
getInheritor(self, attribute, value, includeSelf=True)
Returns: the lowest class (either this one or some ancestory) that defines the given value in the given agent attributes
source code
 
getCumulativeState(self, feature) source code
 
deleteState(self, feature)
Removes the given feature from the state
source code
str[]
ancestors(self, order=False)
Returns: all ancestor classes of this class, including itself
source code
str[]
getRelationships(self)
Returns: all the relationships available to this generic model (including those to its superclasses
source code
 
__xml__(self, doc=None)
Returns an XML Document representing this model
source code
 
parse(self, element)
Extracts model elements from the provided XML element
source code
 
importDict(self, generic)
Updates generic model from dictionary-style spec
source code

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

Inherited from GoalBased.GoalBasedAgent: __copy__, __str__, 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, 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, stateEstimator, step, toHTML, updateStateDict

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

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

Class Variables [hide private]

Inherited from support.Supporter: supportLimit, supportWeights

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

Inherited from GoalBased.GoalBasedAgent: valueType

Inherited from stereotypes.Stereotyper: defaultModelChange

Instance Variables [hide private]
int depth
maximum depth of nesting of recursive beliefs

Inherited from support.Supporter: linkDynamics, linkTypes, links

Inherited from GoalBased.GoalBasedAgent: constraints, goals, horizon

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

Inherited from Agent.Agent: actions, name, omega

Inherited from stereotypes.Stereotyper: model, modelChange, models

Method Details [hide private]

__init__(self, name='')
(Constructor)

source code 
Parameters:
  • name (string) - the unique ID for this model
Overrides: stereotypes.Stereotyper.__init__

setHierarchy(self, classes)

source code 

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

Parameters:

renameEntity(self, old, new)

source code 
Parameters:
  • old - the current name of the member
  • new - the new name of the member
  • old,new (str)

getParents(self)

source code 

Move up through the generic model hierarchy

Returns: str[]
the immediate parent models of this generic model

isSubclass(self, cls)

source code 
Parameters:
  • cls (str) - The class name to test on
Returns: boolean
True iff this class is a subclass (inclusive) of the named class

getAllFillers(self, attribute)

source code 
Returns: str[]
all fillers of a slot (e.g, 'state', 'action', 'goal') on this model and all superclasses

getInheritor(self, attribute, value, includeSelf=True)

source code 
Parameters:
  • attribute - the agent model slot to look for (e.g., 'state', 'action', 'goal')
  • value - the slot filler to look for (e.g., state feature)
  • includeSelf (bool) - if True, then include self in search (default is True)
  • attribute,value (str)
Returns: str
the lowest class (either this one or some ancestory) that defines the given value in the given agent attributes

deleteState(self, feature)

source code 

Removes the given feature from the state

Parameters:
  • feature (str)

ancestors(self, order=False)

source code 
Parameters:
  • order (bool) - if True, then order the results from general to specific (default is False)
Returns: str[]
all ancestor classes of this class, including itself

getRelationships(self)

source code 
Returns: str[]
all the relationships available to this generic model (including those to its superclasses

__xml__(self, doc=None)

source code 

Returns an XML Document representing this model

Overrides: stereotypes.Stereotyper.__xml__

parse(self, element)

source code 

Extracts model elements from the provided XML element

Parameters:
  • element (Element)
Overrides: stereotypes.Stereotyper.parse