net.sf.opendse.model.parameter
Class ParameterRange

java.lang.Object
  extended by net.sf.opendse.model.parameter.ParameterRange
All Implemented Interfaces:
Parameter

public class ParameterRange
extends java.lang.Object
implements Parameter

The ParameterRange is a double-valued parameter wihtin a lower and an upper bound.


Field Summary
protected  double granularity
           
protected  double lb
           
protected  double ub
           
protected  double value
           
 
Constructor Summary
ParameterRange(double value, double lb, double ub)
          Constructs a ParameterRange.
ParameterRange(double value, double lb, double ub, double granularity)
          Constructs a ParameterRange.
 
Method Summary
 double getLowerBound()
          Returns the lower bound.
 double getUpperBound()
          Returns the upper bound.
 java.lang.Object getValue()
          Returns the current value of the parameter.
 double normalizeValue(double value)
          Normalizes the value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected final double value

lb

protected final double lb

ub

protected final double ub

granularity

protected final double granularity
Constructor Detail

ParameterRange

public ParameterRange(double value,
                      double lb,
                      double ub)
Constructs a ParameterRange.

Parameters:
value - the default value
lb - the lower bound
ub - the upper bound

ParameterRange

public ParameterRange(double value,
                      double lb,
                      double ub,
                      double granularity)
Constructs a ParameterRange.

Parameters:
value - the default value
lb - the lower bound
ub - the upper bound
granularity - the granularity (step-size)
Method Detail

getLowerBound

public double getLowerBound()
Returns the lower bound.

Returns:
the lower bound

getUpperBound

public double getUpperBound()
Returns the upper bound.

Returns:
the upper bound

getValue

public java.lang.Object getValue()
Description copied from interface: Parameter
Returns the current value of the parameter.

Specified by:
getValue in interface Parameter
Returns:
the parameter value

normalizeValue

public double normalizeValue(double value)
Normalizes the value.

Parameters:
value - the value
Returns:
the normalized value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object