Class Goal

java.lang.Object
edu.kit.mcda.core.Goal
All Implemented Interfaces:
Changed, Description, Dye, Identifier, Label, MetaInformation

public class Goal extends Object implements 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
  • Constructor Details

    • Goal

      public Goal()
      Parameterless constructor. Delegates to several different initialization methods.
  • Method Details

    • create

      public static Goal create(org.jdom2.Element _masterNode)
    • clone

      public Goal 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.
      Overrides:
      clone in class Object
      Returns:
    • getMetaInformation

      public MetaInformation getMetaInformation(String _identifier)
    • hasTimestamp

      public boolean hasTimestamp()
    • getTimestamp

      public LocalDateTime getTimestamp()
    • setTimestamp

      public void setTimestamp(LocalDateTime _timestamp)
    • addCriterion

      public void addCriterion(Criterion _criterion)
      Add a criterion to the set of criteria. The criterion is referenced by its identifier.
      Parameters:
      _criterion - the criterion to be added
    • addCriterion

      public void addCriterion(Criterion _criterion, CriterionGroup _group)
      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

      public void addCriterion(String _identifier, Criterion _criterion)
      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

      public void addCriterion(String _identifier, Criterion _criterion, CriterionGroup _group)
      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

      public boolean containsCriterion(String _identifier)
      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

      public Criterion getCriterion(String _identifier)
      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

      public ArrayList<Criterion> 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

      public void removeCriterion(Criterion _criterion)
      Remove a criterion from the set of criteria. The criterion is referenced by its identifier.
      Parameters:
      _criterion - the criterion to be removed
    • removeCriterion

      public void removeCriterion(String _identifier)
      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

      public void moveCriterion(Criterion _criterion, CriterionGroup _group)
      Move a criterion to another group
    • getAggregator

      public AbstractAggregation getAggregator()
      Get the aggregator used to aggregateSingle the criteria values and weights to a final number.
      Returns:
      the aggregator used for aggregation
    • setAggregator

      public void setAggregator(AbstractAggregation _aggregator)
      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

      public void addAlternative(Alternative _alternative)
      Add a alternative to the set of alternatives. The alternative is referenced by its identifier.
      Parameters:
      _alternative - the alternative to be added
    • addAlternative

      public void addAlternative(String _identifier, Alternative _alternative)
      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

      public boolean containsAlternative(String _identifier)
      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

      public Alternative getAlternative(String _identifier)
      Get the alternative linked to the identifier.
      Parameters:
      _identifier - the identifier for the desired alternative
      Returns:
      the alternative linked to the identifier
    • getAlternatives

      public ArrayList<Alternative> getAlternatives()
      Get a list of all alternatives in this goal. The list is shallow copied.
      Returns:
      a list of all alternatives
    • removeAlternative

      public void removeAlternative(Alternative _alternative)
      Remove an alternative from the set of alternatives. Delegates to removeAlternative(java.lang.String).
      Parameters:
      _alternative - the alternative to remove
    • removeAlternative

      public void removeAlternative(String _identifier)
      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

      public CriterionGroup getGroupsRoot()
      Get the root group of the groups tree.
      Returns:
      the root group of the groups tree
    • groupsPut

      public void groupsPut(CriterionGroup _group)
      Add group to the root of the group graph. The root is this goal.
      Parameters:
      _group - the group to be added
    • groupsPut

      public void groupsPut(Criterion _criterion)
      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

      public void groupsPut(CriterionGroup _parent, CriterionGroup _group)
      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

      public void groupsPut(CriterionGroup _parent, Criterion _criterion)
      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

      public CriterionGroup groupsGetGroup(String _identifier)
      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

      public ArrayList<CriterionGroup> groupsGetGroups()
      Get a list of all groups in the groups tree. Includes root group.
      Returns:
      the list of all groups
    • groupsGetGroups

      public ArrayList<CriterionGroup> groupsGetGroups(boolean _excludeRoot)
      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

      public LinkedHashMap<String,CriterionGroup> groupsGetGroupsMap()
      Get a map mapping identifiers to corresponding groups in the groups tree. Includes root group.
      Returns:
      a map of identifiers to groups
    • getDescendants

      public ArrayList<Criterion> getDescendants(CriterionGroup _group)
      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

      public ArrayList<CriterionGroup> getDescendantGroups(CriterionGroup _group)
      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

      public boolean groupsIsCriterion(String _identifier)
      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

      public boolean groupsIsGroup(String _identifier)
      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

      public int groupsGetTier(String _identifier)
      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

      public boolean hasWeightFunction(String _identifier)
      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

      public boolean hasWeightFunction(String _identifier, String _labelWeighting)
    • hasWeightConstantFunction

      public boolean hasWeightConstantFunction(String _identifier)
    • hasWeightFunction

      public boolean hasWeightFunction(Criterion _criterion)
      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

      public double getWeight(Criterion _criterion)
      Get the absolute weight of the given criterion. The absolute weights are updated beforehand if necessary.
      Parameters:
      _criterion - the criterion for which the weight is requested
      Returns:
      the absolute weight of the criterion
    • getRelativeWeight

      public double getRelativeWeight(Criterion _criterion)
      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

      public void setRelativeWeight(Criterion _criterion, double _weight)
      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

      public void setRelativeWeight(Criterion _criterion, double _weight, String _idWeightingSet)
      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

      public void setRelativeWeight(Criterion _criterion, ValueFunction _weightFunction)
      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

      public double getRelativeWeight(CriterionGroup _group)
      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

      public void setRelativeWeight(CriterionGroup _group, double _weight)
      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

      public void setRelativeWeight(CriterionGroup _group, ValueFunction _weightFunction)
      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

      public void setRelativeWeight(CriterionGroup _group, double _weight, String _idWeightingSet)
      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

      public void setWeights(LinkedHashMap<String,Double> _weightset, String _idWeightingSet)
    • setWeightFunctions

      public void setWeightFunctions(LinkedHashMap<String,ValueFunction> _weightset, String _idWeightingSet)
    • getNormalizedWeights

      public double[] getNormalizedWeights(Criterion _criterion, ArrayList<Double> _relativeWeights)
    • getNormalizedWeights

      public double[] getNormalizedWeights(CriterionGroup _group, ArrayList<Double> _relativeWeights)
    • getWeightFunctions

      public LinkedHashMap<String,ValueFunction> getWeightFunctions(String _idWeightingSet)
      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

      public void cpWeightingSets2Group(CriterionGroup _group)
    • createAverageWeightingSet

      public WeightSetData createAverageWeightingSet(String _idWeightingSet, String _label, ArrayList<String> _weightSetsList)
    • createHistogramWeightingSet

      public WeightSetData createHistogramWeightingSet(String _idWeightingSet, String _label, LinkedHashMap<String,Double> _factorList)
    • setWeightSet

      public void setWeightSet(String _weightSetID)
    • removeWeightSet

      public void removeWeightSet(String _weightSetID)
    • clearWeightSets

      public void clearWeightSets()
    • renameWeightSet

      public String renameWeightSet(String _oldLabel, String _newLabel)
    • getIdWeightingSets

      public LinkedHashMap<String,WeightSetData> getIdWeightingSets()
    • getIdActualWeighting

      public String getIdActualWeighting()
    • getIdWeightingSet

      public String getIdWeightingSet(String _label)
    • getWeightSetData

      public WeightSetData getWeightSetData(String _id)
    • setWeightSetData

      public void setWeightSetData(String _id, WeightSetData _weightSetData)
    • getLabelWeightingSet

      public String getLabelWeightingSet(String _id)
    • changeWeightSetOrigin

      public void changeWeightSetOrigin(WeightSetData.WeightSetOrigin _origin)
    • changeWeightSetOrigin

      public void changeWeightSetOrigin(String _id, WeightSetData.WeightSetOrigin _origin)
    • getWeightSetOrigin

      public WeightSetData.WeightSetOrigin getWeightSetOrigin()
    • getWeightSetOrigin

      public WeightSetData.WeightSetOrigin getWeightSetOrigin(String _id)
    • getNormalisedRelativeWeight

      public double getNormalisedRelativeWeight(Criterion _criterion)
      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

      public double getNormalisedRelativeWeight(CriterionGroup _group)
      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

      public double getNormalisedWeight(Criterion _criterion)
      Get the normalised weight of a criterion. The absolute weights are updated beforehand if necessary.
      Parameters:
      _criterion - the criterion to get the normalised weight for
      Returns:
      the normalised weight of the criterion
    • getNormalisedWeight

      public double getNormalisedWeight(CriterionGroup _group)
      Get the normalised weight of a criterion group. This is the sum of all its criteria and groups normalised weights. The absolute weights are updated beforehand if necessary.
      Parameters:
      _group - the criterion group to get the normalised weight for
      Returns:
      the normalised weight of the criterion
    • getDegradationWeight

      public double getDegradationWeight(Criterion _criterion)
      Get the degradation weight of a criterion. This is the factor of all parent groups degrading the relative normalised weight. The absolute weights are updated beforehand if necessary.
      Parameters:
      _criterion - the criterion to get the degradation weight for
      Returns:
      the degradation weight of the criterion
    • getDegradationWeight

      public double getDegradationWeight(CriterionGroup _group)
      Get the normalised weight of a criterion group. This is the sum of all its criteria and groups normalised weights. The absolute weights are updated 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. Uses doEqualizeRecursive(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. Uses doEqualizeRecursive(edu.kit.mcda.core.CriterionGroup, double) with dedicated baseWeight.
    • searchForCriterion

      public Criterion searchForCriterion(String _label)
      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

      public Criterion searchForCriterion(String _label, String _language)
      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

      public CriterionGroup searchForGroup(String _label)
      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

      public CriterionGroup searchForGroup(String _label, String _language)
      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

      public Alternative searchForAlternative(String _label)
      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

      public Alternative searchForAlternative(String _label, String _language)
      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

      public double resolve(Alternative _alternative)
      Resolve and get the result for the given alternative. The absolute weights are updated beforehand if necessary.
      Parameters:
      _alternative - the alternative the result is desired for
      Returns:
      the valuefunction of the alternative within the context
    • resolve

      public LinkedHashMap<Alternative,Double> resolve()
      Resolve and get a list for all alternatives.
      Returns:
      a list containing the results for all alternatives
    • resolve

      public LinkedHashMap<Alternative,Double> resolve(boolean _sort, boolean _ascending)
      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

      public double resolve(Alternative _alternative, CriterionGroup _group)
      Resolve and get the result for the given alternative. The absolute weights are updated 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

      public LinkedHashMap<Alternative,Double> resolve(CriterionGroup _group)
      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

      public double resolve(Alternative _alternative, Criterion _criterion)
      Resolve and get the result for the given alternative. The absolute weights are updated 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

      public LinkedHashMap<Alternative,Double> resolve(Criterion _criterion)
      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

      public double analyse(Alternative _alternative, Criterion _criterion, double _weightFactor)
      Analyse the stability of criterion by only partially including it into the final solution. The absolute weights are updated 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 are updated 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

      public LinkedHashMap<Alternative,Double> analyse(Criterion _criterion, double _weightFactor)
      Analyse the stability of criterion by only partially including it into the final solution. The absolute weights are updated 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 are updated 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

      public double analyse(Alternative _alternative, CriterionGroup _group, double _weightFactor)
      Analyse the stability of criterion by only partially including it into the final solution. The absolute weights are updated 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 are updated 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

      public LinkedHashMap<String,ArrayList<Double>> getStabilityScans(String _criterionIdentifier, String _alternativeIdentifier, double _minimum, double _maximum, double _sampleCount)
    • getStabilityScan

      public LinkedHashMap<String,ArrayList<Double>> getStabilityScan(String _identifier, double _start, double _end, double _sampleCount, boolean _fractionScan, boolean _renormalize)
    • toString

      public String toString()
      Create a string to verbose the content of this goal.
      Overrides:
      toString in class Object
      Returns:
      a string containing information about this goal
    • hasCriteriaAHP

      public boolean hasCriteriaAHP()
      TODO not sure if using AHP is valid here
      Returns:
    • getCriteriaAHP

      public AHP getCriteriaAHP()
      TODO not sure if using AHP is valid here
      Returns:
    • setCriteriaAHP

      public void setCriteriaAHP(AHP _ahp)
      TODO not sure if using AHP is valid here
      Parameters:
      _ahp -
    • hasParameter

      public boolean hasParameter(String _id)
    • getParameter

      public Parameter getParameter(String _id)
    • getParameters

      public LinkedHashMap<String,Parameter> getParameters()
    • addParameter

      public void addParameter(Parameter _parameter)
    • removeParameter

      public void removeParameter(String _id)
    • removeParameter

      public void removeParameter(Parameter _parameter)
    • 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

      public String getStoredVersion()
      Get the stored version-tag Is stored in xml-file.
      Returns:
      the version
    • getIdentifier

      public String getIdentifier()
      Get a unique identifier. Most likely a UUID.
      Specified by:
      getIdentifier in interface Identifier
      Returns:
      an unique identifier
    • setIdentifier

      public void setIdentifier(String _identifier)
      Set a unique identifier. Most likely a UUID.
      Specified by:
      setIdentifier in interface Identifier
      Parameters:
      _identifier - an unique identifier
    • getLabel

      public String getLabel()
      Description copied from interface: Label
      Get the default label without reference to a language.
      Specified by:
      getLabel in interface Label
      Returns:
    • getLabel

      public String getLabel(String _language)
      Description copied from interface: Label
      Get the label in reference to the given language.
      Specified by:
      getLabel in interface Label
      Parameters:
      _language - the language in which the label is requested
      Returns:
      the localised label
    • getLabels

      public LinkedHashMap<String,String> getLabels()
      Get all labels with reference to a language.
      Specified by:
      getLabels in interface Label
      Returns:
      all labels
    • setLabel

      public void setLabel(String _label)
      Description copied from interface: Label
      Set the default label.
      Specified by:
      setLabel in interface Label
      Parameters:
      _label - the new default label
    • setLabel

      public void setLabel(String _language, String _label)
      Description copied from interface: Label
      Set a label for the given language.
      Specified by:
      setLabel in interface Label
      Parameters:
      _language - the language identifier
      _label - the label for the given language
    • clearLabels

      protected void clearLabels()
    • getDescription

      public String getDescription()
      Get the default description without reference to a language.
      Specified by:
      getDescription in interface Description
      Returns:
      the default description
    • getDescription

      public String getDescription(String _language)
      Get the description in reference to the given language.
      Specified by:
      getDescription in interface Description
      Parameters:
      _language - the language the description should be
      Returns:
      the localised description
    • getDescriptions

      public LinkedHashMap<String,String> getDescriptions()
      Get all descriptions with reference to a language.
      Specified by:
      getDescriptions in interface Description
      Returns:
      all descriptions
    • setDescription

      public void setDescription(String _description)
      Set the default description.
      Specified by:
      setDescription in interface Description
      Parameters:
      _description - the text for the default description
    • setDescription

      public void setDescription(String _language, String _description)
      Set a description for the given language.
      Specified by:
      setDescription in interface Description
      Parameters:
      _language - the language identifier
      _description - the text for the description of the given language
    • clearDescriptions

      protected void clearDescriptions()
    • getDye

      public Color getDye()
      Get the dedicated color to use within the context.
      Specified by:
      getDye in interface Dye
      Returns:
      the dedicated color
    • setDye

      public void setDye(Color _dye)
      Set the dedicated color to use within the context.
      Specified by:
      setDye in interface Dye
      Parameters:
      _dye - the dedicated color to set
    • 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 interface Changed
      Returns:
      the changed status
    • setChanged

      public void setChanged(boolean _changed)
      Set the status of the changed flag.
      Specified by:
      setChanged in interface Changed
      Parameters:
      _changed - the changed status to be set
    • addChangedListener

      public void addChangedListener(Changed _listener)
    • removeChangedListener

      public void removeChangedListener(Changed _listener)
    • clearChangedListeners

      public void clearChangedListeners()
    • importFromXML

      public Goal.ImportState importFromXML(File _file)
      Imports all MCDA data from a specified file. The call is delegated to importFromXML(Document).
      Parameters:
      _file - the file to read the data from
      Returns:
      the state of the import
    • importFromXML

      public Goal.ImportState importFromXML(InputStream _inputStream)
      Imports all MCDA data from a stream. The call is delegated to importFromXML(Document).
      Parameters:
      _inputStream - the stream to read the data from
      Returns:
      the state of the import
    • importFromXML

      public Goal.ImportState importFromXML(org.jdom2.Document _document)
      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

      public Goal.ImportState importFromXML_before_7_4(org.jdom2.Element _masterNode)
      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

      public Goal.ImportState importFromXML_before_9_4(org.jdom2.Element _masterNode)
    • importFromXML

      public Goal.ImportState importFromXML(org.jdom2.Element _masterNode)
    • exportToXML

      public void exportToXML(File _file)
      Exports the all MCDA data to a specified file The call is delegated to exportToXML().
      Parameters:
      _file - the stream to write the document to
    • exportToXML

      public void exportToXML(OutputStream _outputStream)
      Exports the all MCDA data to a specified stream. The call is delegated to exportToXML().
      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

      public void exportResults(File _file)
      Export the results to file as XML. The call is delegated to exportResults().
      Parameters:
      _file - the file to write the content into
    • exportResults

      public void exportResults(OutputStream _outputStream)
      Export the results to an output stream as XML. The call is delegated to exportResults().
      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

      public org.jdom2.Element exportGroupAsMCDA(CriterionGroup _group)
    • importValues

      public void importValues(File _file)
      Import the criteria values from file. The call is delegated to importValues(Document).
      Parameters:
      _file - the file to read the content from
    • importValues

      public void importValues(InputStream _inputStream)
      Import the criteria values from an input stream. The call is delegated to importValues(Document).
      Parameters:
      _inputStream - the stream to write the content to
    • importValues

      public void importValues(org.jdom2.Document _document) throws Exception
      Import the criteria values from a XML document. The call is delegated to importValues(Element).
      Parameters:
      _document - the document containing the values
      Throws:
      Exception - if the import fails
    • importValues

      public void importValues(org.jdom2.Element _masterNode) throws Exception
      Import the criteria values from a XML node.
      Parameters:
      _masterNode - the node to import from
      Throws:
      Exception - if the import fails
    • exportValues

      public void exportValues(File _file)
      Export the criteria values to file as XML. The call is delegated to exportValues(boolean).
      Parameters:
      _file - the file to write the content into
    • exportValues

      public void exportValues(OutputStream _outputStream)
      Export the criteria values to an output stream as XML. The call is delegated to exportValues(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

      public void importParameters(File _file)
      Import the parameters from file. The call is delegated to importParameters(Document).
      Parameters:
      _file - the file to read the content from
    • importParameters

      public void importParameters(InputStream _inputStream)
      Import the parameters from an input stream. The call is delegated to importParameters(Document).
      Parameters:
      _inputStream - the stream to write the content to
    • importParameters

      public void importParameters(org.jdom2.Document _document) throws Exception
      Import the parameters from a XML document. The call is delegated to importParameters(Element).
      Parameters:
      _document - the document containing the parameters
      Throws:
      Exception - if the import fails
    • importParameters

      public void importParameters(org.jdom2.Element _masterNode) throws Exception
      Import the parameters from a XML node.
      Parameters:
      _masterNode - the node to import from
      Throws:
      Exception - if the import fails
    • exportParameters

      public void exportParameters(File _file)
      Export the parameters to file as XML. The call is delegated to exportParameters(OutputStream).
      Parameters:
      _file - the file to write the content into
    • exportParameters

      public void exportParameters(OutputStream _outputStream)
      Export the parameters to an output stream as XML. The call is delegated to exportParameters().
      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

      public void importWeighting(File _file)
      Import the weighting from file. The call is delegated to importWeighting(Document).
      Parameters:
      _file - the file to read the content from
    • importWeighting

      public void importWeighting(InputStream _inputStream)
      Import the weighting from an input stream. The call is delegated to importWeighting(Document).
      Parameters:
      _inputStream - the stream to write the content to
    • importWeighting

      public void importWeighting(org.jdom2.Document _document) throws Exception
      Import the weighting from a XML document. The call is delegated to importWeighting(Element).
      Parameters:
      _document - the document containing the values
      Throws:
      Exception - if the import fails
    • importWeighting_before_7_4

      public void importWeighting_before_7_4(org.jdom2.Element _masterNode) throws Exception
      Import the weighting from a XML node.
      Parameters:
      _masterNode - the node to import from
      Throws:
      Exception - if the import fails
    • importWeighting

      public void importWeighting(org.jdom2.Element _masterNode) throws Exception
      Throws:
      Exception
    • exportWeighting

      public void exportWeighting(File _file)
      Exports the weighting to a specified file The call is delegated to exportWeighting(OutputStream).
      Parameters:
      _file - the stream to write the document to
    • exportWeighting

      public void exportWeighting(OutputStream _outputStream)
      Exports the weighting to a specified stream. The call is delegated to exportWeighting(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

      public LinkedHashMap<String,LinkedHashMap<String,Double>> getCorrelation()
    • getRankedCorrelation

      public LinkedHashMap<String,LinkedHashMap<String,Double>> getRankedCorrelation()
    • getRankedCorrelation

      public double getRankedCorrelation(Criterion _criterion1, Criterion _criterion2)
    • getRankMap

      public LinkedHashMap<String,Double> getRankMap(Criterion _criterion)
    • upgradeToConstantFunctions

      public void upgradeToConstantFunctions()