Package edu.kit.mcda.core.normalization
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
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Reset the changes flag.abstract AbstractNormalization
clone()
double
doNormalize
(Criterion _criterion, double _value) Normalizes and afterwards equalizes by limiting the sum of the normalizations to 1.abstract org.jdom2.Element
Exports the normalisation parameters to a XML node.abstract double[]
getDomainRange
(Criterion _criterion) Get the actual range of the domain to which the values are normalised.Get the XML tag of the master node containing the normalisation parameters.double[]
boolean
Check if changes have been made.abstract void
importFromXML
(org.jdom2.Element _element) Imports the normalisation parameters from a specified XML node.boolean
Equalise normalised values in a way they sum to 1.Normalize all values contained in the passed criterion.abstract double
Normalize a single values according to the values contained in the passed criterion.normalize
(Criterion _criterion, Collection<Double> _values) Normalize a list of values according to the values contained in the passed criterion.protected int
protected int
rankValues
(Criterion _criterion) rankValues
(Criterion _criterion, ArrayList<Double> _include) void
Set that changes have been made.void
setHarmonise
(boolean _harmonise) Equalise normalised values in a way they sum to 1.toString()
-
Constructor Details
-
AbstractNormalization
public AbstractNormalization()Constructor of AbstractNormalize. No parameters required. Calls preInit(), init() and postInit();
-
-
Method Details
-
clone
-
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
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
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
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
Normalizes and afterwards equalizes by limiting the sum of the normalizations to 1. Delegates tonormalize(Criterion, double)
.- Parameters:
_criterion
- the criterion to equalize a value from_value
- the value to be equalized- Returns:
- the equalized value
-
getPlot
-
getDomainRange
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
-
rankIndex
-
rankValues
-
rankValues
-
toString
-