net.sourceforge.jannealer
Class AnnealingScheme

java.lang.Object
  |
  +--net.sourceforge.jannealer.AnnealingScheme

public class AnnealingScheme
extends java.lang.Object

Implements downhill simplex simulated annealing algorithm

Since:
October 17, 2001
Author:
Charles Mégnin, Řyvind Harboe

Field Summary
static double DEFAULTCOOLINGRATE
           
static int DEFAULTITERATIONS
           
static double DEFAULTOLERANCE
           
static double DEFAULTTEMP
          default temperature
 
Constructor Summary
AnnealingScheme()
           
 
Method Summary
 void anneal()
          runs an annealing, call getOffset() to get result
 double[] getSolution()
           
 void setCoolingRate(double coolingRate)
          Sets the CoolingRate attribute of the AnnealingScheme object
 void setFunction(ObjectiveFunction function)
           
 void setIterations(int nIterations)
          Number of iterations before cooling is applied
 void setSolution(double[] offset)
          Sets a starting point for searching for a solution
 void setTemperature(double temperature)
          Sets the Temperature attribute of the AnnealingScheme object
 void setTolerance(double tolerance)
          Sets the Tolerance attribute of the AnnealingScheme object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULTTEMP

public static final double DEFAULTTEMP
default temperature

See Also:
Constant Field Values

DEFAULTCOOLINGRATE

public static final double DEFAULTCOOLINGRATE
See Also:
Constant Field Values

DEFAULTITERATIONS

public static final int DEFAULTITERATIONS
See Also:
Constant Field Values

DEFAULTOLERANCE

public static final double DEFAULTOLERANCE
See Also:
Constant Field Values
Constructor Detail

AnnealingScheme

public AnnealingScheme()
Method Detail

setTemperature

public void setTemperature(double temperature)
Sets the Temperature attribute of the AnnealingScheme object

Parameters:
temperature - The new Temperature value

setTolerance

public void setTolerance(double tolerance)
Sets the Tolerance attribute of the AnnealingScheme object. The annealing stops once the return values from the ObjectiveFunction varies by less than the tolerance.

Parameters:
tolerance - The new Tolerance value

setSolution

public void setSolution(double[] offset)
Sets a starting point for searching for a solution

Parameters:
offset - The new Offset value. To reduce API tripwires, the offset is duplicated, i.e. the caller can safely modify the passed in offset it afterwards.

setCoolingRate

public void setCoolingRate(double coolingRate)
Sets the CoolingRate attribute of the AnnealingScheme object

Parameters:
coolingRate - The new CoolingRate value

setIterations

public void setIterations(int nIterations)
Number of iterations before cooling is applied

Parameters:
nIterations - The new NIterations value

getSolution

public double[] getSolution()
Returns:
list of currently best solution. This is a duplicate array that the caller "owns"

setFunction

public void setFunction(ObjectiveFunction function)
Parameters:
function -

anneal

public void anneal()
runs an annealing, call getOffset() to get result