org.decisiondeck.xmcda_oo.structure
Class IntegerStepScaleToDel

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.structure.OrderedInterval
      extended by org.decisiondeck.xmcda_oo.structure.IntegerStepScaleToDel
All Implemented Interfaces:
IOrderedInterval

public class IntegerStepScaleToDel
extends OrderedInterval

An immutable object.


Constructor Summary
IntegerStepScaleToDel(Criterion criterion, int worstValue, int bestValue)
          Note that best must be better or equal to worst.
IntegerStepScaleToDel(Criterion criterion, int worstValue, int bestValue, int increment)
          Note that best must be better or equal to worst.
 
Method Summary
 int getBestInt()
           
 int getClosestInt(double value)
           
 int getIncrementInt()
           
 int getMaximumInt()
           
 int getMinimumInt()
           
 int getNbSteps()
           
 int getWorstInt()
           
 Integer improveInt(int current)
          Returns the closest value to the one given which is better than the one given, if possible.
 double improveInt(int start, double improvement)
           
 boolean inScaleBoundaries(double value)
           
 boolean inScaleStrictInt(double value)
           
 double worsenInt(int start, double worsening)
           
 
Methods inherited from class org.decisiondeck.xmcda_oo.structure.OrderedInterval
equals, getAsDiscreteInterval, getAsIntegerStepScale, getBest, getDirectionAsSign, getMaximum, getMinimum, getPreferenceDirection, getStepSize, getWorst, hashCode, isInteger, newDirection, newDiscreteInterval, newInterval, newMaximizeDirection, newMinimizeDirection, newRealsInterval, newUnrestrictedInterval, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerStepScaleToDel

public IntegerStepScaleToDel(Criterion criterion,
                             int worstValue,
                             int bestValue)
Note that best must be better or equal to worst.

Parameters:
criterion - the criterion this scale relates to. Not null.
worstValue - the worst value this scale accepts (thus worst included).
bestValue - the best value this scale accepts (thus best included).

IntegerStepScaleToDel

public IntegerStepScaleToDel(Criterion criterion,
                             int worstValue,
                             int bestValue,
                             int increment)
Note that best must be better or equal to worst.

Parameters:
criterion - the criterion this scale relates to. Not null.
worstValue - the worst value this scale accepts (thus worst included).
bestValue - the best value this scale accepts (thus best included).
increment - a positive number indicating the increment (or decrement, depending on the preference direction) when going from one point of the scale to an other one. E.g. if the scale starts at 3, and the criterion is to be maximized, an increment of 5 would mean that the point after 3 on the scale will be 8. The user is responsible for asking for points on the scale that exist, i.e. in this example asking for a point better than 4 is meaningless (that evaluation does not exist on that scale). If best value = worst value (thus this scale has only one point), any positive increment is accepted.
Method Detail

getBestInt

public int getBestInt()

getWorstInt

public int getWorstInt()

improveInt

public Integer improveInt(int current)
Returns the closest value to the one given which is better than the one given, if possible.

Parameters:
current - the value to start from.
Returns:
null iff there is no value better that the one given in this scale.

getIncrementInt

public int getIncrementInt()
Returns:
a positive number. If this scale has only one value, 1 is returned (irrespective of what increment has been given originally).

inScaleBoundaries

public boolean inScaleBoundaries(double value)
Parameters:
value - any value.
Returns:
true iff the given value lies inside this scale. It must not necessarily by exactly on one of this scale's step, just inside (or on) the boundaries.

worsenInt

public double worsenInt(int start,
                        double worsening)

inScaleStrictInt

public boolean inScaleStrictInt(double value)
Parameters:
value - any value.
Returns:
true iff the given value is exactly a step on this scale. If the return is true , this implies that the given value is an integer and lies into this scale's boundaries.

improveInt

public double improveInt(int start,
                         double improvement)

getMinimumInt

public int getMinimumInt()
Returns:
the worst value, if this scale has a MAX preference direction ; otherwise the best value.

getNbSteps

public int getNbSteps()
Returns:
the number of steps this scale holds. At least one.

getMaximumInt

public int getMaximumInt()
Returns:
the best value, if this scale has a MAX preference direction ; otherwise the worst value.

getClosestInt

public int getClosestInt(double value)
Parameters:
value - the value to start from.
Returns:
the value belonging to this scale which is the closest to the given value.


Copyright © 2011. All Rights Reserved.