databionics.esom.cooling
Class Cooling

java.lang.Object
  extended by databionics.esom.cooling.Cooling
Direct Known Subclasses:
CachedCooling, NoCooling

public abstract class Cooling
extends java.lang.Object

Abstract base class for cooling of a parameter. Subclasses need to override the calculate(int step) method.


Field Summary
protected  double end
          final value of the parameter
protected static org.apache.log4j.Logger log
          interface to log4j system
protected  double start
          initial value of the parameter
protected  int steps
          number of steps toward the final value of the parameter
 
Constructor Summary
Cooling()
          Create a new cooling object with default parameters start = 1.0,steps = 100,end = 0.0
Cooling(double start, int steps, double end)
          Create a new cooling object
 
Method Summary
protected abstract  double calculate(int step)
          Calculate the parameter value for this step.
 double get(int step)
          Get value of parameter by the step number.
 int getAsInt(int step)
          Get value of parameter rounded to the nearest int
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
interface to log4j system


start

protected double start
initial value of the parameter


steps

protected int steps
number of steps toward the final value of the parameter


end

protected double end
final value of the parameter

Constructor Detail

Cooling

public Cooling()
Create a new cooling object with default parameters start = 1.0,steps = 100,end = 0.0


Cooling

public Cooling(double start,
               int steps,
               double end)
Create a new cooling object

Parameters:
start - Initial value of the parameter
steps - Steps towards the final value of the parameter
end - Final value of the parameter
Method Detail

calculate

protected abstract double calculate(int step)
Calculate the parameter value for this step. Override this method in subclasses.

Parameters:
step - current step ([0..steps-1])

get

public double get(int step)
Get value of parameter by the step number. If step <= 0 the initial value is returned. If step >= step-1 the final value is returned.

Parameters:
step - current step ([0..steps-1])
Returns:
Parameter value for this step

getAsInt

public int getAsInt(int step)
Get value of parameter rounded to the nearest int

Parameters:
step - current step ([0..steps-1])
Returns:
Parameter value for this step


Copyright © 2005-2006 Databionics Research Group. All Rights Reserved.