net.sourceforge.cilib.algorithm.population
Class PopulationBasedAlgorithm

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.Algorithm
      extended by net.sourceforge.cilib.algorithm.population.PopulationBasedAlgorithm
All Implemented Interfaces:
Serializable, Runnable, Cloneable
Direct Known Subclasses:
MultiPopulationBasedAlgorithm, SinglePopulationBasedAlgorithm

public abstract class PopulationBasedAlgorithm
extends Algorithm

Base class for all algorithms that manage a collection of entities in some manner.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.algorithm.Algorithm
optimisationProblem
 
Constructor Summary
protected PopulationBasedAlgorithm()
           
protected PopulationBasedAlgorithm(PopulationBasedAlgorithm copy)
           
 
Method Summary
abstract  Object accept(TopologyVisitor visitor)
          General method to accept a visitor to perform a calculation on the current algorithm.
protected abstract  void algorithmIteration()
          The actual operations that the current Algorithm performs within a single iteration.
abstract  OptimisationSolution getBestSolution()
          Get the best current solution.
abstract  PopulationBasedAlgorithm getClone()
          Create a cloned copy of the current object and return it.
abstract  PopulationInitialisationStrategy getInitialisationStrategy()
          Get the current PopulationInitialisationStrategy.
abstract  List<OptimisationSolution> getSolutions()
          Get the collection of best solutions.
abstract  Topology<? extends Entity> getTopology()
          Get the current collection (population) of entities.
abstract  void setInitialisationStrategy(PopulationInitialisationStrategy initialisationStrategy)
          Set the initialisation strategy to use for the initialisation of the population.
 
Methods inherited from class net.sourceforge.cilib.algorithm.Algorithm
addAlgorithmListener, addStoppingCondition, get, getAlgorithmList, getIterations, getOptimisationProblem, getPercentageComplete, getStoppingConditions, initialise, isFinished, performInitialisation, performIteration, performUninitialisation, removeAlgorithmListener, removeStoppingCondition, reset, run, setOptimisationProblem, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopulationBasedAlgorithm

protected PopulationBasedAlgorithm()

PopulationBasedAlgorithm

protected PopulationBasedAlgorithm(PopulationBasedAlgorithm copy)
Method Detail

getClone

public abstract PopulationBasedAlgorithm 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 Algorithm
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

algorithmIteration

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

Specified by:
algorithmIteration in class Algorithm

getBestSolution

public abstract OptimisationSolution getBestSolution()
Get the best current solution. This best solution is determined from the personal bests of the particles.

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

getSolutions

public abstract List<OptimisationSolution> getSolutions()
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 Algorithm
Returns:
The Collection<OptimisationSolution> containing the solutions.

getTopology

public abstract Topology<? extends Entity> getTopology()
Get the current collection (population) of entities.

Returns:
The current population.

accept

public abstract Object accept(TopologyVisitor visitor)
General method to accept a visitor to perform a calculation on the current algorithm. The operation is generally deferred down to the underlying topology associated with the algorithm, as the algorithm does not contain information, but rather only behaviour to alter the candidate solutions that are managed by the Topology.

Parameters:
visitor - The Visitor to be applied to the algorithm
Returns:
The result of the visitor operation.

setInitialisationStrategy

public abstract void setInitialisationStrategy(PopulationInitialisationStrategy initialisationStrategy)
Set the initialisation strategy to use for the initialisation of the population.

Parameters:
initialisationStrategy - The population initialisation strategy to set.

getInitialisationStrategy

public abstract PopulationInitialisationStrategy getInitialisationStrategy()
Get the current PopulationInitialisationStrategy.

Returns:
The current PopulationInitialisationStrategy.


Copyright © 2009 CIRG. All Rights Reserved.