net.sourceforge.cilib.hs
Class HS

java.lang.Object
  extended by net.sourceforge.cilib.algorithm.Algorithm
      extended by net.sourceforge.cilib.algorithm.SingularAlgorithm
          extended by net.sourceforge.cilib.hs.HS
All Implemented Interfaces:
Serializable, Runnable, Cloneable

public class HS
extends SingularAlgorithm

Harmony Search as published in K.S. Lee and Z.W. Geem, "A New Meta-Heuristic Algorithm for Continuous Engineering Optimization: Harmony Search Theory and Practice", Computer Methods in Applied Mechanics and Engineering, volume 194, pages 3902--3933, 2005

Author:
Andries Engelbrecht
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cilib.algorithm.Algorithm
optimisationProblem
 
Constructor Summary
HS()
          Default constructor.
HS(HS copy)
          Copy constructor.
 
Method Summary
 void algorithmIteration()
          The actual operations that the current Algorithm performs within a single iteration.
 OptimisationSolution getBestSolution()
          Get the best current solution.
 HS getClone()
          Create a cloned copy of the current object and return it.
 ControlParameter getDistanceBandwidth()
          Get the distance bandwidth.
 ControlParameter getHarmonyMemoryConsideringRate()
          Get the considering rate for the harmony memory.
 ControlParameter getHarmonyMemorySize()
          Get the size of the harmony memory.
 ControlParameter getPitchAdjustingRate()
          Get the current pitch adjusting rate as a ControlParameter.
 List<OptimisationSolution> getSolutions()
          Get the collection of best solutions.
 void performInitialisation()
          Perform the needed initialisation required before the execution of the algorithm starts.
 void setDistanceBandwidth(ControlParameter distanceBandwidth)
          Set the distance bandwidth.
 void setHarmonyMemoryConsideringRate(ControlParameter harmonyMemoryConsideringRate)
          Set the considering rate for the harmony memory.
 void setHarmonyMemorySize(ControlParameter harmonyMemorySize)
          Set the size of the harmony memory.
 void setPitchAdjustingRate(ControlParameter pitchAdjustingRate)
          Set the pitch adjusting rate.
 
Methods inherited from class net.sourceforge.cilib.algorithm.Algorithm
addAlgorithmListener, addStoppingCondition, get, getAlgorithmList, getIterations, getOptimisationProblem, getPercentageComplete, getStoppingConditions, initialise, isFinished, 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

HS

public HS()
Default constructor.

Set the parameters for the algorithm up as:


HS

public HS(HS copy)
Copy constructor.

Parameters:
copy - The instance to copy.
Method Detail

getClone

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

performInitialisation

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

Overrides:
performInitialisation in class Algorithm

getHarmonyMemoryConsideringRate

public ControlParameter getHarmonyMemoryConsideringRate()
Get the considering rate for the harmony memory.

Returns:
The ControlParameter for the considering rate.

setHarmonyMemoryConsideringRate

public void setHarmonyMemoryConsideringRate(ControlParameter harmonyMemoryConsideringRate)
Set the considering rate for the harmony memory.

Parameters:
harmonyMemoryConsideringRate - The ControlParameter for the memory considering rate.

getHarmonyMemorySize

public ControlParameter getHarmonyMemorySize()
Get the size of the harmony memory.

Returns:
The size of the harmony memory.

setHarmonyMemorySize

public void setHarmonyMemorySize(ControlParameter harmonyMemorySize)
Set the size of the harmony memory.

Parameters:
harmonyMemorySize - The memory size to use.

getPitchAdjustingRate

public ControlParameter getPitchAdjustingRate()
Get the current pitch adjusting rate as a ControlParameter.

Returns:
The pitch adjusting rate as a ControlParameter.

setPitchAdjustingRate

public void setPitchAdjustingRate(ControlParameter pitchAdjustingRate)
Set the pitch adjusting rate.

Parameters:
pitchAdjustingRate - The ControlParameter to use.

getDistanceBandwidth

public ControlParameter getDistanceBandwidth()
Get the distance bandwidth.

Returns:
The ControlParameter for the distance bandwidth.

setDistanceBandwidth

public void setDistanceBandwidth(ControlParameter distanceBandwidth)
Set the distance bandwidth.

Parameters:
distanceBandwidth - The ControlParameter to use.

algorithmIteration

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

Specified by:
algorithmIteration in class SingularAlgorithm

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.