org.aisb.bio.things.evolution
Class Mutator

java.lang.Object
  extended byorg.aisb.bio.things.evolution.Mutator

public class Mutator
extends java.lang.Object

Turn one nucleotide into another, maybe.

This implements a very simple Jukes-Cantor model of mutation. Configure it with a mutation rate. Feed in a nucleotide. If there's no mutation, you'll get the same nucleotide out. If there's a mutaiton, you'll get a different nucleotide, with each possibility having equal odds.

Author:
Doug DeJulio

Constructor Summary
Mutator(double probability)
           
 
Method Summary
 double getMu()
           
 Monomer mutate(Monomer oldNucleotide)
          Perform the mutation.
 void setMu(double mu)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mutator

public Mutator(double probability)
Method Detail

mutate

public Monomer mutate(Monomer oldNucleotide)
Perform the mutation.

Parameters:
oldNucleotide - The nucleotide to (perhaps) be mutated.
Returns:
The resulting nucleotide.

getMu

public double getMu()
Returns:
Returns the mutation probability.

setMu

public void setMu(double mu)
Parameters:
mu - The mutation probability to set.