Class GATools


  • public final class GATools
    extends Object

    Utility methods for the GA library

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

    • Method Detail

      • getBinaryAlphabet

        public static FiniteAlphabet 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.
      • standardMutationDistribution

        public static OrderNDistribution standardMutationDistribution​(FiniteAlphabet a)
                                                               throws IllegalAlphabetException
        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