Package edu.kit.mcda.core
Class Goal
java.lang.Object
edu.kit.mcda.core.Goal
- All Implemented Interfaces:
Changed
,Description
,Dye
,Identifier
,Label
,MetaInformation
The top level class to contain a MCDA problem and provide a solution.
Contains criteria, alternatives and an absolute weighting as well as means to compute a solution.
- Author:
- Tim Mueller
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Reflects the state after importing data. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAlternative
(Alternative _alternative) Add a alternative to the set of alternatives.void
addAlternative
(String _identifier, Alternative _alternative) Add an alternative to the set of alternatives.void
addChangedListener
(Changed _listener) void
addCriterion
(Criterion _criterion) Add a criterion to the set of criteria.void
addCriterion
(Criterion _criterion, CriterionGroup _group) Add a criterion to the set of criteria and add it to the specified group.void
addCriterion
(String _identifier, Criterion _criterion) Add a criterion to the set of criteria.void
addCriterion
(String _identifier, Criterion _criterion, CriterionGroup _group) Add a criterion to the set of criteria and add it to the specified group.void
addParameter
(Parameter _parameter) double
analyse
(Alternative _alternative, CriterionGroup _group, double _weightFactor) Analyse the stability of criterion by only partially including it into the final solution.double
analyse
(Alternative _alternative, CriterionGroup _group, double _weightFactor, boolean _normalize) Analyse the stability of criterion by only partially including it into the final solution.double
analyse
(Alternative _alternative, Criterion _criterion, double _weightFactor) Analyse the stability of criterion by only partially including it into the final solution.double
analyse
(Alternative _alternative, Criterion _criterion, double _weightFactor, boolean _normalize) Analyse the stability of criterion by only partially including it into the final solution.Analyse the stability of criterion by only partially including it into the final solution.Analyse the stability of criterion by only partially including it into the final solution.void
void
changeWeightSetOrigin
(String _id, WeightSetData.WeightSetOrigin _origin) void
Remove all alternatives from the set of alternatives.void
void
Remove all criteria from the set of criteria.protected void
protected void
void
void
clone()
Create a clone of this goal.boolean
containsAlternative
(String _identifier) Check if a criterion is referenced by an identifier.boolean
containsCriterion
(String _identifier) Check if a criterion is referenced by an identifier.void
cpWeightingSets2Group
(CriterionGroup _group) static Goal
create
(org.jdom2.Element _masterNode) createAverageWeightingSet
(String _idWeightingSet, String _label, ArrayList<String> _weightSetsList) createHistogramWeightingSet
(String _idWeightingSet, String _label, LinkedHashMap<String, Double> _factorList) createWeightSet
(String _weightSetID, String _label, WeightSetData.WeightSetOrigin _origin) Creates id and calls function to create new weighting set.void
Set weights in a way that all criteria have the same impact.void
Set weights in a way that all criteria have the same impact.org.jdom2.Element
exportGroupAsMCDA
(CriterionGroup _group) org.jdom2.Element
Export the group structure as XML document.org.jdom2.Element
Export the parameters as XML document.void
exportParameters
(File _file) Export the parameters to file as XML.void
exportParameters
(OutputStream _outputStream) Export the parameters to an output stream as XML.org.jdom2.Document
Create a XML document containing the resolved MCDA.void
exportResults
(File _file) Export the results to file as XML.void
exportResults
(OutputStream _outputStream) Export the results to an output stream as XML.org.jdom2.Document
void
exportToXML
(File _file) Exports the all MCDA data to a specified file The call is delegated toexportToXML()
.void
exportToXML
(OutputStream _outputStream) Exports the all MCDA data to a specified stream.org.jdom2.Document
Exports the all MCDA data to a XML document.org.jdom2.Element
exportValues
(boolean _header) Export the criteria values as XML document.void
exportValues
(File _file) Export the criteria values to file as XML.void
exportValues
(OutputStream _outputStream) Export the criteria values to an output stream as XML.org.jdom2.Element
exportWeighting
(boolean _header) void
exportWeighting
(File _file) Exports the weighting to a specified file The call is delegated toexportWeighting(OutputStream)
.void
exportWeighting
(OutputStream _outputStream) Exports the weighting to a specified stream.org.jdom2.Element
Exports the weighting to a XML document.Get the aggregator used to aggregateSingle the criteria values and weights to a final number.getAlternative
(String _identifier) Get the alternative linked to the identifier.Get a list of all alternatives in this goal.Get a list of all criteria.TODO not sure if using AHP is valid heregetCriterion
(String _identifier) Get a criterion by its identifier.double
getDegradationWeight
(Criterion _criterion) Get the degradation weight of a criterion.double
getDegradationWeight
(CriterionGroup _group) Get the normalised weight of a criterion group.getDescendantGroups
(CriterionGroup _group) Get all descendant-groups of the specified groups.getDescendants
(CriterionGroup _group) Get all descendants of the specified groups.Get the default description without reference to a language.getDescription
(String _language) Get the description in reference to the given language.Get all descriptions with reference to a language.getDye()
Get the dedicated color to use within the context.Get the root group of the groups tree.Get a unique identifier.getIdWeightingSet
(String _label) getLabel()
Get the default label without reference to a language.Get the label in reference to the given language.Get all labels with reference to a language.getMetaInformation
(String _identifier) double
getNormalisedRelativeWeight
(Criterion _criterion) Get the normalised relative weight of a criterion.double
Get the relative weight of a criterion group.double
getNormalisedWeight
(Criterion _criterion) Get the normalised weight of a criterion.double
getNormalisedWeight
(CriterionGroup _group) Get the normalised weight of a criterion group.double[]
getNormalizedWeights
(CriterionGroup _group, ArrayList<Double> _relativeWeights) double[]
getNormalizedWeights
(Criterion _criterion, ArrayList<Double> _relativeWeights) getParameter
(String _id) double
getRankedCorrelation
(Criterion _criterion1, Criterion _criterion2) getRankMap
(Criterion _criterion) double
getRelativeWeight
(Criterion _criterion) Get the relative weight of a criterion.double
getRelativeWeight
(CriterionGroup _group) Get the relative weight of a criterion group.getStabilityScan
(String _identifier, double _start, double _end, double _sampleCount, boolean _fractionScan, boolean _renormalize) getStabilityScans
(String _criterionIdentifier, String _alternativeIdentifier, double _minimum, double _maximum, double _sampleCount) Get the stored version-tag Is stored in xml-file.double
Get the absolute weight of the given criterion.getWeightFunctions
(String _idWeightingSet) Get a list of all weight functions of the same weightingsetgetWeightSetData
(String _id) getWeightSetOrigin
(String _id) groupsGetGroup
(String _identifier) Search for a specific group in the groups tree.Get a list of all groups in the groups tree.groupsGetGroups
(boolean _excludeRoot) Get a list of all groups in the groups tree.Get a map mapping identifiers to corresponding groups in the groups tree.int
Get the maximum level of a group in the groups tree.int
groupsGetTier
(String _identifier) Get the level of the referenced group.boolean
groupsIsCriterion
(String _identifier) Check if an entity with the specified identifier is a criterion.boolean
groupsIsGroup
(String _identifier) Check if an entity with the specified identifier is a group.void
Add criterion to the root of the group graph.void
groupsPut
(CriterionGroup _group) Add group to the root of the group graph.void
groupsPut
(CriterionGroup _parent, Criterion _criterion) Add a criterion to the parent of the group graph.void
groupsPut
(CriterionGroup _parent, CriterionGroup _group) Add group to the parent of the group graph.boolean
Get the status of the changed flag.boolean
hasChanged
(boolean _includeComponents) Get the status of the changed flag.boolean
TODO not sure if using AHP is valid hereboolean
hasParameter
(String _id) boolean
boolean
hasWeightConstantFunction
(String _identifier) boolean
hasWeightFunction
(Criterion _criterion) Check if the given criterion is linked to a weight function.boolean
hasWeightFunction
(String _identifier) Check if the given criterion or group is linked to a weight function.boolean
hasWeightFunction
(String _identifier, String _labelWeighting) importFromXML
(File _file) Imports all MCDA data from a specified file.importFromXML
(InputStream _inputStream) Imports all MCDA data from a stream.importFromXML
(org.jdom2.Document _document) Imports all MCDA data from a specified document.importFromXML
(org.jdom2.Element _masterNode) importFromXML_before_7_4
(org.jdom2.Element _masterNode) Imports all MCDA data from a specified element node.importFromXML_before_9_4
(org.jdom2.Element _masterNode) void
importParameters
(File _file) Import the parameters from file.void
importParameters
(InputStream _inputStream) Import the parameters from an input stream.void
importParameters
(org.jdom2.Document _document) Import the parameters from a XML document.void
importParameters
(org.jdom2.Element _masterNode) Import the parameters from a XML node.void
importValues
(File _file) Import the criteria values from file.void
importValues
(InputStream _inputStream) Import the criteria values from an input stream.void
importValues
(org.jdom2.Document _document) Import the criteria values from a XML document.void
importValues
(org.jdom2.Element _masterNode) Import the criteria values from a XML node.void
importWeighting
(File _file) Import the weighting from file.void
importWeighting
(InputStream _inputStream) Import the weighting from an input stream.void
importWeighting
(org.jdom2.Document _document) Import the weighting from a XML document.void
importWeighting
(org.jdom2.Element _masterNode) void
importWeighting_before_7_4
(org.jdom2.Element _masterNode) Import the weighting from a XML node.boolean
boolean
boolean
boolean
boolean
Check if any weight is non constant functional.void
moveCriterion
(Criterion _criterion, CriterionGroup _group) Move a criterion to another groupvoid
removeAlternative
(Alternative _alternative) Remove an alternative from the set of alternatives.void
removeAlternative
(String _identifier) Remove an alternative from the set of alternatives.void
removeChangedListener
(Changed _listener) void
removeCriterion
(Criterion _criterion) Remove a criterion from the set of criteria.void
removeCriterion
(String _identifier) Remove a criterion from the set of criteria.void
removeParameter
(Parameter _parameter) void
removeParameter
(String _id) void
removeWeightSet
(String _weightSetID) renameWeightSet
(String _oldLabel, String _newLabel) resolve()
Resolve and get a list for all alternatives.resolve
(boolean _sort, boolean _ascending) Resolve and get a list for all alternatives.double
resolve
(Alternative _alternative) Resolve and get the result for the given alternative.double
resolve
(Alternative _alternative, Criterion _criterion) Resolve and get the result for the given alternative.double
resolve
(Alternative _alternative, CriterionGroup _group) Resolve and get the result for the given alternative.Resolve and get a list for all alternatives.resolve
(CriterionGroup _group) Resolve and get a list for all alternatives.resolve
(CriterionGroup _group, boolean _sort, boolean _ascending) Resolve and get a list for all alternatives.Resolve and get a list for all alternatives.searchForAlternative
(String _label) Get the first alternative labeled according to the given label.searchForAlternative
(String _label, String _language) Get the first alternative labeled according to the given label.searchForCriterion
(String _label) Get the first criterion labeled according to the given label.searchForCriterion
(String _label, String _language) Get the first criterion labeled according to the given label.searchForGroup
(String _label) Search for a group by its label.searchForGroup
(String _label, String _language) Get the first group labeled according to the given label.void
setAggregator
(AbstractAggregation _aggregator) Set the aggregator to be used to aggregateSingle the criteria values and weights to a final number.void
setChanged
(boolean _changed) Set the status of the changed flag.void
setCriteriaAHP
(AHP _ahp) TODO not sure if using AHP is valid herevoid
setDescription
(String _description) Set the default description.void
setDescription
(String _language, String _description) Set a description for the given language.void
Set the dedicated color to use within the context.void
setEqualize
(boolean _equalize) void
setIdentifier
(String _identifier) Set a unique identifier.void
Set the default label.void
Set a label for the given language.void
setRelativeWeight
(CriterionGroup _group, double _weight) Set the relative weight of a criterion group.void
setRelativeWeight
(CriterionGroup _group, double _weight, String _idWeightingSet) Set the relative weight of a criterion group.void
setRelativeWeight
(CriterionGroup _group, ValueFunction _weightFunction) Set the relative weight function of a criterion group.void
setRelativeWeight
(CriterionGroup _group, ValueFunction _weightFunction, String _idWeightingSet) void
setRelativeWeight
(Criterion _criterion, double _weight) Set the relative weight of a criterion.void
setRelativeWeight
(Criterion _criterion, double _weight, String _idWeightingSet) Set the relative weight of a criterion.void
setRelativeWeight
(Criterion _criterion, ValueFunction _weightFunction) Set the relative weight function of a criterion.void
setRelativeWeight
(Criterion _criterion, ValueFunction _weightFunction, String _idWeightingSet) Set the relative weight function of a criterion.void
setTimestamp
(LocalDateTime _timestamp) void
setWeightFunctions
(LinkedHashMap<String, ValueFunction> _weightset, String _idWeightingSet) void
setWeights
(LinkedHashMap<String, Double> _weightset, String _idWeightingSet) void
setWeightSet
(String _weightSetID) void
setWeightSetData
(String _id, WeightSetData _weightSetData) toString()
Create a string to verbose the content of this goal.void
-
Constructor Details
-
Goal
public Goal()Parameterless constructor. Delegates to several different initialization methods.
-
-
Method Details
-
create
-
clone
Create a clone of this goal. USED TO CACHE A CLONE OBJECT BUT CAUSED CONCURRENT EXCEPTIONS. No cache used anymore, creates a new object each time it is called. Uses importToXML and exportFromXML to easily clone the current goal. -
getMetaInformation
-
hasTimestamp
public boolean hasTimestamp() -
getTimestamp
-
setTimestamp
-
addCriterion
Add a criterion to the set of criteria. The criterion is referenced by its identifier.- Parameters:
_criterion
- the criterion to be added
-
addCriterion
Add a criterion to the set of criteria and add it to the specified group. The criterion is referenced by its identifier.- Parameters:
_criterion
- the criterion to be added_group
- the group to add the criterion to
-
addCriterion
Add a criterion to the set of criteria. The criterion is included in the hierarchy of criteria. Missing alternatives will be added using a default value. A default weight is added. Existing weights are overridden.- Parameters:
_identifier
- the identifier the criterion is referenced to_criterion
- the criterion to be added
-
addCriterion
Add a criterion to the set of criteria and add it to the specified group. The criterion is included in the hierarchy of criteria. Missing alternatives will be added using a default value. A default weight is added. Existing weights are overridden.- Parameters:
_identifier
- the identifier the criterion is referenced to_criterion
- the criterion to be added_group
- the group to add the criterion to
-
containsCriterion
Check if a criterion is referenced by an identifier.- Parameters:
_identifier
- the identifier of the criterion to be checked- Returns:
- true if a criterion is referenced by the identifier
-
getCriterion
Get a criterion by its identifier. Returns null if no criterion is referenced by the identifier.- Parameters:
_identifier
- the identifier of the criterion to be retrieved- Returns:
- the desired criterion or null
-
getCriteria
Get a list of all criteria. The list is copied from the original list. The entries are not copied.- Returns:
- the list of all criteria
-
removeCriterion
Remove a criterion from the set of criteria. The criterion is referenced by its identifier.- Parameters:
_criterion
- the criterion to be removed
-
removeCriterion
Remove a criterion from the set of criteria.- Parameters:
_identifier
- the identifier of the criterion to be removed
-
clearCriteria
public void clearCriteria()Remove all criteria from the set of criteria. -
moveCriterion
Move a criterion to another group -
getAggregator
Get the aggregator used to aggregateSingle the criteria values and weights to a final number.- Returns:
- the aggregator used for aggregation
-
setAggregator
Set the aggregator to be used to aggregateSingle the criteria values and weights to a final number.- Parameters:
_aggregator
- the aggregator that should be used for aggregation
-
addAlternative
Add a alternative to the set of alternatives. The alternative is referenced by its identifier.- Parameters:
_alternative
- the alternative to be added
-
addAlternative
Add an alternative to the set of alternatives. If missing the alternative will be added to criteria using a default value.- Parameters:
_identifier
- the identifier the alternative is referenced to_alternative
- the alternative to be added
-
containsAlternative
Check if a criterion is referenced by an identifier.- Parameters:
_identifier
- the identifier of the criterion to be checked- Returns:
- true if a criterion is referenced by the identifier
-
getAlternative
Get the alternative linked to the identifier.- Parameters:
_identifier
- the identifier for the desired alternative- Returns:
- the alternative linked to the identifier
-
getAlternatives
Get a list of all alternatives in this goal. The list is shallow copied.- Returns:
- a list of all alternatives
-
removeAlternative
Remove an alternative from the set of alternatives. Delegates toremoveAlternative(java.lang.String)
.- Parameters:
_alternative
- the alternative to remove
-
removeAlternative
Remove an alternative from the set of alternatives. The alternative will be removed from the criteria.- Parameters:
_identifier
- the identifier the alternative is referenced to
-
clearAlternatives
public void clearAlternatives()Remove all alternatives from the set of alternatives. -
getGroupsRoot
Get the root group of the groups tree.- Returns:
- the root group of the groups tree
-
groupsPut
Add group to the root of the group graph. The root is this goal.- Parameters:
_group
- the group to be added
-
groupsPut
Add criterion to the root of the group graph. The root is this goal. If the criterion has a parent already it is moved to the new location.- Parameters:
_criterion
- the criterion to addGroup to the graph
-
groupsPut
Add group to the parent of the group graph.- Parameters:
_parent
- the group to which the criterion group is added_group
- the criterion group to be added
-
groupsPut
Add a criterion to the parent of the group graph.- Parameters:
_parent
- the group to which the criterion is added_criterion
- the criterion to be added
-
groupsGetGroup
Search for a specific group in the groups tree. If no such group is found null is returned.- Parameters:
_identifier
- the identifier of the desired group- Returns:
- the group with the identifier or null if not found
-
groupsGetGroups
Get a list of all groups in the groups tree. Includes root group.- Returns:
- the list of all groups
-
groupsGetGroups
Get a list of all groups in the groups tree. May include root group if _excludeRoot is false.- Returns:
- the list of all groups with or without root
-
groupsGetGroupsMap
Get a map mapping identifiers to corresponding groups in the groups tree. Includes root group.- Returns:
- a map of identifiers to groups
-
getDescendants
Get all descendants of the specified groups. These are more entities in contrast to only get the children. This method is recursive.- Parameters:
_group
- the specific group to get all descendants of- Returns:
- the list of all descendants of the specified group
-
getDescendantGroups
Get all descendant-groups of the specified groups. These are more entities in contrast to only get the children. This method is recursive.- Parameters:
_group
- the specific group to get all descendants of- Returns:
- the list of all descendant-groups of the specified group
-
groupsIsCriterion
Check if an entity with the specified identifier is a criterion. It could be for example a group or alternative.- Parameters:
_identifier
- the identifier of the entity to check- Returns:
- true if the referenced entity is a criterion
-
groupsIsGroup
Check if an entity with the specified identifier is a group. It could be for example a criterion or alternative.- Parameters:
_identifier
- the identifier of the entity to check- Returns:
- true if the referenced entity is a group
-
groupsGetTier
Get the level of the referenced group. The root has tier 0. If the referenced group is not found -1 is returned.- Parameters:
_identifier
- the group which tier is requested- Returns:
- the level of the group or -1 if not found
-
groupsGetMaxTier
public int groupsGetMaxTier()Get the maximum level of a group in the groups tree. This is equivalent to the maximum path length.- Returns:
- the maximum level of a group
-
hasWeightFunction
Check if the given criterion or group is linked to a weight function.- Parameters:
_identifier
- the identifier of the criterion or group to be checked- Returns:
- true if linked to a weight
-
hasWeightFunction
-
hasWeightConstantFunction
-
hasWeightFunction
Check if the given criterion is linked to a weight function.- Parameters:
_criterion
- the criterion to be checked- Returns:
- true if the criterion is linked to a weight
-
getWeight
Get the absolute weight of the given criterion. The absolute weights areupdated
beforehand if necessary.- Parameters:
_criterion
- the criterion for which the weight is requested- Returns:
- the absolute weight of the criterion
-
getRelativeWeight
Get the relative weight of a criterion. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_criterion
- the criterion to get the weight for- Returns:
- the weight linked to the criterion
-
setRelativeWeight
Set the relative weight of a criterion. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_criterion
- the criterion to set the weight for_weight
- the weight to be linked to the criterion
-
setRelativeWeight
Set the relative weight of a criterion. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_criterion
- the criterion to set the weight for_weight
- the weight to be linked to the criterion_idWeightingSet
- the id of the weighting set to be changed
-
setRelativeWeight
Set the relative weight function of a criterion. The weight is relative considered to all tiers of groups, but absolute within a tier. The weight function is linked in the current weighting set.- Parameters:
_criterion
- the criterion to set the weight for_weightFunction
- the weight to be linked to the criterion
-
setRelativeWeight
public void setRelativeWeight(Criterion _criterion, ValueFunction _weightFunction, String _idWeightingSet) Set the relative weight function of a criterion. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_criterion
- the criterion to set the weight for_weightFunction
- the weight function to be linked to the criterion_idWeightingSet
- the id of the weighting set to be changed
-
getRelativeWeight
Get the relative weight of a criterion group. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_group
- the group to get the weight for- Returns:
- the weight linked to the group
-
setRelativeWeight
Set the relative weight of a criterion group. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_group
- the group to set the weight for_weight
- the weight to be linked to the group
-
setRelativeWeight
Set the relative weight function of a criterion group. The weight function is relative considered to all tiers of groups, but absolute within a tier. The weight function is linkec in the current weighting set.- Parameters:
_group
- the group to set the weight for_weightFunction
- the weight function to be linked to the group
-
setRelativeWeight
Set the relative weight of a criterion group. The weight is relative considered to all tiers of groups, but absolute within a tier.- Parameters:
_group
- the group to set the weight for_weight
- the weight to be linked to the group_idWeightingSet
- the id of the weighting set to be changed
-
setRelativeWeight
public void setRelativeWeight(CriterionGroup _group, ValueFunction _weightFunction, String _idWeightingSet) -
setWeights
-
setWeightFunctions
public void setWeightFunctions(LinkedHashMap<String, ValueFunction> _weightset, String _idWeightingSet) -
getNormalizedWeights
-
getNormalizedWeights
-
getWeightFunctions
Get a list of all weight functions of the same weightingset- Parameters:
_idWeightingSet
- identifier of weightingset- Returns:
- list of all weight functions
-
createWeightSet
public WeightSetData createWeightSet(String _weightSetID, String _label, WeightSetData.WeightSetOrigin _origin) Creates id and calls function to create new weighting set.- Parameters:
_label
- name of new weighting set- Returns:
- id of new weighting set
-
cpWeightingSets2Group
-
createAverageWeightingSet
public WeightSetData createAverageWeightingSet(String _idWeightingSet, String _label, ArrayList<String> _weightSetsList) -
createHistogramWeightingSet
public WeightSetData createHistogramWeightingSet(String _idWeightingSet, String _label, LinkedHashMap<String, Double> _factorList) -
setWeightSet
-
removeWeightSet
-
clearWeightSets
public void clearWeightSets() -
renameWeightSet
-
getIdWeightingSets
-
getIdActualWeighting
-
getIdWeightingSet
-
getWeightSetData
-
setWeightSetData
-
getLabelWeightingSet
-
changeWeightSetOrigin
-
changeWeightSetOrigin
-
getWeightSetOrigin
-
getWeightSetOrigin
-
getNormalisedRelativeWeight
Get the normalised relative weight of a criterion. The weight is relative considered to all tiers of groups, but absolute within a tier. The weight is normalized within the tier of the criterion.- Parameters:
_criterion
- the criterion to get the normalised weight for- Returns:
- the normalised weight linked to the criterion
-
getNormalisedRelativeWeight
Get the relative weight of a criterion group. The weight is relative considered to all tiers of groups, but absolute within a tier. The weight is normalized within the tier of the criterion group.- Parameters:
_group
- the group to get the normalised weight for- Returns:
- the normalised weight linked to the group
-
getNormalisedWeight
Get the normalised weight of a criterion. The absolute weights areupdated
beforehand if necessary.- Parameters:
_criterion
- the criterion to get the normalised weight for- Returns:
- the normalised weight of the criterion
-
getNormalisedWeight
Get the normalised weight of a criterion group. This is the sum of all its criteria and groups normalised weights. The absolute weights areupdated
beforehand if necessary.- Parameters:
_group
- the criterion group to get the normalised weight for- Returns:
- the normalised weight of the criterion
-
getDegradationWeight
Get the degradation weight of a criterion. This is the factor of all parent groups degrading the relative normalised weight. The absolute weights areupdated
beforehand if necessary.- Parameters:
_criterion
- the criterion to get the degradation weight for- Returns:
- the degradation weight of the criterion
-
getDegradationWeight
Get the normalised weight of a criterion group. This is the sum of all its criteria and groups normalised weights. The absolute weights areupdated
beforehand if necessary.- Parameters:
_group
- the criterion group to get the normalised weight for- Returns:
- the normalised weight of the criterion
-
doEqualize
public void doEqualize()Set weights in a way that all criteria have the same impact. UsesdoEqualizeRecursive(edu.kit.mcda.core.CriterionGroup, double)
with dedicated baseWeight. -
doHarmonize
public void doHarmonize()Set weights in a way that all criteria have the same impact. UsesdoEqualizeRecursive(edu.kit.mcda.core.CriterionGroup, double)
with dedicated baseWeight. -
searchForCriterion
Get the first criterion labeled according to the given label. The default language is used to check. Returns null if no criterion with the given label is found.- Parameters:
_label
- the label to search for- Returns:
- the criterion with the given label
-
searchForCriterion
Get the first criterion labeled according to the given label. Returns null if no criterion with the given label is found.- Parameters:
_label
- the label to search for_language
- the language the label is in- Returns:
- the criterion with the given label
-
searchForGroup
Search for a group by its label. The default language is used. If multiple groups with that label exist the first is returned. Returns null if no group with the given label is found.- Parameters:
_label
- the label to search a group with- Returns:
- the first group found with the according label
-
searchForGroup
Get the first group labeled according to the given label. Returns null if no criterion with the given label is found.- Parameters:
_label
- the label to search for_language
- the language the label is in- Returns:
- the criterion with the given label
-
searchForAlternative
Get the first alternative labeled according to the given label. The default language is used to check. Returns null if no alternative with the given label is found.- Parameters:
_label
- the label to search for- Returns:
- the alternative with the given label
-
searchForAlternative
Get the first alternative labeled according to the given label. Returns null if no alternative with the given label is found.- Parameters:
_label
- the label to search for_language
- the language the label is in- Returns:
- the alternative with the given label
-
resolve
Resolve and get the result for the given alternative. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative the result is desired for- Returns:
- the valuefunction of the alternative within the context
-
resolve
Resolve and get a list for all alternatives.- Returns:
- a list containing the results for all alternatives
-
resolve
Resolve and get a list for all alternatives.- Parameters:
_sort
- sort the result according to values_ascending
- whether to sort ascending or descending- Returns:
- a list containing the results for all alternatives
-
resolve
Resolve and get the result for the given alternative. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative the result is desired for_group
- the group the resolve is limited to- Returns:
- the valuefunction of the alternative within the context
-
resolve
Resolve and get a list for all alternatives.- Parameters:
_group
- the group the resolve is limited to- Returns:
- a list containing the results for all alternatives
-
resolve
public LinkedHashMap<Alternative,Double> resolve(CriterionGroup _group, boolean _sort, boolean _ascending) Resolve and get a list for all alternatives.- Parameters:
_group
- the group the resolve is limited to_sort
- sort the result according to values_ascending
- whether to sort ascending or descending- Returns:
- a list containing the results for all alternatives
-
resolve
Resolve and get the result for the given alternative. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative the result is desired for_criterion
- the criterion the resolve is limited to- Returns:
- the valuefunction of the alternative within the context
-
resolve
Resolve and get a list for all alternatives.- Parameters:
_criterion
- the criterion the resolve is limited to- Returns:
- a list containing the results for all alternatives
-
resolve
public LinkedHashMap<Alternative,Double> resolve(Criterion _criterion, boolean _sort, boolean _ascending) Resolve and get a list for all alternatives.- Parameters:
_criterion
- the criterion the resolve is limited to_sort
- sort the result according to values_ascending
- whether to sort ascending or descending- Returns:
- a list containing the results for all alternatives
-
analyse
Analyse the stability of criterion by only partially including it into the final solution. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative for which the analyse is performed_criterion
- the criterion which is analysed_weightFactor
- the factor by which amount the criterion will be considered- Returns:
- the analysed valuefunction of the alternative within the context
-
analyse
public double analyse(Alternative _alternative, Criterion _criterion, double _weightFactor, boolean _normalize) Analyse the stability of criterion by only partially including it into the final solution. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative for which the analyse is performed_criterion
- the criterion which is analysed_weightFactor
- the factor by which amount the criterion will be considered_normalize
- corrects the resulting values according to the reduced sum of weights- Returns:
- the analysed valuefunction of the alternative within the context
-
analyse
Analyse the stability of criterion by only partially including it into the final solution. The absolute weights areupdated
beforehand if necessary.- Parameters:
_criterion
- the criterion which is analysed_weightFactor
- the factor by which amount the criterion will be considered- Returns:
- a list of analysed values for all alternatives
-
analyse
public LinkedHashMap<Alternative,Double> analyse(Criterion _criterion, double _weightFactor, boolean _normalize) Analyse the stability of criterion by only partially including it into the final solution. The absolute weights areupdated
beforehand if necessary.- Parameters:
_criterion
- the criterion which is anlysed_weightFactor
- the factor by which amount the criterion will be considered_normalize
- corrects the resulting values according to the reduced sum of weights- Returns:
- a list of analysed values for all alternatives
-
analyse
Analyse the stability of criterion by only partially including it into the final solution. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative for which the analyse is performed_group
- the group which is analysed_weightFactor
- the factor by which amount the criterion will be considered- Returns:
- the analysed valuefunction of the alternative within the context
-
analyse
public double analyse(Alternative _alternative, CriterionGroup _group, double _weightFactor, boolean _normalize) Analyse the stability of criterion by only partially including it into the final solution. The absolute weights areupdated
beforehand if necessary.- Parameters:
_alternative
- the alternative for which the analyse is performed_group
- the group which is analysed_weightFactor
- the factor by which amount the criterion will be considered_normalize
- corrects the resulting values according to the reduced sum of weights- Returns:
- the analysed valuefunction of the alternative within the context
-
getStabilityScans
-
getStabilityScan
public LinkedHashMap<String,ArrayList<Double>> getStabilityScan(String _identifier, double _start, double _end, double _sampleCount, boolean _fractionScan, boolean _renormalize) -
toString
Create a string to verbose the content of this goal. -
hasCriteriaAHP
public boolean hasCriteriaAHP()TODO not sure if using AHP is valid here- Returns:
-
getCriteriaAHP
TODO not sure if using AHP is valid here- Returns:
-
setCriteriaAHP
TODO not sure if using AHP is valid here- Parameters:
_ahp
-
-
hasParameter
-
getParameter
-
getParameters
-
addParameter
-
removeParameter
-
removeParameter
-
clearParameters
public void clearParameters() -
isEqualize
public boolean isEqualize() -
setEqualize
public void setEqualize(boolean _equalize) -
isDeterministic
public boolean isDeterministic() -
isFunctional
public boolean isFunctional() -
isValueFunctional
public boolean isValueFunctional() -
isWeightFunctional
public boolean isWeightFunctional()Check if any weight is non constant functional.- Returns:
- true if any weight is functional
-
getStoredVersion
Get the stored version-tag Is stored in xml-file.- Returns:
- the version
-
getIdentifier
Get a unique identifier. Most likely a UUID.- Specified by:
getIdentifier
in interfaceIdentifier
- Returns:
- an unique identifier
-
setIdentifier
Set a unique identifier. Most likely a UUID.- Specified by:
setIdentifier
in interfaceIdentifier
- Parameters:
_identifier
- an unique identifier
-
getLabel
Description copied from interface:Label
Get the default label without reference to a language. -
getLabel
Description copied from interface:Label
Get the label in reference to the given language. -
getLabels
Get all labels with reference to a language. -
setLabel
Description copied from interface:Label
Set the default label. -
setLabel
Description copied from interface:Label
Set a label for the given language. -
clearLabels
protected void clearLabels() -
getDescription
Get the default description without reference to a language.- Specified by:
getDescription
in interfaceDescription
- Returns:
- the default description
-
getDescription
Get the description in reference to the given language.- Specified by:
getDescription
in interfaceDescription
- Parameters:
_language
- the language the description should be- Returns:
- the localised description
-
getDescriptions
Get all descriptions with reference to a language.- Specified by:
getDescriptions
in interfaceDescription
- Returns:
- all descriptions
-
setDescription
Set the default description.- Specified by:
setDescription
in interfaceDescription
- Parameters:
_description
- the text for the default description
-
setDescription
Set a description for the given language.- Specified by:
setDescription
in interfaceDescription
- Parameters:
_language
- the language identifier_description
- the text for the description of the given language
-
clearDescriptions
protected void clearDescriptions() -
getDye
Get the dedicated color to use within the context. -
setDye
Set the dedicated color to use within the context. -
hasChanged
public boolean hasChanged(boolean _includeComponents) Get the status of the changed flag.- Parameters:
_includeComponents
- if true includes criteria, alternative, ... changes also- Returns:
- the changed status
-
hasChanged
public boolean hasChanged()Get the status of the changed flag. Excludes component changes from criteria, alternatives, ...- Specified by:
hasChanged
in interfaceChanged
- Returns:
- the changed status
-
setChanged
public void setChanged(boolean _changed) Set the status of the changed flag.- Specified by:
setChanged
in interfaceChanged
- Parameters:
_changed
- the changed status to be set
-
addChangedListener
-
removeChangedListener
-
clearChangedListeners
public void clearChangedListeners() -
importFromXML
Imports all MCDA data from a specified file. The call is delegated toimportFromXML(Document)
.- Parameters:
_file
- the file to read the data from- Returns:
- the state of the import
-
importFromXML
Imports all MCDA data from a stream. The call is delegated toimportFromXML(Document)
.- Parameters:
_inputStream
- the stream to read the data from- Returns:
- the state of the import
-
importFromXML
Imports all MCDA data from a specified document.- Parameters:
_document
- the MCDA XML document to import- Returns:
- the state of the import
-
importFromXML_before_7_4
Imports all MCDA data from a specified element node.- Parameters:
_masterNode
- the element to import from- Returns:
- the state of the import
-
importFromXML_before_9_4
-
importFromXML
-
exportToXML
Exports the all MCDA data to a specified file The call is delegated toexportToXML()
.- Parameters:
_file
- the stream to write the document to
-
exportToXML
Exports the all MCDA data to a specified stream. The call is delegated toexportToXML()
.- Parameters:
_outputStream
- the stream to write the document to
-
exportToXML_before_7_4
public org.jdom2.Document exportToXML_before_7_4()Exports the all MCDA data to a XML document.- Returns:
- the XML document containing the data
-
exportToXML
public org.jdom2.Document exportToXML() -
exportResults
Export the results to file as XML. The call is delegated toexportResults()
.- Parameters:
_file
- the file to write the content into
-
exportResults
Export the results to an output stream as XML. The call is delegated toexportResults()
.- Parameters:
_outputStream
- the stream to write the content to
-
exportResults
public org.jdom2.Document exportResults()Create a XML document containing the resolved MCDA. The resolve method is triggered by this method to guarantee correct results.- Returns:
- a XML document containing the results
-
exportGroups
public org.jdom2.Element exportGroups()Export the group structure as XML document.- Returns:
- an XML document containing the parameters
-
exportGroupAsMCDA
-
importValues
Import the criteria values from file. The call is delegated toimportValues(Document)
.- Parameters:
_file
- the file to read the content from
-
importValues
Import the criteria values from an input stream. The call is delegated toimportValues(Document)
.- Parameters:
_inputStream
- the stream to write the content to
-
importValues
Import the criteria values from a XML document. The call is delegated toimportValues(Element)
.- Parameters:
_document
- the document containing the values- Throws:
Exception
- if the import fails
-
importValues
Import the criteria values from a XML node.- Parameters:
_masterNode
- the node to import from- Throws:
Exception
- if the import fails
-
exportValues
Export the criteria values to file as XML. The call is delegated toexportValues(boolean)
.- Parameters:
_file
- the file to write the content into
-
exportValues
Export the criteria values to an output stream as XML. The call is delegated toexportValues(boolean)
.- Parameters:
_outputStream
- the stream to write the content to
-
exportValues
public org.jdom2.Element exportValues(boolean _header) Export the criteria values as XML document. May addGroup additional data like label and description if requested.- Parameters:
_header
- if true additional data is included- Returns:
- an XML document containing the values
-
importParameters
Import the parameters from file. The call is delegated toimportParameters(Document)
.- Parameters:
_file
- the file to read the content from
-
importParameters
Import the parameters from an input stream. The call is delegated toimportParameters(Document)
.- Parameters:
_inputStream
- the stream to write the content to
-
importParameters
Import the parameters from a XML document. The call is delegated toimportParameters(Element)
.- Parameters:
_document
- the document containing the parameters- Throws:
Exception
- if the import fails
-
importParameters
Import the parameters from a XML node.- Parameters:
_masterNode
- the node to import from- Throws:
Exception
- if the import fails
-
exportParameters
Export the parameters to file as XML. The call is delegated toexportParameters(OutputStream)
.- Parameters:
_file
- the file to write the content into
-
exportParameters
Export the parameters to an output stream as XML. The call is delegated toexportParameters()
.- Parameters:
_outputStream
- the stream to write the content to
-
exportParameters
public org.jdom2.Element exportParameters()Export the parameters as XML document.- Returns:
- an XML document containing the parameters
-
importWeighting
Import the weighting from file. The call is delegated toimportWeighting(Document)
.- Parameters:
_file
- the file to read the content from
-
importWeighting
Import the weighting from an input stream. The call is delegated toimportWeighting(Document)
.- Parameters:
_inputStream
- the stream to write the content to
-
importWeighting
Import the weighting from a XML document. The call is delegated toimportWeighting(Element)
.- Parameters:
_document
- the document containing the values- Throws:
Exception
- if the import fails
-
importWeighting_before_7_4
Import the weighting from a XML node.- Parameters:
_masterNode
- the node to import from- Throws:
Exception
- if the import fails
-
importWeighting
- Throws:
Exception
-
exportWeighting
Exports the weighting to a specified file The call is delegated toexportWeighting(OutputStream)
.- Parameters:
_file
- the stream to write the document to
-
exportWeighting
Exports the weighting to a specified stream. The call is delegated toexportWeighting(boolean)
.- Parameters:
_outputStream
- the stream to write the document to
-
exportWeighting_before_7_4
public org.jdom2.Element exportWeighting_before_7_4()Exports the weighting to a XML document.- Returns:
- the XML element containing the data
-
exportWeighting
public org.jdom2.Element exportWeighting(boolean _header) -
getCorrelation
-
getRankedCorrelation
-
getRankedCorrelation
-
getRankMap
-
upgradeToConstantFunctions
public void upgradeToConstantFunctions()
-