Interface IGenomeBuilder


public interface IGenomeBuilder
Used to create a genome.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    default void
    set(IBooleanChromosome chromosome, boolean defaultAllele)
    Shortcut for setting dominant true/false alleles.
    <A extends IAllele>
    void
    set(IChromosome<A> chromosome, A allele)
    Sets both the active and inactive allele for the chromosome in this genome.
    <A extends IAllele>
    void
    setActive(IChromosome<A> chromosome, A allele)
    Sets the active allele for the chromosome in this genome.
    <A extends IAllele>
    void
    setInactive(IChromosome<A> chromosome, A allele)
    Sets the inactive (non-expressed) allele for the chromosome in this genome.
    void
    Sets the remaining alleles in this chromosome to their defaults as specified by this genome's karyotype.
    default void
    setUnchecked(IChromosome chromosome, AllelePair allele)
     
  • Method Details

    • set

      default void set(IBooleanChromosome chromosome, boolean defaultAllele)
      Shortcut for setting dominant true/false alleles.
    • setUnchecked

      default void setUnchecked(IChromosome chromosome, AllelePair allele)
    • set

      <A extends IAllele> void set(IChromosome<A> chromosome, A allele)
      Sets both the active and inactive allele for the chromosome in this genome.
      Parameters:
      chromosome - The chromosome to set.
      allele - The allele for this chromosome.
      Throws:
      IllegalArgumentException - If the chromosome is not contained in this genome, or if the given allele is not valid for the given chromosome.
    • setActive

      <A extends IAllele> void setActive(IChromosome<A> chromosome, A allele)
      Sets the active allele for the chromosome in this genome. Active alleles have the most influence over the actual traits of an individual, also called the phenotype.
      Parameters:
      chromosome - The chromosome to set.
      allele - The active allele for this chromosome.
      Throws:
      IllegalArgumentException - If the chromosome is not contained in this genome, or if the given allele is not valid for the given chromosome.
    • setInactive

      <A extends IAllele> void setInactive(IChromosome<A> chromosome, A allele)
      Sets the inactive (non-expressed) allele for the chromosome in this genome. Inactive alleles have little to no influence on an individual, but are still important for inheritance/breeding.
      Parameters:
      chromosome - The chromosome to set.
      allele - The active allele for this chromosome.
      Throws:
      IllegalArgumentException - If the chromosome is not contained in this genome, or if the given allele is not valid for the given chromosome.
    • build

      IGenome build()
      Returns:
      A new genome. Later modifications to this builder will not affect the returned genome.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if no chromosomes were set in this genome.
    • setRemainingDefault

      void setRemainingDefault()
      Sets the remaining alleles in this chromosome to their defaults as specified by this genome's karyotype.