Evolife
Evolife has been developed to study Genetic algorithms, Natural evolution and behavioural ecology.
Public Member Functions | Public Attributes | List of all members
Evolife.Ecology.Group.Group Class Reference

A group is mainly a list of individuals. More...

Inheritance diagram for Evolife.Ecology.Group.Group:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, Scenario, ID=1, Size=100)
 
def free_ID (self, Prefix=None)
 returns an available ID More...
 
def createIndividual (self, ID=None, Newborn=True)
 Calls the 'Individual' class. More...
 
def whoIs (self, Number)
 Returns the Numberth individual. More...
 
def isMember (self, indiv)
 
def update_ (self, flagRanking=False, display=False)
 updates various facts about the group More...
 
def statistics (self)
 Updates various statistics about the group. More...
 
def positions (self)
 lists agents' locations More...
 
def season (self, year)
 This function is called at the beginning of each year. More...
 
def kill (self, memberNbr)
 suppress one specified individual of the group More...
 
def remove_ (self, memberNbr)
 tells a member it should die and then removes it from the group More...
 
def remove_member (self, indiv)
 calls 'remove_' with indiv's index in the group More...
 
def extract (self, indiv)
 synonymous to 'remove_member' More...
 
def receive (self, newcomer)
 insert a new member in the group More...
 
def __len__ (self)
 
def __iter__ (self)
 

Public Attributes

 Scenario
 
 size
 
 members
 
 ranking
 
 best_score
 
 ID
 
 location
 
 Examiner
 

Detailed Description

A group is mainly a list of individuals.

Definition at line 37 of file Group.py.

Constructor & Destructor Documentation

◆ __init__()

def Evolife.Ecology.Group.Group.__init__ (   self,
  Scenario,
  ID = 1,
  Size = 100 
)

Definition at line 40 of file Group.py.

Member Function Documentation

◆ __iter__()

def Evolife.Ecology.Group.Group.__iter__ (   self)

Definition at line 152 of file Group.py.

◆ __len__()

def Evolife.Ecology.Group.Group.__len__ (   self)

Definition at line 150 of file Group.py.

◆ createIndividual()

def Evolife.Ecology.Group.Group.createIndividual (   self,
  ID = None,
  Newborn = True 
)

Calls the 'Individual' class.

Reimplemented in Evolife.Scenarii.CustomScenario.Group, and Evolife.Ecology.Group.EvolifeGroup.

Definition at line 66 of file Group.py.

◆ extract()

def Evolife.Ecology.Group.Group.extract (   self,
  indiv 
)

synonymous to 'remove_member'

Definition at line 138 of file Group.py.

◆ free_ID()

def Evolife.Ecology.Group.Group.free_ID (   self,
  Prefix = None 
)

returns an available ID

Definition at line 56 of file Group.py.

◆ isMember()

def Evolife.Ecology.Group.Group.isMember (   self,
  indiv 
)

Definition at line 77 of file Group.py.

◆ kill()

def Evolife.Ecology.Group.Group.kill (   self,
  memberNbr 
)

suppress one specified individual of the group

Reimplemented in Evolife.Ecology.Group.EvolifeGroup.

Definition at line 119 of file Group.py.

◆ positions()

def Evolife.Ecology.Group.Group.positions (   self)

lists agents' locations

Definition at line 108 of file Group.py.

◆ receive()

def Evolife.Ecology.Group.Group.receive (   self,
  newcomer 
)

insert a new member in the group

Definition at line 143 of file Group.py.

◆ remove_()

def Evolife.Ecology.Group.Group.remove_ (   self,
  memberNbr 
)

tells a member it should die and then removes it from the group

Reimplemented in Evolife.Ecology.Group.EvolifeGroup.

Definition at line 125 of file Group.py.

◆ remove_member()

def Evolife.Ecology.Group.Group.remove_member (   self,
  indiv 
)

calls 'remove_' with indiv's index in the group

Definition at line 133 of file Group.py.

◆ season()

def Evolife.Ecology.Group.Group.season (   self,
  year 
)

This function is called at the beginning of each year.

Individuals get older each year

Reimplemented in Evolife.Ecology.Group.EvolifeGroup.

Definition at line 113 of file Group.py.

◆ statistics()

def Evolife.Ecology.Group.Group.statistics (   self)

Updates various statistics about the group.

Calls 'observation' for each member

Definition at line 98 of file Group.py.

◆ update_()

def Evolife.Ecology.Group.Group.update_ (   self,
  flagRanking = False,
  display = False 
)

updates various facts about the group

Reimplemented in Evolife.Ecology.Group.EvolifeGroup.

Definition at line 79 of file Group.py.

◆ whoIs()

def Evolife.Ecology.Group.Group.whoIs (   self,
  Number 
)

Returns the Numberth individual.

Definition at line 71 of file Group.py.

Member Data Documentation

◆ best_score

Evolife.Ecology.Group.Group.best_score

Definition at line 46 of file Group.py.

◆ Examiner

Evolife.Ecology.Group.Group.Examiner

Definition at line 49 of file Group.py.

◆ ID

Evolife.Ecology.Group.Group.ID

Definition at line 47 of file Group.py.

◆ location

Evolife.Ecology.Group.Group.location

Definition at line 48 of file Group.py.

◆ members

Evolife.Ecology.Group.Group.members

Definition at line 43 of file Group.py.

◆ ranking

Evolife.Ecology.Group.Group.ranking

Definition at line 45 of file Group.py.

◆ Scenario

Evolife.Ecology.Group.Group.Scenario

Definition at line 41 of file Group.py.

◆ size

Evolife.Ecology.Group.Group.size

Definition at line 42 of file Group.py.


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