savi.alg
Class SimAnnealingSkeleton

java.lang.Object
  extended by savi.alg.SimAnnealingSkeleton
Direct Known Subclasses:
SimAnnealingBasicSolver

public abstract class SimAnnealingSkeleton
extends java.lang.Object

Basic abstract class for solvers. Solver should be derived from this class if it will be used with other SAVi modules.


Field Summary
protected  double coolFactor
          Cooling factor specified by parameter in constructor
protected  double finalTemp
          Final temperature specified by parameter in constructor
protected  StateSkeleton state
          Contain reference to current state.
protected  double temp
          Current temperature
 
Constructor Summary
SimAnnealingSkeleton(StateSkeleton s, double temp, double finalTemp, double coolFactor)
          Creates a new instance of SimAnnealingSkeleton, initialize protected variables.
 
Method Summary
protected abstract  void cool()
          This must be implemented, call this function lowers current temperature.
protected abstract  void equilibrium()
          It must be implemented.
protected abstract  boolean frozen()
          It must be implemented.
 StateSkeleton getState()
          Return current state of this algorithm.
 double getTemp()
          Returns current temperature
abstract  StateSkeleton solve()
          Must be implemented, it should solve problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected StateSkeleton state
Contain reference to current state.


temp

protected double temp
Current temperature


finalTemp

protected double finalTemp
Final temperature specified by parameter in constructor


coolFactor

protected double coolFactor
Cooling factor specified by parameter in constructor

Constructor Detail

SimAnnealingSkeleton

public SimAnnealingSkeleton(StateSkeleton s,
                            double temp,
                            double finalTemp,
                            double coolFactor)
Creates a new instance of SimAnnealingSkeleton, initialize protected variables.

Parameters:
s - Initial state
temp - Starting temperature value
finalTemp - Final temperature value.
coolFactor - Cooling factor
Method Detail

getState

public StateSkeleton getState()
Return current state of this algorithm.

Returns:
current state of this algorithm.

getTemp

public double getTemp()
Returns current temperature

Returns:
Current temperature

cool

protected abstract void cool()
This must be implemented, call this function lowers current temperature.


equilibrium

protected abstract void equilibrium()
It must be implemented. Do iteration of equilibrium cycle with constant temperature.


frozen

protected abstract boolean frozen()
It must be implemented. This function can be called to recognition end of algorithm run.

Returns:
return true if algorithm finish all work.

solve

public abstract StateSkeleton solve()
Must be implemented, it should solve problem.

Returns:
solution