Package forestry.api.plugin
Interface IGenomeBuilder
public interface IGenomeBuilder
Used to create a genome.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()booleanisEmpty()default voidset(IBooleanChromosome chromosome, boolean defaultAllele) Shortcut for setting dominant true/false alleles.<A extends IAllele>
voidset(IChromosome<A> chromosome, A allele) Sets both the active and inactive allele for the chromosome in this genome.<A extends IAllele>
voidsetActive(IChromosome<A> chromosome, A allele) Sets the active allele for the chromosome in this genome.<A extends IAllele>
voidsetInactive(IChromosome<A> chromosome, A allele) Sets the inactive (non-expressed) allele for the chromosome in this genome.voidSets the remaining alleles in this chromosome to their defaults as specified by this genome's karyotype.default voidsetUnchecked(IChromosome chromosome, AllelePair allele)
-
Method Details
-
set
Shortcut for setting dominant true/false alleles. -
setUnchecked
-
set
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
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
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:
trueif 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.
-