net.sourceforge.cilib.coevolution
Class CoevolutionAlgorithm

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.Algorithm
      extended by net.sourceforge.cilib.algorithm.population.PopulationBasedAlgorithm
          extended by net.sourceforge.cilib.algorithm.population.MultiPopulationBasedAlgorithm
              extended by net.sourceforge.cilib.coevolution.CoevolutionAlgorithm
All Implemented Interfaces:
Serializable, Iterable<PopulationBasedAlgorithm>, Runnable, Cloneable

public class CoevolutionAlgorithm
extends MultiPopulationBasedAlgorithm

This is the framework for a coevolution algorithm, either competitive or cooperative

Author:
Julien Duhain, leo TODO: impliment and test cooperative side TODO: This code needs a lot of love, need to refactor!
See Also:
Serialized Form

Field Summary
protected  CoevolutionIterationStrategy coevolutionIterationStrategy
           
 
Fields inherited from class net.sourceforge.cilib.algorithm.population.MultiPopulationBasedAlgorithm
algorithmIterator, subPopulationsAlgorithms
 
Fields inherited from class net.sourceforge.cilib.algorithm.Algorithm
optimisationProblem
 
Constructor Summary
CoevolutionAlgorithm()
           
CoevolutionAlgorithm(CoevolutionAlgorithm copy)
           
 
Method Summary
 void algorithmIteration()
          The actual operations that the current Algorithm performs within a single iteration.
 DomainRegistry getBehaviouralDomain()
           
 OptimisationSolution getBestSolution()
          This doesnt really make sense since in co-evolution you have a best solution for each population
 CoevolutionAlgorithm getClone()
          Create a cloned copy of the current object and return it.
 CoevolutionIterationStrategy getCoevolutionIterationStrategy()
           
 CoevolutionOptimisationProblem getCoevolutionOptimisationProblem()
           
 DataSetBuilder getDataSetBuilder()
           
 double getDiameter()
           
 DomainRegistry getDomain()
           
 int getFitnessEvaluations()
           
 int getPopulationSize()
           
 double getRadius()
           
 List<OptimisationSolution> getSolutions()
          Can be useful to compare how the different populations are performing.
 Topology<? extends Entity> getTopology()
          Get the current collection (population) of entities.
 void performInitialisation()
          initialises every population.
 void setAlgorithm(PopulationBasedAlgorithm algorithm)
          Add a subpopulation Algorithm
 void setCoevolutionIterationStrategy(CoevolutionIterationStrategy coevolutionIterationStrategy)
           
 void setDataSetBuilder(DataSetBuilder dataSet)
           
 void setOptimisationProblem(OptimisationProblem problem)
          Set the optimisation problem to be solved.
 void setPopulationSize(int i)
           
 void setTopology(Topology t)
           
 
Methods inherited from class net.sourceforge.cilib.algorithm.population.MultiPopulationBasedAlgorithm
accept, addPopulationBasedAlgorithm, getAlgorithmIterator, getInitialisationStrategy, getPopulations, iterator, removePopulationBasedalgorithm, reset, setAlgorithmIterator, setInitialisationStrategy, setPopulations
 
Methods inherited from class net.sourceforge.cilib.algorithm.Algorithm
addAlgorithmListener, addStoppingCondition, get, getAlgorithmList, getIterations, getOptimisationProblem, getPercentageComplete, getStoppingConditions, initialise, isFinished, performIteration, performUninitialisation, removeAlgorithmListener, removeStoppingCondition, run, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coevolutionIterationStrategy

protected CoevolutionIterationStrategy coevolutionIterationStrategy
Constructor Detail

CoevolutionAlgorithm

public CoevolutionAlgorithm()

CoevolutionAlgorithm

public CoevolutionAlgorithm(CoevolutionAlgorithm copy)
Method Detail

getClone

public CoevolutionAlgorithm getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Specified by:
getClone in class PopulationBasedAlgorithm
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

getPopulationSize

public int getPopulationSize()
Returns:
the sum of all the populations

setAlgorithm

public void setAlgorithm(PopulationBasedAlgorithm algorithm)
Add a subpopulation Algorithm

Parameters:
algorithm -

getCoevolutionOptimisationProblem

public CoevolutionOptimisationProblem getCoevolutionOptimisationProblem()
Returns:
optimization problem cast to type CoevolutionOptimizationProblem

performInitialisation

public void performInitialisation()
initialises every population.

Overrides:
performInitialisation in class Algorithm

getBestSolution

public OptimisationSolution getBestSolution()
This doesnt really make sense since in co-evolution you have a best solution for each population

Specified by:
getBestSolution in class PopulationBasedAlgorithm
Returns:
The OptimisationSolution representing the best solution.

getSolutions

public List<OptimisationSolution> getSolutions()
Can be useful to compare how the different populations are performing.

Specified by:
getSolutions in class PopulationBasedAlgorithm
Returns:
a list of the best solution in each population.

algorithmIteration

public void algorithmIteration()
The actual operations that the current Algorithm performs within a single iteration.

Specified by:
algorithmIteration in class MultiPopulationBasedAlgorithm

getCoevolutionIterationStrategy

public CoevolutionIterationStrategy getCoevolutionIterationStrategy()

setCoevolutionIterationStrategy

public void setCoevolutionIterationStrategy(CoevolutionIterationStrategy coevolutionIterationStrategy)

getFitnessEvaluations

public int getFitnessEvaluations()

getDomain

public DomainRegistry getDomain()

getBehaviouralDomain

public DomainRegistry getBehaviouralDomain()

getDataSetBuilder

public DataSetBuilder getDataSetBuilder()

setDataSetBuilder

public void setDataSetBuilder(DataSetBuilder dataSet)

setPopulationSize

public void setPopulationSize(int i)

getRadius

public double getRadius()

getDiameter

public double getDiameter()

setTopology

public void setTopology(Topology t)

getTopology

public Topology<? extends Entity> getTopology()
Description copied from class: PopulationBasedAlgorithm
Get the current collection (population) of entities.

Overrides:
getTopology in class MultiPopulationBasedAlgorithm
Returns:
The current population.

setOptimisationProblem

public void setOptimisationProblem(OptimisationProblem problem)
Set the optimisation problem to be solved. By default, the problem is null. That is, it is necessary to set the optimisation problem before calling Algorithm.initialise().

Overrides:
setOptimisationProblem in class Algorithm
Parameters:
problem - An implementation of the OptimisationProblemAdapter interface.


Copyright © 2009 CIRG. All Rights Reserved.