com.rubecula.darwin.domain.world
Class Expresser_Mendelian
java.lang.Object
com.rubecula.darwin.domain.environment.Expresser_
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
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
_dominantAllele
protected final java.lang.String _dominantAllele
_dominantVariant
protected final java.lang.String _dominantVariant
Expresser_Mendelian
public Expresser_Mendelian(Pharacter character,
java.lang.String domAllele,
java.lang.String domVariant)
- Parameters:
character
- the phenotypic characterdomAllele
- the key of the dominant alleledomVariant
- the key of the dominant variant
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.