Package teamwork :: Package multiagent :: Module Multiagent :: Class MultiagentSystem
[hide private]
[frames] | no frames]

Class MultiagentSystem

source code

object --+    
         |    
      dict --+
             |
            MultiagentSystem
Known Subclasses:

Base class for a generic collection of agents

Instance Methods [hide private]
new empty dictionary

__init__(self, agents=[])
Initializes a collection to contain the given list of agents
source code
 
initialize(self)
Do any necessary preparation before doing whatever
source code
teamwork.agent.Agent[]
members(self)
Returns: a list of the member agents, in decreasing order according to whatever comparison function has been defined on the agent class
source code
 
addMember(self, agent)
Adds the agent to this collection
source code
 
getMember(self, agent)
Returns: the member agent contained in this team that corresponds to the specified agent object or string name
source code
 
save(self, name)
Stores this MAS at the specified file location.
source code
 
__str__(self)
str(x)
source code
 
__xml__(self) source code
 
parse(self, element, agentClass=None) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, agents=[])
(Constructor)

source code 

Initializes a collection to contain the given list of agents

Returns:
new empty dictionary

Overrides: object.__init__

members(self)

source code 
Returns: teamwork.agent.Agent[]
a list of the member agents, in decreasing order according to whatever comparison function has been defined on the agent class

addMember(self, agent)

source code 

Adds the agent to this collection

Parameters:

Warning: will clobber any pre-existing agent with the same name

getMember(self, agent)

source code 
Returns:
the member agent contained in this team that corresponds to the specified agent object or string name

Warning: Deprecated, use self[name] instead

save(self, name)

source code 

Stores this MAS at the specified file location. The storage format is based on the file extension:

  • xml: Store in PsychSim's XML format
  • scn: compressed XML (default)
Parameters:
  • name (str) - the string filename

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)