org.dishevelled.evolve.impl
Class EvolutionaryAlgorithmImpl<I>

java.lang.Object
  extended by org.dishevelled.evolve.impl.EvolutionaryAlgorithmImpl<I>
Type Parameters:
I - individual type
All Implemented Interfaces:
EvolutionaryAlgorithm<I>

public final class EvolutionaryAlgorithmImpl<I>
extends Object
implements EvolutionaryAlgorithm<I>

Implementation of an evolutionary algorithm function.

Version:
$Revision: 320 $ $Date: 2007-10-23 14:06:38 -0500 (Tue, 23 Oct 2007) $
Author:
Michael Heuer

Constructor Summary
EvolutionaryAlgorithmImpl()
          Create a new evolutionary algorithm function implementation.
 
Method Summary
 void addEvolutionaryAlgorithmListener(EvolutionaryAlgorithmListener<I> l)
          Add the specified evolutionary algorithm listener.
 Collection<I> evolve(Collection<I> individuals, ExitStrategy<I> exitStrategy, Recombination<I> recombination, Mutation<I> mutation, Fitness<I> fitness, Selection<I> selection)
          Evolve the specified population of individuals, using all of the specified exit strategy, recombination, mutation, fitness, and selection functions.
 int getEvolutionaryAlgorithmListenerCount()
          Return the number of evolutionary algorithm listeners registered to this evolutionary algorithm.
 EvolutionaryAlgorithmListener<I>[] getEvolutionaryAlgorithmListeners()
          Return an array of evolutionary algorithm listeners registered to this evolutionary algorithm.
 void removeEvolutionaryAlgorithmListener(EvolutionaryAlgorithmListener<I> l)
          Remove the specified evolutionary algorithm listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvolutionaryAlgorithmImpl

public EvolutionaryAlgorithmImpl()
Create a new evolutionary algorithm function implementation.

Method Detail

evolve

public Collection<I> evolve(Collection<I> individuals,
                            ExitStrategy<I> exitStrategy,
                            Recombination<I> recombination,
                            Mutation<I> mutation,
                            Fitness<I> fitness,
                            Selection<I> selection)
Evolve the specified population of individuals, using all of the specified exit strategy, recombination, mutation, fitness, and selection functions.

Specified by:
evolve in interface EvolutionaryAlgorithm<I>
Parameters:
individuals - population of individuals, must not be null and must contain at least one individual
exitStrategy - exit strategy function, must not be null
recombination - recombination function, must not be null
mutation - mutation function, must not be null
fitness - fitness function, must not be null
selection - selection function, must not be null
Returns:
evolved population of individuals that passes the conditions of the specified exit strategy

addEvolutionaryAlgorithmListener

public void addEvolutionaryAlgorithmListener(EvolutionaryAlgorithmListener<I> l)
Add the specified evolutionary algorithm listener.

Specified by:
addEvolutionaryAlgorithmListener in interface EvolutionaryAlgorithm<I>
Parameters:
l - evolutionary algorithm listener to add

removeEvolutionaryAlgorithmListener

public void removeEvolutionaryAlgorithmListener(EvolutionaryAlgorithmListener<I> l)
Remove the specified evolutionary algorithm listener.

Specified by:
removeEvolutionaryAlgorithmListener in interface EvolutionaryAlgorithm<I>
Parameters:
l - evolutionary algorithm listener to remove

getEvolutionaryAlgorithmListenerCount

public int getEvolutionaryAlgorithmListenerCount()
Return the number of evolutionary algorithm listeners registered to this evolutionary algorithm.

Specified by:
getEvolutionaryAlgorithmListenerCount in interface EvolutionaryAlgorithm<I>
Returns:
the number of evolutionary algorithm listeners registered to this evolutionary algorithm

getEvolutionaryAlgorithmListeners

public EvolutionaryAlgorithmListener<I>[] getEvolutionaryAlgorithmListeners()
Return an array of evolutionary algorithm listeners registered to this evolutionary algorithm.

Specified by:
getEvolutionaryAlgorithmListeners in interface EvolutionaryAlgorithm<I>
Returns:
an array of evolutionary algorithm listeners registered to this evolutionary algorithm


Copyright (c) 2005-2012 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).