|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdatabionics.esom.cooling.Cooling
databionics.esom.cooling.CachedCooling
public abstract class CachedCooling
Abstract base class for cooling of a parameter with a cache of precalculated values. Subclasses have to override the calculate(int step) method and might want to override the init() method. Make sure to call super.init() as the last command in init() to initialize the cache.
Field Summary | |
---|---|
protected cern.colt.matrix.DoubleMatrix1D |
cache
cache with precalculated values of the parameter |
protected static org.apache.log4j.Logger |
log
interface to log4j system |
protected int |
offset
step number of first element of cache |
Fields inherited from class databionics.esom.cooling.Cooling |
---|
end, start, steps |
Constructor Summary | |
---|---|
CachedCooling()
Create a new cooling object with default parameters start = 1.0,steps = 100,end = 0.0, size = 100 |
|
CachedCooling(double start,
int steps,
double end)
Create a new cooling object with cache size equals to steps. |
|
CachedCooling(double start,
int steps,
double end,
int size)
Create a new cooling object |
Method Summary | |
---|---|
protected void |
fillCache(int offset)
Fill the cache with precalculated values. |
double |
get(int step)
Get value of parameter by the step number. |
protected void |
init()
Initialize the cache |
Methods inherited from class databionics.esom.cooling.Cooling |
---|
calculate, getAsInt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger log
protected cern.colt.matrix.DoubleMatrix1D cache
protected int offset
Constructor Detail |
---|
public CachedCooling()
public CachedCooling(double start, int steps, double end)
start
- Initial value of the parametersteps
- Steps towards the final value of the parameterend
- Final value of the parameterpublic CachedCooling(double start, int steps, double end, int size)
start
- Initial value of the parametersteps
- Steps towards the final value of the parameterend
- Final value of the parametersize
- Size of cache with precalculated valuesMethod Detail |
---|
protected void init()
offset
- protected void fillCache(int offset)
offset
- public double get(int step)
get
in class Cooling
step
- current step ([0..steps-1])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |