|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aisb.bio.things.evolution.AsexualOrganism
This is an "organism" for the purpose of running evolutionary experiments.
There's a Sequence
representing the "genotype",
and a unitless floating point number representing how much time until the
organisim reproduces. There's also an integer value representing "fitness".
For convenience, there's also a floating point number representing "birthday", so we can fit the organism's entire lifespan into a timeline if we wish.
There's also a "parent" of type AsexualOrganism
, so
we can trace the organism's family tree if we wish.
Constructor Summary | |
AsexualOrganism()
|
Method Summary | |
double |
getBirthday()
|
int |
getFitness()
|
Sequence |
getGenotype()
|
Mutator |
getMutator()
|
AsexualOrganism |
getParent()
|
double |
getTimeToReproduce()
|
AsexualOrganism |
haveMutantBaby(double now)
Create a new AsexualOrganism with a specified birthday. |
void |
loadFromFile(java.io.File file)
Load the organism's gene sequence from a file. |
void |
loadFromFile(java.lang.String fileName)
Load the organism's gene sequence from a file. |
void |
setBirthday(double birthday)
|
void |
setFitness(int fitness)
|
void |
setGenotype(Sequence genotype)
|
void |
setMutator(Mutator mutator)
|
void |
setParent(AsexualOrganism parent)
|
void |
setTimeToReproduce(double timeToReproduce)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AsexualOrganism()
Method Detail |
public double getBirthday()
public void setBirthday(double birthday)
birthday
- The birthday to set.public int getFitness()
public void setFitness(int fitness)
fitness
- The fitness to set.public Sequence getGenotype()
public void setGenotype(Sequence genotype)
genotype
- The genotype to set.public double getTimeToReproduce()
public void setTimeToReproduce(double timeToReproduce)
timeToReproduce
- The timeToReproduce to set.public AsexualOrganism getParent()
public void setParent(AsexualOrganism parent)
parent
- The parent to set.public AsexualOrganism haveMutantBaby(double now)
Create a new AsexualOrganism
with a specified birthday. The offspring
will be mutated as per the mutator assigned to the parent, and will inherit that
mutator.
To simulate the budding of an organism, keep the parent around and call this method once. To simulate cell division, call this method twice on the parent and then throw the parent away.
now
- The offspring's "birthday".
public void loadFromFile(java.io.File file) throws java.io.IOException
file
- A file containing exactly one line consisting only of nucleotide code letters.
java.io.IOException
public void loadFromFile(java.lang.String fileName) throws java.io.IOException
fileName
- The name of a file containing exactly one line consisting only of nucleotide code letters.
java.io.IOException
public Mutator getMutator()
public void setMutator(Mutator mutator)
mutator
- The mutator to use.public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |