Class Mutation

Object
Mutation
Direct Known Subclasses:
Mutation.Continuous, Mutation.Discrete

public abstract class Mutation extends Object
The abstract superclass to implement mutations in IBS models with discrete or continuous traits.
Author:
Christoph Hauert
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The class to implement mutations in continuous IBS models.
    static class 
    The class to implement mutations in discrete IBS models.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) Module
    The module using this mutation.
    double
    The probability of mutations.
    double
    The range of mutations.
    protected RNGDistribution
    Convenience field: the shared random number generator to ensure reproducibility of results.
    boolean
    The flag to indicate whether mutations arise uniformly distributed (cosmic rays) or are tied to reproduction events (temperature mutations).
    Mutation type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Mutation(Module module)
    Instantiate new mutation.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    Check if a mutation arises.
    double
    mutate(double trait)
    Mutate trait trait in IBS models according to the type of mutation.
    int
    mutate(int trait)
    Mutate trait trait in IBS models according to the type of mutation.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • module

      Module module
      The module using this mutation.
    • rng

      protected RNGDistribution rng
      Convenience field: the shared random number generator to ensure reproducibility of results. Currently only used for IBS models.
      See Also:
    • type

      public CLOption.Key type
      Mutation type.
      See Also:
    • probability

      public double probability
      The probability of mutations.
    • range

      public double range
      The range of mutations.
    • temperature

      public boolean temperature
      The flag to indicate whether mutations arise uniformly distributed (cosmic rays) or are tied to reproduction events (temperature mutations).
  • Constructor Details

    • Mutation

      public Mutation(Module module)
      Instantiate new mutation.
      Parameters:
      module - the map to use as template
  • Method Details

    • doMutate

      public abstract boolean doMutate()
      Check if a mutation arises.
      Returns:
      true if a mutation should be performed
    • mutate

      public int mutate(int trait)
      Mutate trait trait in IBS models according to the type of mutation.
      Parameters:
      trait - the trait to mutate
      Returns:
      the mutated trait
      See Also:
    • mutate

      public double mutate(double trait)
      Mutate trait trait in IBS models according to the type of mutation.
      Parameters:
      trait - the trait to mutate
      Returns:
      the mutated trait
      See Also: