DSIMA
 All Classes Namespaces Files Functions Variables
Layer Class Reference

Layer of the system. More...

Public Member Functions

def __init__
 Default constructor. More...
 
def act
 Perform the action of all agents in the layer. More...
 
def addAgent
 Add an agent to the agent list. More...
 
def agentList
 Get the list of agents in the layer. More...
 
def id
 Get the layer's id. More...
 
def removeAgent
 Remove an agent from the agent list. More...
 
def rename
 Rename the layer. More...
 
def __str__
 

Public Attributes

 name
 Layer name. More...
 

Private Attributes

 _agentList
 
 _id
 Unique identifier of the layer. More...
 

Static Private Attributes

int _layersNumber = 0
 Total number of layers. More...
 

Detailed Description

Layer of the system.

List the agents belonging to one layer.

Constructor & Destructor Documentation

def __init__ (   self,
  agentList = [],
  name = "" 
)

Default constructor.

Parameters
agentListInitial list of agents in the layer.
nameName of the layer.

Member Function Documentation

def __str__ (   self)
def act (   self,
  data 
)

Perform the action of all agents in the layer.

The data are modified by the actions of the agent.

Parameters
dataData needed for the action.
def addAgent (   self,
  agent 
)

Add an agent to the agent list.

Parameters
agentAgent to add.
def agentList (   self)

Get the list of agents in the layer.

Returns
List of agents
def id (   self)

Get the layer's id.

def removeAgent (   self,
  agent 
)

Remove an agent from the agent list.

Parameters
agentAgent to add.
def rename (   self,
  name = "" 
)

Rename the layer.

Parameters
nameNew name. If an empty name is given the new name is "Layer #id".

Member Data Documentation

_agentList
private
_id
private

Unique identifier of the layer.

int _layersNumber = 0
staticprivate

Total number of layers.

name

Layer name.


The documentation for this class was generated from the following file: