Package org.biojavax.ga
Interface Organism
-
- All Superinterfaces:
Changeable
- All Known Implementing Classes:
AbstractOrganism
,SimpleOrganism
public interface Organism extends Changeable
A GA 'organism' contains one or more Chromosomes- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber, Susanne Merz, Andreas Dräger
-
-
Field Summary
Fields Modifier and Type Field Description static ChangeType
CHROMOSOMES
static ChangeType
NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SymbolList[]
getChromosomes()
Gets the organisms 'chromosome' sequencesdouble[]
getFitness()
Returns the current fitness of this organism.String
getName()
Gets the organisms nameboolean
isHaploid()
Is the organism Haploid?Organism
replicate(String name)
Creates a replica of thisOrganism
with a new name.void
setChromosomes(SymbolList[] chromosomes)
Sets the organisms 'chromosome' sequences.void
setFitness(double[] fitness)
This method allows to set the fitness of this organism to the specified value.void
setName(String name)
Sets the organisms name-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Field Detail
-
CHROMOSOMES
static final ChangeType CHROMOSOMES
-
NAME
static final ChangeType NAME
-
-
Method Detail
-
setFitness
void setFitness(double[] fitness)
This method allows to set the fitness of this organism to the specified value. Generally this will be an array, which in the most cases contains just a single entry. In cases where we want to have multi-objective optimization we may want to make use of a more general fitness array with mutliple entries.- Parameters:
fitness
-
-
getFitness
double[] getFitness()
Returns the current fitness of this organism. This is an array. Note that in the most cases this array may only contain one single value, but for multi-objective optimization it is necessary to store multiple fitness values.- Returns:
- the fitness of the organism
-
getChromosomes
SymbolList[] getChromosomes()
Gets the organisms 'chromosome' sequences- Returns:
- a
SymbolList[]
-
setChromosomes
void setChromosomes(SymbolList[] chromosomes) throws ChangeVetoException
Sets the organisms 'chromosome' sequences.- Parameters:
chromosomes
- aSymbolList[]
- Throws:
ChangeVetoException
- if the Chromosome collection of the Organism is unchangable
-
setName
void setName(String name) throws ChangeVetoException
Sets the organisms name- Parameters:
name
- the name of the organism.- Throws:
ChangeVetoException
- if the name may not be changed.
-
replicate
Organism replicate(String name)
Creates a replica of thisOrganism
with a new name.- Parameters:
name
- the new name for the sequence.- Returns:
- the replicated organism.
-
isHaploid
boolean isHaploid()
Is the organism Haploid?- Returns:
- true if it is.
-
-