art.ga
Class Gene

java.lang.Object
  extended byart.ga.Gene

public class Gene
extends java.lang.Object

This class manage the genes. Each gene contain a number in the domain defined by his alphabet.

Author:
Marco Lamieri and Gianluigi Ferraris

Constructor Summary
Gene(GaConfiguration configuration, int family, Genome genome)
          Constructor of the class.
 
Method Summary
 int getAllele()
          Get the allele, the genetic information embedded in this Gene
 Genome getMyGenome()
          Get the Genome this Gene is belonging to.
 void initializeRandom()
          Initialize this Gene with a random allele valid in its domain.
 void initializeRandomForCs(double wildcardRate)
          Initialize this Gene with a random allele valid in its domain.
 void mutateRandom()
          This method generate a mutation to the gene.
 void mutateUnivocal()
          This method generate a mutation to the gene when univocal genomes are used.
 void print()
          Print Gene information.
 boolean setAllele(int value)
          This method set the allele of the gene to a given integer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gene

public Gene(GaConfiguration configuration,
            int family,
            Genome genome)
Constructor of the class.

Parameters:
configuration - Configuration from which get parameters
family - Family of the Gene
genome - Genome that this Gene is belonging to
Method Detail

getAllele

public int getAllele()
Get the allele, the genetic information embedded in this Gene

Returns:
Allele

getMyGenome

public Genome getMyGenome()
Get the Genome this Gene is belonging to.

Returns:
Belonging Genome

initializeRandom

public void initializeRandom()
Initialize this Gene with a random allele valid in its domain.


initializeRandomForCs

public void initializeRandomForCs(double wildcardRate)
Initialize this Gene with a random allele valid in its domain.


mutateRandom

public void mutateRandom()
This method generate a mutation to the gene. If a binary alphabet is the allele switch between 0 and 1 or vice versa. With a improved alphabet it move from the original value to a random value in its domain excluded the original value.

See Also:
Events.mutate(Population)

mutateUnivocal

public void mutateUnivocal()
This method generate a mutation to the gene when univocal genomes are used.

See Also:
Events.mutate(Population)

print

public void print()
Print Gene information.


setAllele

public boolean setAllele(int value)
This method set the allele of the gene to a given integer. The range of validity of the allele (domain) is defined by the alphabet.

Parameters:
value -