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.Individual.Individual Class Reference

class Individual: basic individual. More...

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

Public Member Functions

def __init__ (self, Scenario, ID=None, Newborn=True)
 
def aging (self, step=1)
 Increments the individual's age. More...
 
def accident (self, loss=1)
 The victim suffers from a loss of life points. More...
 
def dead (self)
 An individual is dead if it is too old or has lost all its 'LifePoints'. More...
 
def dies (self)
 Action to be performed when dying
More...
 
def score (self, bonus=0, FlagSet=False)
 Sets score or adds points to score, depending on FlagSet - Returns score value. More...
 
def signature (self)
 returns age and score More...
 
def observation (self, GroupExaminer)
 stores individual's signature in 'GroupExaminer' More...
 
def display (self, erase=False)
 can be used to display individuals More...
 
def __bool__ (self)
 

Public Attributes

 Scenario
 
 age
 
 ID
 
 location
 
 LifePoints
 

Detailed Description

class Individual: basic individual.

Just sets ID and age.

Definition at line 32 of file Individual.py.

Constructor & Destructor Documentation

◆ __init__()

def Evolife.Ecology.Individual.Individual.__init__ (   self,
  Scenario,
  ID = None,
  Newborn = True 
)

Reimplemented in Evolife.Ecology.Individual.EvolifeIndividual.

Definition at line 37 of file Individual.py.

Member Function Documentation

◆ __bool__()

def Evolife.Ecology.Individual.Individual.__bool__ (   self)

Definition at line 98 of file Individual.py.

◆ accident()

def Evolife.Ecology.Individual.Individual.accident (   self,
  loss = 1 
)

The victim suffers from a loss of life points.

Definition at line 58 of file Individual.py.

◆ aging()

def Evolife.Ecology.Individual.Individual.aging (   self,
  step = 1 
)

Increments the individual's age.

Definition at line 52 of file Individual.py.

◆ dead()

def Evolife.Ecology.Individual.Individual.dead (   self)

An individual is dead if it is too old or has lost all its 'LifePoints'.

Definition at line 63 of file Individual.py.

◆ dies()

def Evolife.Ecology.Individual.Individual.dies (   self)

Action to be performed when dying

Reimplemented in Evolife.Ecology.Individual.EvolifeIndividual.

Definition at line 71 of file Individual.py.

◆ display()

def Evolife.Ecology.Individual.Individual.display (   self,
  erase = False 
)

can be used to display individuals

Definition at line 93 of file Individual.py.

◆ observation()

def Evolife.Ecology.Individual.Individual.observation (   self,
  GroupExaminer 
)

stores individual's signature in 'GroupExaminer'

Reimplemented in Evolife.Ecology.Individual.EvolifeIndividual.

Definition at line 88 of file Individual.py.

◆ score()

def Evolife.Ecology.Individual.Individual.score (   self,
  bonus = 0,
  FlagSet = False 
)

Sets score or adds points to score, depending on FlagSet - Returns score value.

Definition at line 76 of file Individual.py.

◆ signature()

def Evolife.Ecology.Individual.Individual.signature (   self)

returns age and score

Definition at line 83 of file Individual.py.

Member Data Documentation

◆ age

Evolife.Ecology.Individual.Individual.age

Definition at line 42 of file Individual.py.

◆ ID

Evolife.Ecology.Individual.Individual.ID

Definition at line 45 of file Individual.py.

◆ LifePoints

Evolife.Ecology.Individual.Individual.LifePoints

Definition at line 50 of file Individual.py.

◆ location

Evolife.Ecology.Individual.Individual.location

Definition at line 48 of file Individual.py.

◆ Scenario

Evolife.Ecology.Individual.Individual.Scenario

Definition at line 38 of file Individual.py.


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