Class AbstractOrganism

java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.ga.impl.AbstractOrganism
All Implemented Interfaces:
Changeable, Organism
Direct Known Subclasses:
SimpleOrganism

public abstract class AbstractOrganism extends AbstractChangeable implements Organism
Abstract implementation of Organism. Most implementations would want to inherit from here.
Since:
1.5
Version:
1.0
Author:
Mark Schreiber
  • Field Details

  • Constructor Details

  • Method Details

    • getChromosomes

      public final SymbolList[] getChromosomes()
      Description copied from interface: Organism
      Gets the organisms 'chromosome' sequences
      Specified by:
      getChromosomes in interface Organism
      Returns:
      a SymbolList[]
    • getFitness

      public final double[] getFitness()
      Description copied from interface: Organism
      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.
      Specified by:
      getFitness in interface Organism
      Returns:
      the fitness of the organism
    • getName

      public String getName()
      Description copied from interface: Organism
      Gets the organisms name
      Specified by:
      getName in interface Organism
      Returns:
      the name String
    • isHaploid

      public abstract boolean isHaploid()
      Description copied from interface: Organism
      Is the organism Haploid?
      Specified by:
      isHaploid in interface Organism
      Returns:
      true if it is.
    • setChromImpl

      protected abstract void setChromImpl(SymbolList[] chromosomes)
    • setChromosomes

      public final void setChromosomes(SymbolList[] chromosomes) throws ChangeVetoException
      Description copied from interface: Organism
      Sets the organisms 'chromosome' sequences.
      Specified by:
      setChromosomes in interface Organism
      Parameters:
      chromosomes - a SymbolList[]
      Throws:
      ChangeVetoException - if the Chromosome collection of the Organism is unchangable
    • setFitness

      public final void setFitness(double[] fitness)
      Description copied from interface: Organism
      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.
      Specified by:
      setFitness in interface Organism
      Parameters:
      fitness -
    • setName

      public final void setName(String name) throws ChangeVetoException
      Description copied from interface: Organism
      Sets the organisms name
      Specified by:
      setName in interface Organism
      Parameters:
      name - the name of the organism.
      Throws:
      ChangeVetoException - if the name may not be changed.