Evolife
Evolife has been developed to study Genetic algorithms, Natural evolution and behavioural ecology.
Classes | Functions | Variables
Evolife.Genetics.DNA Namespace Reference

Genomes in EVOLIFE are defined as a binary strings. More...

Classes

class  DNA
 class DNA: individuals' 'DNA' defined as a string of bits More...
 

Functions

def read_DNA (self, start, end, coding=None)
 reads a chunk of DNA More...
 
def hamming (self, alter)
 computes the Hamming distance between two DNA strings More...
 
def get_DNA (self)
 returns DNA as a tuple More...
 
def display (self)
 
def save (self)
 

Variables

bool NUMPY = False
 
 pos = random.randint(0, self.nb_nucleotides - 1)
 mutation_number = (mutation_rate * self.nb_nucleotides) / 1000 if randint(1,1000) < 1 + ((mutation_rate * self.nb_nucleotides) % 1000) : mutation_number += 1 performing mutations More...
 
 value = Tools.GrayTable.Gray2Int(value)
 value += self.__dna[pos]* 2 ** (end - 1 - pos) More...
 
 mother = DNA(9, Blank=False)
 
 father = DNA(9, Blank=False)
 
 child = DNA(9)
 

Detailed Description

Genomes in EVOLIFE are defined as a binary strings.

    The way the genome string is implemented (e.g. list of binary numbers
    or bits compacted into integers) should remain private to this module 

Function Documentation

◆ display()

def Evolife.Genetics.DNA.display (   self)

Definition at line 141 of file DNA.py.

◆ get_DNA()

def Evolife.Genetics.DNA.get_DNA (   self)

returns DNA as a tuple

Definition at line 130 of file DNA.py.

◆ hamming()

def Evolife.Genetics.DNA.hamming (   self,
  alter 
)

computes the Hamming distance between two DNA strings

Definition at line 122 of file DNA.py.

◆ read_DNA()

def Evolife.Genetics.DNA.read_DNA (   self,
  start,
  end,
  coding = None 
)

reads a chunk of DNA

Definition at line 96 of file DNA.py.

◆ save()

def Evolife.Genetics.DNA.save (   self)

Definition at line 144 of file DNA.py.

Variable Documentation

◆ child

Evolife.Genetics.DNA.child = DNA(9)

Definition at line 157 of file DNA.py.

◆ father

Evolife.Genetics.DNA.father = DNA(9, Blank=False)

Definition at line 154 of file DNA.py.

◆ mother

Evolife.Genetics.DNA.mother = DNA(9, Blank=False)

Definition at line 151 of file DNA.py.

◆ NUMPY

bool Evolife.Genetics.DNA.NUMPY = False

Definition at line 31 of file DNA.py.

◆ pos

Evolife.Genetics.DNA.pos = random.randint(0, self.nb_nucleotides - 1)

mutation_number = (mutation_rate * self.nb_nucleotides) / 1000 if randint(1,1000) < 1 + ((mutation_rate * self.nb_nucleotides) % 1000) : mutation_number += 1 performing mutations

Definition at line 92 of file DNA.py.

◆ value

Evolife.Genetics.DNA.value = Tools.GrayTable.Gray2Int(value)

value += self.__dna[pos]* 2 ** (end - 1 - pos)

Definition at line 117 of file DNA.py.