com.rubecula.darwin.domain.genetics
Class Meiosis_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.genetics.Meiosis_
All Implemented Interfaces:
Meiosis, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString
Direct Known Subclasses:
Meiosis_Chromosome, Meiosis_Clone, Meiosis_Locus

public abstract class Meiosis_
extends net.sf.tostring0.AToString
implements Meiosis

Abstract class which defines the base operations for an implementation of Meiosis.

Author:
Robin Hillyard

Field Summary
protected static org.apache.commons.logging.Log LOG
          The logger for this class.
 
Fields inherited from interface net.sf.tostring0.IToString
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE
 
Constructor Summary
protected Meiosis_(org.apache.commons.math.random.RandomGenerator random)
          Protected constructor for an implementer of Meiosis
 
Method Summary
 java.lang.String doMeiosis(Gene gene, int index)
          Choose an allele at random for the given locus.
protected  Genome doMeiosisChromosome(Genomic genomic, Genes genes, Chromosome chromosome, int index)
           
 java.lang.String getIdentifier()
          Return the class's simple name (since these are normally singleton instances we don't really need to distinguish them).
protected  org.apache.commons.math.random.RandomGenerator getRandom()
           
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Meiosis
doMeiosis
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
The logger for this class.

Constructor Detail

Meiosis_

protected Meiosis_(org.apache.commons.math.random.RandomGenerator random)
Protected constructor for an implementer of Meiosis

Parameters:
random - a random number source.
Method Detail

doMeiosis

public java.lang.String doMeiosis(Gene gene,
                                  int index)
Choose an allele at random for the given locus.

Specified by:
doMeiosis in interface Meiosis
Parameters:
gene - the gene on which we are doing the meiosis.
index - if index >=0 then we use it, otherwise we generate a random number between 0 and the gene's ploidy less one.
Returns:
the key of the allele chosen.

getIdentifier

public java.lang.String getIdentifier()
Return the class's simple name (since these are normally singleton instances we don't really need to distinguish them).

Specified by:
getIdentifier in interface net.sf.tostring0.Identifiable
See Also:
Identifiable.getIdentifier()

doMeiosisChromosome

protected Genome doMeiosisChromosome(Genomic genomic,
                                     Genes genes,
                                     Chromosome chromosome,
                                     int index)
Parameters:
genomic -
genes -
chromosome -
index - the index to use to choose the allele for a given gene (if < 0 then we use a random number)
Returns:
a newly constructed Genome

getRandom

protected org.apache.commons.math.random.RandomGenerator getRandom()
Returns:
the random number generator


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.