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

class Group: list of individuals that interact and reproduce. More...

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

Public Member Functions

def createIndividual (self, Newborn=True)
 calls the 'EvolifeIndividual' class calls 'Scenario.new_agent' More...
 
def uploadDNA (self, Start)
 loads given DNAs into individuals More...
 
def update_ (self, flagRanking=False, display=False)
 updates various facts about the group + positions More...
 
def reproduction (self)
 reproduction within the group creates individuals from couples returned by 'Scenario.couples' by calling 'hybrid' on the parents' genome and then by mutating the individual and inserting into the group More...
 
def season (self, year)
 This function is called at the beginning of each year It calls Scenario.season. More...
 
def kill (self, memberNbr)
 kills or weakens one specified individual of the group More...
 
def remove_ (self, memberNbr)
 calls Group.remove_ and also Scenario.remove_agent More...
 
def life_game (self)
 Calls Scenario.life_game. More...
 
def get_average (self)
 computes an average individual in the group More...
 
def get_best (self)
 returns the phenotype of the best or representative individual More...
 
- Public Member Functions inherited from Evolife.Ecology.Group.Group
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)
 

Additional Inherited Members

- Public Attributes inherited from Evolife.Ecology.Group.Group
 Scenario
 
 size
 
 members
 
 ranking
 
 best_score
 
 ID
 
 location
 
 Examiner
 

Detailed Description

class Group: list of individuals that interact and reproduce.

Same as Group + reproduction + calls to Scenario functions.

Definition at line 162 of file Group.py.

Member Function Documentation

◆ createIndividual()

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

calls the 'EvolifeIndividual' class calls 'Scenario.new_agent'

Reimplemented from Evolife.Ecology.Group.Group.

Reimplemented in Evolife.Scenarii.CustomScenario.Group.

Definition at line 167 of file Group.py.

◆ get_average()

def Evolife.Ecology.Group.EvolifeGroup.get_average (   self)

computes an average individual in the group

Definition at line 247 of file Group.py.

◆ get_best()

def Evolife.Ecology.Group.EvolifeGroup.get_best (   self)

returns the phenotype of the best or representative individual

Definition at line 255 of file Group.py.

◆ kill()

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

kills or weakens one specified individual of the group

Reimplemented from Evolife.Ecology.Group.Group.

Definition at line 224 of file Group.py.

◆ life_game()

def Evolife.Ecology.Group.EvolifeGroup.life_game (   self)

Calls Scenario.life_game.

Definition at line 240 of file Group.py.

◆ remove_()

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

calls Group.remove_ and also Scenario.remove_agent

Reimplemented from Evolife.Ecology.Group.Group.

Definition at line 233 of file Group.py.

◆ reproduction()

def Evolife.Ecology.Group.EvolifeGroup.reproduction (   self)

reproduction within the group creates individuals from couples returned by 'Scenario.couples' by calling 'hybrid' on the parents' genome and then by mutating the individual and inserting into the group

Definition at line 197 of file Group.py.

◆ season()

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

This function is called at the beginning of each year It calls Scenario.season.

Reimplemented from Evolife.Ecology.Group.Group.

Definition at line 217 of file Group.py.

◆ update_()

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

updates various facts about the group + positions

Reimplemented from Evolife.Ecology.Group.Group.

Definition at line 186 of file Group.py.

◆ uploadDNA()

def Evolife.Ecology.Group.EvolifeGroup.uploadDNA (   self,
  Start 
)

loads given DNAs into individuals

Definition at line 177 of file Group.py.


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