Class AbstractNormalization

java.lang.Object
edu.kit.mcda.core.normalization.AbstractNormalization
Direct Known Subclasses:
AutoSoftmax, Exponential, Linear, PeakLinear, PiecewiseLinear, Proportional, Raw, Sigmoid, Softmax, Topsis, Vector

public abstract class AbstractNormalization extends Object
This is the base class for all normalisation classes. In this class the methods are defined to create a normalised value from a value. The specific rules how to achieve this are explictly implemented by the subclasses. Parameters are used by implementing according interfaces from the parameter package.
Author:
Tim Mueller
See Also:
  • Constructor Details

    • AbstractNormalization

      public AbstractNormalization()
      Constructor of AbstractNormalize. No parameters required. Calls preInit(), init() and postInit();
  • Method Details

    • clone

      public abstract AbstractNormalization clone()
      Overrides:
      clone in class Object
    • getNodeTag

      public String getNodeTag()
      Get the XML tag of the master node containing the normalisation parameters. Used to import and export the parameters of the normalisation class.
      Returns:
      the tag of the master node
    • importFromXML

      public abstract void importFromXML(org.jdom2.Element _element)
      Imports the normalisation parameters from a specified XML node.
      Parameters:
      _element - the XML node to import the paramters from
    • exportToXML

      public abstract org.jdom2.Element exportToXML()
      Exports the normalisation parameters to a XML node.
      Returns:
      an XML node containing the parameters of this normalisation method
    • hasChanged

      public boolean hasChanged()
      Check if changes have been made. Returns true if changes have been registered.
      Returns:
      the status of the changed flag
    • setChanged

      public void setChanged()
      Set that changes have been made. Sets changed flag to true to register changes.
    • clearChanged

      public void clearChanged()
      Reset the changes flag. Set the changed flag to false.
    • isHarmonise

      public boolean isHarmonise()
      Equalise normalised values in a way they sum to 1.
      Returns:
      the equalise
    • setHarmonise

      public void setHarmonise(boolean _harmonise)
      Equalise normalised values in a way they sum to 1.
      Parameters:
      _harmonise - the equalise value to set
    • normalize

      public abstract double normalize(Criterion _criterion, double _value)
      Normalize a single values according to the values contained in the passed criterion.
      Parameters:
      _criterion - the criterion which is referred to for normalisation
      _value - the value to be normalised
      Returns:
      the normalised value according to the the values of the criterion
    • normalize

      public LinkedHashMap<String,Double> normalize(Criterion _criterion)
      Normalize all values contained in the passed criterion. Returns a list of normalised values of the passed criterion in the same order as they appear in the criterion. The keys of the map are the UUIDs of the alternatives.
      Parameters:
      _criterion - the criterion for which all values should be normalised
      Returns:
      map of normalized values
    • normalize

      public ArrayList<Double> normalize(Criterion _criterion, Collection<Double> _values)
      Normalize a list of values according to the values contained in the passed criterion. Returns a list with normalised values in the same order as in the input list
      Parameters:
      _criterion - the criterion which is referred to for normalisation
      _values - the list of values to be normalised
      Returns:
      a list of normalised values
    • doNormalize

      public double doNormalize(Criterion _criterion, double _value)
      Normalizes and afterwards equalizes by limiting the sum of the normalizations to 1. Delegates to normalize(Criterion, double).
      Parameters:
      _criterion - the criterion to equalize a value from
      _value - the value to be equalized
      Returns:
      the equalized value
    • getPlot

      public double[] getPlot(Criterion _criterion, double[] _samplePoints)
    • getDomainRange

      public abstract double[] getDomainRange(Criterion _criterion)
      Get the actual range of the domain to which the values are normalised. This is sometimes explicitly set and sometimes computed from the criteria values themselves.
      Parameters:
      _criterion - the criterion for which the domain range is requested
      Returns:
      an array containing the lower and upper bound of the domain
    • rankIndex

      protected int rankIndex(Criterion _criterion, double _value)
    • rankIndex

      protected int rankIndex(Criterion _criterion, ArrayList<Double> _include, double _value)
    • rankValues

      protected ArrayList<Double> rankValues(Criterion _criterion)
    • rankValues

      protected ArrayList<Double> rankValues(Criterion _criterion, ArrayList<Double> _include)
    • toString

      public String toString()
      Overrides:
      toString in class Object