com.rubecula.darwin.domain.world
Class Expresser_Mendelian

java.lang.Object
  extended by com.rubecula.darwin.domain.environment.Expresser_
      extended by com.rubecula.darwin.domain.world.Expresser_Mendelian
All Implemented Interfaces:
Expresser
Direct Known Subclasses:
Expresser_Sex

public class Expresser_Mendelian
extends Expresser_

Lifespan: permanent. This class implements Expresser and models a simple Mendelian gene expression. By simple, we mean that there is a one-to-one correspondence between genes and their resulting traits. Genes and traits may be dominant or recessive. For this simple implementation of Expresser, there must be exactly two alleles in the locus of any gene to be expressed AND there must be exactly two variants in the character. Furthermore, the genes must be passed in to the express() method, one at a time. For more complex expression models, it is necessary to extend Expresser_, although it is also possible to extend this class. This type is named, obviously, for Gregor Mendel, the father of genetics.

Author:
Robin Hillyard

Field Summary
protected  java.lang.String _dominantAllele
           
protected  java.lang.String _dominantVariant
           
 
Fields inherited from class com.rubecula.darwin.domain.environment.Expresser_
_character, LOG
 
Constructor Summary
Expresser_Mendelian(Pharacter character, java.lang.String domAllele, java.lang.String domVariant)
           
 
Method Summary
 Trait express(Gene... genes)
          Express (one) gene passed in [Note this class cannot handle calls to this method with multiple genes].
protected  Trait expressDiploid(Gene gene)
           
protected  Trait expressHaploid(Gene gene)
           
 
Methods inherited from class com.rubecula.darwin.domain.environment.Expresser_
createTrait, createTrait, createTrait, createTrait, equals, express, getCharacter, getComplement, hashCode, isComplementary
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dominantAllele

protected final java.lang.String _dominantAllele

_dominantVariant

protected final java.lang.String _dominantVariant
Constructor Detail

Expresser_Mendelian

public Expresser_Mendelian(Pharacter character,
                           java.lang.String domAllele,
                           java.lang.String domVariant)
Parameters:
character - the phenotypic character
domAllele - the key of the dominant allele
domVariant - the key of the dominant variant
Method Detail

express

public Trait express(Gene... genes)
Express (one) gene passed in [Note this class cannot handle calls to this method with multiple genes].

Parameters:
genes - the gene locus which we are trying to express.
Returns:
the expressed trait
See Also:
Expresser.express(Colony, Gene[])

expressDiploid

protected Trait expressDiploid(Gene gene)
Parameters:
gene -
Returns:
the trait expressed by the gene.

expressHaploid

protected Trait expressHaploid(Gene gene)
Parameters:
gene - XXX
Returns:
if all is OK, then we return a trait but this particular implementation always throws...
Throws:
DarwinException - TEST


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