Class GATools

java.lang.Object
org.biojavax.ga.util.GATools

public final class GATools extends Object

Utility methods for the GA library

Since:
1.5
Version:
1.0
Author:
Mark Schreiber
  • Constructor Details

  • Method Details

    • getBinaryAlphabet

      Gets a Reference to the FlyWeight GA_Binary Alphabet. It contains the Symbols one and zero.
      Returns:
      the finite, flyweight Binary Alphabet
    • one

      public static AtomicSymbol one()
      Returns:
      the GA_Binary symbol "one"
    • createBinary

      public static SymbolList createBinary(String binarySequence) throws IllegalSymbolException
      Creates a SymbolList in the GABinary Alphabet
      Parameters:
      binarySequence - a String like "01010000101010101" with no white space
      Returns:
      a SymbolList parsed from binarySequence
      Throws:
      IllegalSymbolException - if a character other than 1 or 0 is found.
    • zero

      public static AtomicSymbol zero()
      Returns:
      the GA_Binary symbol "zero"
    • uniformMutationDistribution

      Makes a 1st order distribution which is infact uniform (equivalent to a uniform zero order distribution).
      Parameters:
      a - the zero order Alphabet which will be multiplied into the 1st order alphabet
      Returns:
      the "1st order" distribution
      Throws:
      IllegalAlphabetException - if the Distribution cannot be constructed from a.
    • standardMutationDistribution

      Makes a mutation Distribution where the probability of a Symbol being mutated to itself is zero and the probability of it being changed to any other Symbol in the Alphabet a is 1.0 / (a.size() - 1.0)
      Parameters:
      a - the FiniteAlphabet which mutations are sampled from.
      Returns:
      A Distribution suitable for use in a MutationFunction
      Throws:
      IllegalAlphabetException - if the Distribution cannot be made over the FiniteAlphabet