com.rubecula.darwin.domain.genetics
Class Mating_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.genetics.Mating_
All Implemented Interfaces:
Mating, net.sf.tostring0.IToString
Direct Known Subclasses:
Mating_Haldanian

public abstract class Mating_
extends net.sf.tostring0.AToString
implements Mating

Abstract class to define base methods for implementers of Mating.

Author:
Robin Hillyard

Field Summary
protected  java.lang.String _ColonyId
          The tag of the population to which the mother and father belong.
protected  Nuclear _Female
          The female mate (mother-to-be).
protected  Nuclear _Male
          The male mate (father-to-be).
protected  org.apache.commons.math.random.RandomGenerator _Random
          The randomizer.
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 Mating_(Nuclear parent1, Nuclear parent2, org.apache.commons.math.random.RandomGenerator random, Genomic genomic)
          Protected primary constructor for a new instance of Mating_.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 Nuclear progeny()
          Each of the parents in this Mating object produce a gamete.
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

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


_Female

protected final Nuclear _Female
The female mate (mother-to-be).


_Male

protected final Nuclear _Male
The male mate (father-to-be).


_ColonyId

protected final java.lang.String _ColonyId
The tag of the population to which the mother and father belong.


_Random

protected final org.apache.commons.math.random.RandomGenerator _Random
The randomizer.

Constructor Detail

Mating_

protected Mating_(Nuclear parent1,
                  Nuclear parent2,
                  org.apache.commons.math.random.RandomGenerator random,
                  Genomic genomic)
Protected primary constructor for a new instance of Mating_.

Parameters:
parent1 - the father-to-be.
parent2 - the mother-to-be.
random - the random number generator to be used
genomic - the genomic of the resulting progeny
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

progeny

public Nuclear progeny()
Each of the parents in this Mating object produce a gamete. These gametes are then combined using the class method NuclearFactory.makeZygote(Genome, String) and the result becomes the genome for the progeny. The sex of the progeny is chosen randomly. Finally, the _Female's birth method is invoked to produce a new Organism_Sexual which is then returned.

Specified by:
progeny in interface Mating
Returns:
a new organism, formed by combining the genomes of the gametes spawned from the male and the female.
See Also:
Mating.progeny()


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