net.sourceforge.cilib.cooperative
Class SplitCooperativeAlgorithm

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.cooperative.SplitCooperativeAlgorithm
All Implemented Interfaces:
Serializable, Iterable<PopulationBasedAlgorithm>, Runnable, ParticipatingAlgorithm, Cloneable

public class SplitCooperativeAlgorithm
extends MultiPopulationBasedAlgorithm
implements ParticipatingAlgorithm

TODO test this class This class forms that basis for any co-operative optimisation implementations. Any algorithm that wishes to participate in a co-operative optimisation algorithm must implement the ParticipatingAlgorithm interface. This class also implements ParticipatingAlgorithm meaning that co-operative algorithms can be composed of co-operative algorithms again.

Author:
Edwin Peer, Theuns Cloete
See Also:
Serialized Form

Field Summary
protected  CooperativeEntity context
           
protected  ContributionUpdateStrategy contributionUpdateStrategy
           
protected  FitnessUpdateStrategy fitnessUpdateStrategy
           
protected  SplitStrategy splitStrategy
           
 
Fields inherited from class net.sourceforge.cilib.algorithm.population.MultiPopulationBasedAlgorithm
algorithmIterator, subPopulationsAlgorithms
 
Fields inherited from class net.sourceforge.cilib.algorithm.Algorithm
optimisationProblem
 
Constructor Summary
SplitCooperativeAlgorithm()
          Creates a new instance of a SplitCooperativeAglorithm.
SplitCooperativeAlgorithm(SplitCooperativeAlgorithm copy)
           
 
Method Summary
 void addPopulationBasedAlgorithm(PopulationBasedAlgorithm algorithm)
          Add a PopulationBasedAlgorithm to the list of maintained sub-populations.
 void algorithmIteration()
          The actual operations that the current Algorithm performs within a single iteration.
 OptimisationSolution getBestSolution()
          Get the best current solution.
 SplitCooperativeAlgorithm getClone()
          Create a cloned copy of the current object and return it.
 CooperativeEntity getContext()
           
 Entity getContribution()
          Returns contribution to the solution for the co-operative optimisation algorithm.
 Fitness getContributionFitness()
          Returns the fitness of contribution to the solution.
 ContributionUpdateStrategy getContributionUpdateStrategy()
           
 FitnessUpdateStrategy getFitnessUpdateStrategy()
           
 int getNumberOfParticipants()
           
 List<OptimisationSolution> getSolutions()
          Get the collection of best solutions.
 SplitStrategy getSplitStrategy()
           
 void performInitialisation()
          Perform the needed initialisation required before the execution of the algorithm starts.
 void performUninitialisation()
          Perform the needed unintialisation steps after the algorithm completes it's execution.
 void reset()
          Reset the Algorithm internals if needed.
 void setContext(CooperativeEntity c)
           
 void setContributionUpdateStrategy(ContributionUpdateStrategy contributionUpdate)
           
 void setFitnessUpdateStrategy(FitnessUpdateStrategy fitnessUpdate)
           
 void setSplitStrategy(SplitStrategy split)
           
 void updateContributionFitness(Fitness fitness)
          The purpose of this method should not be confused with the ContributionUpdateStrategy.
 
Methods inherited from class net.sourceforge.cilib.algorithm.population.MultiPopulationBasedAlgorithm
accept, getAlgorithmIterator, getInitialisationStrategy, getPopulations, getTopology, iterator, removePopulationBasedalgorithm, setAlgorithmIterator, setInitialisationStrategy, setPopulations
 
Methods inherited from class net.sourceforge.cilib.algorithm.Algorithm
addAlgorithmListener, addStoppingCondition, get, getAlgorithmList, getIterations, getOptimisationProblem, getPercentageComplete, getStoppingConditions, initialise, isFinished, performIteration, removeAlgorithmListener, removeStoppingCondition, run, setOptimisationProblem, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected CooperativeEntity context

splitStrategy

protected SplitStrategy splitStrategy

fitnessUpdateStrategy

protected FitnessUpdateStrategy fitnessUpdateStrategy

contributionUpdateStrategy

protected ContributionUpdateStrategy contributionUpdateStrategy
Constructor Detail

SplitCooperativeAlgorithm

public SplitCooperativeAlgorithm()
Creates a new instance of a SplitCooperativeAglorithm.


SplitCooperativeAlgorithm

public SplitCooperativeAlgorithm(SplitCooperativeAlgorithm copy)
Method Detail

getClone

public SplitCooperativeAlgorithm getClone()
Description copied from class: PopulationBasedAlgorithm
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()

reset

public void reset()
Description copied from class: MultiPopulationBasedAlgorithm
Reset the Algorithm internals if needed.

Overrides:
reset in class MultiPopulationBasedAlgorithm

getBestSolution

public OptimisationSolution getBestSolution()
Description copied from class: PopulationBasedAlgorithm
Get the best current solution. This best solution is determined from the personal bests of the particles.

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

getSolutions

public List<OptimisationSolution> getSolutions()
Description copied from class: PopulationBasedAlgorithm
Get the collection of best solutions. This result does not actually make sense in the normal PSO algorithm, but rather in a MultiObjective optimization.

Specified by:
getSolutions in class PopulationBasedAlgorithm
Returns:
The Collection<OptimisationSolution> containing the solutions.

getContext

public CooperativeEntity getContext()

setContext

public void setContext(CooperativeEntity c)

addPopulationBasedAlgorithm

public void addPopulationBasedAlgorithm(PopulationBasedAlgorithm algorithm)
Description copied from class: MultiPopulationBasedAlgorithm
Add a PopulationBasedAlgorithm to the list of maintained sub-populations.

Overrides:
addPopulationBasedAlgorithm in class MultiPopulationBasedAlgorithm
Parameters:
algorithm - The PopulationBasedAlgorithm to add to the current collection.

getNumberOfParticipants

public int getNumberOfParticipants()

getSplitStrategy

public SplitStrategy getSplitStrategy()

setSplitStrategy

public void setSplitStrategy(SplitStrategy split)

getContributionUpdateStrategy

public ContributionUpdateStrategy getContributionUpdateStrategy()

setContributionUpdateStrategy

public void setContributionUpdateStrategy(ContributionUpdateStrategy contributionUpdate)

getContribution

public Entity getContribution()
Description copied from interface: ParticipatingAlgorithm
Returns contribution to the solution for the co-operative optimisation algorithm.

Specified by:
getContribution in interface ParticipatingAlgorithm
Returns:
The algorithm's solution contribution.

getContributionFitness

public Fitness getContributionFitness()
Description copied from interface: ParticipatingAlgorithm
Returns the fitness of contribution to the solution.

Specified by:
getContributionFitness in interface ParticipatingAlgorithm
Returns:
The fitness of the solution contribution.

updateContributionFitness

public void updateContributionFitness(Fitness fitness)
The purpose of this method should not be confused with the ContributionUpdateStrategy. This method sets the fitness for the context of the cooperating algorithm, i.e. the fitness for all cooperating algorithms as a whole.

Specified by:
updateContributionFitness in interface ParticipatingAlgorithm
Parameters:
fitness - The new fitness of the contribution.

getFitnessUpdateStrategy

public FitnessUpdateStrategy getFitnessUpdateStrategy()

setFitnessUpdateStrategy

public void setFitnessUpdateStrategy(FitnessUpdateStrategy fitnessUpdate)

performInitialisation

public void performInitialisation()
Description copied from class: Algorithm
Perform the needed initialisation required before the execution of the algorithm starts.

Overrides:
performInitialisation in class Algorithm

performUninitialisation

public void performUninitialisation()
Description copied from class: Algorithm
Perform the needed unintialisation steps after the algorithm completes it's execution.

Overrides:
performUninitialisation in class Algorithm

algorithmIteration

public void algorithmIteration()
Description copied from class: MultiPopulationBasedAlgorithm
The actual operations that the current Algorithm performs within a single iteration.

Specified by:
algorithmIteration in class MultiPopulationBasedAlgorithm


Copyright © 2009 CIRG. All Rights Reserved.