Package org.biojavax.ga
Interface Organism
- All Superinterfaces:
Changeable
- All Known Implementing Classes:
AbstractOrganism
,SimpleOrganism
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 -
Method Summary
Modifier and TypeMethodDescriptionGets the organisms 'chromosome' sequencesdouble[]
Returns the current fitness of this organism.getName()
Gets the organisms nameboolean
Is the organism Haploid?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
Sets the organisms nameMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
CHROMOSOMES
-
NAME
-
-
Method Details
-
setFitness
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
Gets the organisms 'chromosome' sequences- Returns:
- a
SymbolList[]
-
setChromosomes
Sets the organisms 'chromosome' sequences.- Parameters:
chromosomes
- aSymbolList[]
- Throws:
ChangeVetoException
- if the Chromosome collection of the Organism is unchangable
-
getName
Gets the organisms name- Returns:
- the name String
-
setName
Sets the organisms name- Parameters:
name
- the name of the organism.- Throws:
ChangeVetoException
- if the name may not be changed.
-
replicate
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.
-