net.sourceforge.cilib.algorithm
Class MultistartOptimisationAlgorithm

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.Algorithm
      extended by net.sourceforge.cilib.algorithm.MultistartOptimisationAlgorithm
All Implemented Interfaces:
Serializable, Runnable, ParticipatingAlgorithm, Cloneable

public class MultistartOptimisationAlgorithm
extends Algorithm
implements ParticipatingAlgorithm

MultistartOptimisationAlgorithm is simply a wrapper. The wrapped optimisation algorithm is subject to restart conditions. Each time one of these conditions is satisfied, the wrapped algorithm is re-initialised and execution continues until this algorithm's stopping conditions are satisfied.

This class implements a generalised multistart optimisation algorithm. The original Multistart PSO is due to F. van den Bergh, reference: F. van den Bergh, "An Analysis of Particle Swarm Optimizers," PhD thesis, Department of Computer Science, University of Pretoria, South Africa, 2002.

Author:
Edwin Peer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.algorithm.Algorithm
optimisationProblem
 
Constructor Summary
MultistartOptimisationAlgorithm()
          Creates a new instance of MultistartOptimisationAlgorithm.
MultistartOptimisationAlgorithm(MultistartOptimisationAlgorithm copy)
          Create a copy of the provided instance.
 
Method Summary
 void addRestartCondition(StoppingCondition condition)
          Add a stopping condition used to determine when the algorithm should be restarted.
 void algorithmIteration()
          Perform an algorithm iteration, then restart the Algorithm and increment the number of restarts.
 OptimisationSolution getBestSolution()
          Get the best current solution.
 MultistartOptimisationAlgorithm getClone()
          Create a cloned copy of the current object and return it.
 Entity getContribution()
          Returns contribution to the solution for the co-operative optimisation algorithm.
 Fitness getContributionFitness()
          Returns the fitness of contribution to the solution.
 OptimisationProblem getOptimisationProblem()
          Get the specified OptimisationProblem.
 int getRestarts()
          Returns the number of times that the algorithm has been restarted.
 Fitness getSolutionFitness()
          Return the fitness of the solution.
 List<OptimisationSolution> getSolutions()
          Get the collection of best solutions.
 void performInitialisation()
          Perform the needed initialisation required before the execution of the algorithm starts.
 void removeRestartCondition(StoppingCondition condition)
          Removes a restart condition.
 void setOptimisationProblem(OptimisationProblem problem)
          Set the optimisation problem.
 void setTargetAlgorithm(Algorithm algorithm)
          Sets the target optimisation algorithm that is subject to restarting.
 void updateContributionFitness(Fitness fitness)
          Updates the new fitness for the solution contribution.
 
Methods inherited from class net.sourceforge.cilib.algorithm.Algorithm
addAlgorithmListener, addStoppingCondition, get, getAlgorithmList, getIterations, getPercentageComplete, getStoppingConditions, initialise, isFinished, performIteration, performUninitialisation, removeAlgorithmListener, removeStoppingCondition, reset, run, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultistartOptimisationAlgorithm

public MultistartOptimisationAlgorithm()
Creates a new instance of MultistartOptimisationAlgorithm.


MultistartOptimisationAlgorithm

public MultistartOptimisationAlgorithm(MultistartOptimisationAlgorithm copy)
Create a copy of the provided instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public MultistartOptimisationAlgorithm 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()

setTargetAlgorithm

public void setTargetAlgorithm(Algorithm algorithm)
Sets the target optimisation algorithm that is subject to restarting.

Parameters:
algorithm - Any OptimisationAlgorithm that extends Algorithm.

getOptimisationProblem

public OptimisationProblem getOptimisationProblem()
Get the specified OptimisationProblem.

Overrides:
getOptimisationProblem in class Algorithm
Returns:
The specified OptimisationProblem.

getSolutionFitness

public Fitness getSolutionFitness()
Return the fitness of the solution.

Returns:
The current Fitness.

setOptimisationProblem

public void setOptimisationProblem(OptimisationProblem problem)
Set the optimisation problem.

Overrides:
setOptimisationProblem in class Algorithm
Parameters:
problem - The problem to set.

getContribution

public Entity getContribution()
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()
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)
Updates the new fitness for the solution contribution.

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

addRestartCondition

public void addRestartCondition(StoppingCondition condition)
Add a stopping condition used to determine when the algorithm should be restarted. Equivalent to calling Algorithm.addStoppingCondition(StoppingCondition) on the algorithm set in #setTargetAlgorithm(OptimisationAlgorithm).

Parameters:
indicator - The StoppingCondition to be added.

removeRestartCondition

public void removeRestartCondition(StoppingCondition condition)
Removes a restart condition. Equivalent to calling Algorithm.removeStoppingCondition(StoppingCondition) on the algorithm set in #setTargetAlgorithm(OptimisationAlgorithm).

Parameters:
indicator - The StoppingCondition to be removed.

performInitialisation

public void performInitialisation()
Perform the needed initialisation required before the execution of the algorithm starts.

Overrides:
performInitialisation in class Algorithm

algorithmIteration

public void algorithmIteration()
Perform an algorithm iteration, then restart the Algorithm and increment the number of restarts.

Specified by:
algorithmIteration in class Algorithm

getRestarts

public int getRestarts()
Returns the number of times that the algorithm has been restarted.

Returns:
The number of restarts.

getBestSolution

public 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 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.


Copyright © 2009 CIRG. All Rights Reserved.