Package org.biojavax.ga.impl
Class AbstractOrganism
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.ga.impl.AbstractOrganism
- All Implemented Interfaces:
Changeable,Organism
- Direct Known Subclasses:
SimpleOrganism
Abstract implementation of Organism. Most implementations would want to
inherit from here.
- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber
-
Field Summary
FieldsFields inherited from interface org.biojavax.ga.Organism
CHROMOSOMES, NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SymbolList[]Gets the organisms 'chromosome' sequencesfinal double[]Returns the current fitness of this organism.getName()Gets the organisms nameabstract booleanIs the organism Haploid?protected abstract voidsetChromImpl(SymbolList[] chromosomes) final voidsetChromosomes(SymbolList[] chromosomes) Sets the organisms 'chromosome' sequences.final voidsetFitness(double[] fitness) This method allows to set the fitness of this organism to the specified value.final voidSets the organisms nameMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
chromosomes
-
-
Constructor Details
-
AbstractOrganism
protected AbstractOrganism() -
AbstractOrganism
-
-
Method Details
-
getChromosomes
Description copied from interface:OrganismGets the organisms 'chromosome' sequences- Specified by:
getChromosomesin interfaceOrganism- Returns:
- a
SymbolList[]
-
getFitness
Description copied from interface:OrganismReturns 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.- Specified by:
getFitnessin interfaceOrganism- Returns:
- the fitness of the organism
-
getName
Description copied from interface:OrganismGets the organisms name -
isHaploid
Description copied from interface:OrganismIs the organism Haploid? -
setChromImpl
-
setChromosomes
Description copied from interface:OrganismSets the organisms 'chromosome' sequences.- Specified by:
setChromosomesin interfaceOrganism- Parameters:
chromosomes- aSymbolList[]- Throws:
ChangeVetoException- if the Chromosome collection of the Organism is unchangable
-
setFitness
Description copied from interface:OrganismThis 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.- Specified by:
setFitnessin interfaceOrganism
-
setName
Description copied from interface:OrganismSets the organisms name- Specified by:
setNamein interfaceOrganism- Parameters:
name- the name of the organism.- Throws:
ChangeVetoException- if the name may not be changed.
-