art.ga
Class Genome

java.lang.Object
  extended byart.ga.Genome

public class Genome
extends java.lang.Object

This class manage the Genomes composing each Chromosome. The genome represent a rule of the solution. Each genome is composed by many Gene.

Author:
Gigi Ferraris & Marco Lamieri

Constructor Summary
Genome(GaConfiguration configuration, int family, Chromosome chromosome)
          Constructor of the class.
 
Method Summary
 Gene[] getBody()
          Get the genes composing the Genome.
 int getDomain()
          It specify the domain (alphabet) used by the ga.
 Gene getGene(int position)
          Get a specific Gene at a given position of the Genome.
 int getLength()
          Get the number of Genes in the Genome
 double getMutationRate()
           
 int getType()
          Not implemented
 java.util.Set getUnivocalGenomeSet()
          The unsorted list of genes used for operations on univocal genomes.
 void print(boolean printDetails)
          Print Genome's information.
 void setBody(Gene[] aGene)
          Define the Genes composing the Genome.
 void setRandomBody()
          Initialize the Genome with random Genes.
 void setUnivocalBody()
          Initialize the Genome with univocal Genes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Genome

public Genome(GaConfiguration configuration,
              int family,
              Chromosome chromosome)
Constructor of the class.

Parameters:
configuration - Configuration file from which get parameters
family - Family of the genome
chromosome - Chromosome the Genome belongs to.
Method Detail

getBody

public Gene[] getBody()
Get the genes composing the Genome.

Returns:
Gene composing the genome.

getDomain

public int getDomain()
It specify the domain (alphabet) used by the ga. The domain is the number of states in witch a gene can be. The valid values start from 0 to domain-1. It is something like the alphabet used by the genes. Usually a standard ga has a binary alphabet, than the domain will be 2 (that means 2 possible modes: 0 and 1).

Returns:
domain

getGene

public Gene getGene(int position)
Get a specific Gene at a given position of the Genome.

Returns:
Requested Gene

getLength

public int getLength()
Get the number of Genes in the Genome

Returns:
Number of Genes

getType

public int getType()
Not implemented

Returns:
Univocal or random

print

public void print(boolean printDetails)
Print Genome's information.

Parameters:
printDetails - Option if print some Gene's information.

setBody

public void setBody(Gene[] aGene)
Define the Genes composing the Genome.

Parameters:
aGene - Body of the Genome

setRandomBody

public void setRandomBody()
Initialize the Genome with random Genes.


setUnivocalBody

public void setUnivocalBody()
Initialize the Genome with univocal Genes.


getUnivocalGenomeSet

public java.util.Set getUnivocalGenomeSet()
The unsorted list of genes used for operations on univocal genomes.

Returns:
Returns the univocalGenomeSet.

getMutationRate

public double getMutationRate()
Returns:
Returns the myMutationRate.