Interface GeneticAlgorithm

  • All Superinterfaces:
    Changeable
    All Known Implementing Classes:
    AbstractGeneticAlgorithm, SimpleGeneticAlgorithm

    public interface GeneticAlgorithm
    extends Changeable
    The class that runs the cycles of reproduction, evolution and selection, potentially on multiple Populations

    Since:
    1.5
    Version:
    1.1
    Author:
    Mark Schreiber, Susanne Merz, Andreas Dräger
    • Field Detail

      • FITNESS_FUNCTION

        static final ChangeType FITNESS_FUNCTION
      • CROSS_OVER_FUNCTION

        static final ChangeType CROSS_OVER_FUNCTION
      • MUTATION_FUNCTION

        static final ChangeType MUTATION_FUNCTION
      • SELECTION_FUNCTION

        static final ChangeType SELECTION_FUNCTION
    • Method Detail

      • setFitnessFunction

        void setFitnessFunction​(FitnessFunction func)
                         throws ChangeVetoException
        The fitness function that will be used to compute the fitness of each organism.
        Parameters:
        func - the FitnessFunction to be used
        Throws:
        ChangeVetoException - if the change is vetoed.
      • getFitnessFunction

        FitnessFunction getFitnessFunction()
        Returns the fitness function, i.e. the class that computes the fitness of each organism in a population.
        Returns:
        the fitness function
      • setPopulation

        void setPopulation​(Population pop)
                    throws ChangeVetoException
        Sets the Population of Organisms to the Algorithm.
        Parameters:
        pop - the population to add.
        Throws:
        ChangeVetoException - if new populations are not allowed.
      • getPopulation

        Population getPopulation()
        The registered Population
        Returns:
        the Population being operated on.
      • setSelectionFunction

        void setSelectionFunction​(SelectionFunction function)
                           throws ChangeVetoException
        Changes the SelectionFunction used to select candidates for the next generation
        Parameters:
        function - a SelectionFunction
        Throws:
        ChangeVetoException - if the SelectionFunction is not allowed to be changed
      • getSelectionFunction

        SelectionFunction getSelectionFunction()
        Returns:
        the current SelectionFunction
      • setCrossOverFunction

        void setCrossOverFunction​(CrossOverFunction function)
                           throws ChangeVetoException
        Changes the CrossOverFunction used to CrossOver Chromosomes
        Parameters:
        function - a CrossOverFunction
        Throws:
        ChangeVetoException - if the CrossOverFunction is not allowed to be changed
      • getCrossOverFunction

        CrossOverFunction getCrossOverFunction()
        Returns:
        the current CrossOverFunction
      • getMutationFunction

        MutationFunction getMutationFunction()
        Returns:
        the current MutationFunction
      • getGeneration

        int getGeneration()
        Returns:
        the Current generation number