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

Individual + genome + phenome + social links. More...

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

Public Member Functions

def __init__ (self, Scenario, ID=None, Newborn=True, MaxFriends=0)
 Merely calls parent classes' constructors. More...
 
def observation (self, GroupExaminer)
 stores genome, phenome, social links and location into GroupExaminer More...
 
def dies (self)
 Action to be performed when dying
More...
 
- Public Member Functions inherited from Evolife.Ecology.Individual.Individual
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 Member Functions inherited from Evolife.Genetics.Genome.Genome
def __init__ (self, Scenario)
 
def update (self)
 gene values are read from DNA and stored in Genes More...
 
def gene_value (self, name)
 absolute intensity addressed trough name More...
 
def gene_relative_value (self, name)
 relative intensity (between 0 and 100) addressed through name More...
 
def locus_value (self, locus)
 absolute intensity addressed trough locus More...
 
def locus_relative_value (self, locus)
 relative intensity (between 0 and 100) addressed through locus More...
 
def signature (self)
 returns all gene relative values - useful for statistics and display More...
 
- Public Member Functions inherited from Evolife.Genetics.DNA.DNA
def __init__ (self, Scenario, Nb_nucleotides)
 
def DNAfill (self, Nucleotides)
 fills the DNA with given Nucleotides More...
 
def hybrid (self, mother, father, number_crossover=-1)
 builds the child's DNA from the parents' DNA More...
 
def mutate (self, mutation_rate=-1)
 computing the expected number of mutations More...
 
- Public Member Functions inherited from Evolife.Ecology.Phenotype.Phenome
def __init__ (self, Scenario, FlagRandom=True)
 creates a dictionary of Phenes as defined by Scenario.phenemap() More...
 
def Phene_value (self, name, Value=None, Levelling=False)
 reads or sets the value of a phene More...
 
def Phene_relative_value (self, name)
 returns a Phene's value between 0 and 100 More...
 
def signature (self)
 returns phene values as a list of relative values More...
 
- Public Member Functions inherited from Evolife.Social.Alliances.Follower
def __init__ (self, MaxGurus, MaxFollowers=0)
 calls the Friend constructor for followees. More...
 
def F_affiliable (self, perf, Guru, G_perf, conservative=True)
 Checks whether affiliation is possible by checking acceptance both in friends and in followers. More...
 
def F_follow (self, perf, G, G_perf, conservative=True)
 the individual wants to be G's disciple because of some of G's performance G may evaluate the individual's performance too More...
 
def G_quit_ (self, Guru)
 the individual no longer follows its guru More...
 
def F_quit_ (self, Follower)
 the individual does not want its disciple any longer More...
 
def get_friend (self, Offer, Partner, PartnerOffer)
 Checks mutual acceptance and then establishes friendship. More...
 
def end_friendship (self, Partner)
 Partners remove each other from their address book. More...
 
def nbFollowers (self)
 
def follower_rank (self, Friend)
 Returns Friend's rank among self's followers. More...
 
def forgetAll (self)
 calls 'detach' for self's followers and then for self. More...
 
def detach (self)
 The individual quits its guru and quits its followers. More...
 
def consistency (self)
 checks social links consistency (self belongs to the followers of its followees) More...
 
- Public Member Functions inherited from Evolife.Social.Alliances.Friend
def __init__ (self, MaxFriends=1)
 Defines Friend as a club. More...
 
def accepts (self, F_perf)
 asymmetrical links # More...
 
def affiliable (self, F_perf, conservative=True)
 Checks whether affiliation is possible. More...
 
def follow (self, F, F_perf, conservative=True, Quit=None)
 the individual wants to be F's disciple due to F's performance More...
 
def follows (self, Friend)
 checks whether Friend belongs to actual friends More...
 
def quit_ (self, Friend=None)
 the individual no longer follows its friend More...
 
def best_friend (self)
 
def Max (self)
 
def Friends (self, ordered=True)
 returns a list of friend names (possibly ordered by decreasing performance) More...
 
def names (self)
 returns the list of friends' names More...
 
def rank (self, Friend)
 returns the rank of Friend in the list of decreasing performances More...
 
def nbFriends (self)
 Number of friends. More...
 
def size (self)
 Number of friends. More...
 
def sizeMax (self)
 
def lessening_friendship (self, Factor=0.9)
 all performances are reduced (represents temporal erosion) More...
 
def checkNetwork (self, membershipFunction=None)
 updates links by forgetting friends that are gone More...
 
def detach (self)
 The individual quits all its friends
More...
 
def acquaintable (self, Offer, Partner, PartnerOffer)
 symmetrical links # More...
 
def get_friend (self, Offer, Partner, PartnerOffer)
 Checks mutual acceptance and then establishes friendship. More...
 
def acquainted (self, Partner)
 same as get_friend/3 with no performance More...
 
def end_friendship (self, Partner)
 Partners remove each other from their address book. More...
 
def forgetAll (self)
 The individual quits its friends
More...
 
def __iter__ (self)
 
def __len__ (self)
 
def social_signature (self)
 returns the ordered list of friends More...
 
def signature (self)
 same as social_signature More...
 

Additional Inherited Members

- Public Attributes inherited from Evolife.Ecology.Individual.Individual
 Scenario
 
 age
 
 ID
 
 location
 
 LifePoints
 
- Public Attributes inherited from Evolife.Genetics.Genome.Genome
 Scenario
 
 genome
 
- Public Attributes inherited from Evolife.Genetics.DNA.DNA
 Scenario
 
 nb_nucleotides
 
- Public Attributes inherited from Evolife.Ecology.Phenotype.Phenome
 Scenario
 
 Phenes
 
- Public Attributes inherited from Evolife.Social.Alliances.Follower
 followers
 
- Public Attributes inherited from Evolife.Social.Alliances.Friend
 friends
 

Detailed Description

Individual + genome + phenome + social links.

Definition at line 110 of file Individual.py.

Constructor & Destructor Documentation

◆ __init__()

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

Merely calls parent classes' constructors.

Reimplemented from Evolife.Ecology.Individual.Individual.

Definition at line 113 of file Individual.py.

Member Function Documentation

◆ dies()

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

Action to be performed when dying

Reimplemented from Evolife.Ecology.Individual.Individual.

Definition at line 135 of file Individual.py.

◆ observation()

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

stores genome, phenome, social links and location into GroupExaminer

Reimplemented from Evolife.Ecology.Individual.Individual.

Definition at line 125 of file Individual.py.


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