org.decisiondeck.xmcda_oo.structure.sorting
Class SortingProblemUtils

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.structure.sorting.SortingProblemUtils

public class SortingProblemUtils
extends Object

Helper methods to deal with sorting structures.


Constructor Summary
SortingProblemUtils()
           
 
Method Summary
static void copyAssignmentsToMultipleToTarget(ISortingAssignmentsToMultiple assignments, ISortingAssignmentsToMultiple target)
           
static void copyAssignmentsToTarget(ISortingAssignments assignments, ISortingAssignments target)
           
static void copyDataToTarget(ISortingData data, ISortingData target)
          Replaces the contents in the given target by the given data.
static void copyGroupAssignmentsToTarget(IGroupSortingAssignments source, IGroupSortingAssignments target)
           
static void copyGroupAssignmentsWithCredibilitiesToTargetSingle(IGroupSortingAssignmentsWithCredibilities source, IGroupSortingAssignments target)
           
static void copyGroupDataToTarget(IGroupSortingData data, IGroupSortingData target)
          Replaces the contents in the given target by the given data.
static void copyGroupPreferencesToTarget(IGroupSortingPreferences preferences, IGroupSortingPreferences target)
          Replaces the contents in the given target by the given data.
static void copyGroupResultsToTarget(IGroupSortingResults source, IGroupSortingResults target)
           
static void copyGroupResultsWithCredibilitiesToTargetSingle(IGroupSortingResultsWithCredibilities source, IGroupSortingResults target)
           
static void copyPreferencesToTarget(ISortingPreferences source, ISortingPreferences target)
           
static void copyResultsToMultipleToTarget(ISortingResultsToMultiple results, ISortingResultsToMultiple target)
           
static void copyResultsToTarget(ISortingResults results, ISortingResults target)
           
static Set<Alternative> getAssignedAlternatives(IGroupSortingAssignments groupSortingAssignments)
          Retrieves a read-only view of all the alternatives assigned by the dms contained in the given problem at the time this method is invoked.
static Map<DecisionMaker,Set<Alternative>> getAssignedAlternativesByDm(IGroupSortingResults group)
           
static String getDimensionStr(ISortingData data)
           
static IGroupSortingAssignments getReadView(IGroupSortingAssignments source)
           
static IGroupSortingData getReadView(IGroupSortingData source)
           
static IGroupSortingPreferences getReadView(IGroupSortingPreferences source)
           
static IGroupSortingResults getReadView(IGroupSortingResults source)
           
static IGroupSortingResultsWithCredibilities getReadView(IGroupSortingResultsWithCredibilities source)
           
static ISortingAssignments getReadView(ISortingAssignments source)
           
static ISortingAssignmentsToMultiple getReadView(ISortingAssignmentsToMultiple source)
           
static ISortingData getReadView(ISortingData source)
           
static ISortingPreferences getReadView(ISortingPreferences source)
           
static ISortingResults getReadView(ISortingResults source)
           
static ISortingResultsToMultiple getReadViewToMultiple(ISortingResults source)
           
static ISortingResultsToMultiple getReadViewToMultiple(ISortingResultsToMultiple source)
           
static ISortingResultsToMultiple getResultsWithAllAlternativesAssigned(ISortingResultsToMultiple input)
           
static ISortingResults getResultsWithOnlyAssignedAlternatives(IGroupSortingResults group, DecisionMaker dm)
           
static ISortingResults getResultsWithOnlyAssignedAlternatives(ISortingResults results)
           
static ISortingResultsToMultiple getResultsWithOnlyAssignedAlternatives(ISortingResultsToMultiple results)
           
static boolean inferScales(ISortingData data)
           Infers the scales of each criterion in the given data and sets them.
static ISortingAssignments newAssignments()
           
static ISortingAssignments newAssignments(ISortingAssignments source)
           
static ISortingAssignmentsToMultiple newAssignmentsToMultiple()
           
static ISortingAssignmentsToMultiple newAssignmentsToMultiple(ISortingAssignments source)
           
static ISortingAssignmentsToMultiple newAssignmentsToMultiple(ISortingAssignmentsToMultiple source)
           
static IGroupSortingAssignments newGroupAssignments()
           
static IGroupSortingAssignments newGroupAssignments(IGroupSortingAssignments source)
          Copy constructor by value.
static IGroupSortingAssignmentsToMultiple newGroupAssignmentsToMultiple()
           
static IGroupSortingAssignmentsToMultiple newGroupAssignmentsToMultiple(IGroupSortingAssignments source)
          Copy constructor by value.
static IGroupSortingAssignmentsToMultiple newGroupAssignmentsToMultiple(IGroupSortingAssignmentsToMultiple source)
          Copy constructor by value.
static IGroupSortingAssignmentsWithCredibilities newGroupAssignmentsWithCredibilities()
           
static GroupSortingResultsWithOrder newGroupAssignmentsWithOrder(IGroupSortingAssignments source)
          Copy constructor by value.
static IGroupSortingPreferences newGroupPreferences()
           
static IGroupSortingPreferences newGroupPreferences(IGroupSortingPreferences source)
          Copy constructor by value.
static IGroupSortingResults newGroupResults()
           
static IGroupSortingResults newGroupResults(IGroupSortingResults source)
           
static IGroupSortingResultsWithCredibilities newGroupResultsWithCredibilities()
           
static IGroupSortingResultsWithCredibilities newGroupResultsWithCredibilities(IGroupSortingResultsWithCredibilities source)
           
static GroupSortingResultsWithOrder newGroupResultsWithOrder(IGroupSortingResults source)
          Copy constructor by value.
static ISortingResults newResults()
           
static ISortingResults newResults(ISortingResults source)
           
static ISortingResultsWithCredibilities newResultsWithCredibilities()
           
static void setScales(IProblemData target, IOrderedInterval scale)
          Associates the given scale to each criterion stored in the given problem.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortingProblemUtils

public SortingProblemUtils()
Method Detail

copyDataToTarget

public static void copyDataToTarget(ISortingData data,
                                    ISortingData target)
Replaces the contents in the given target by the given data.

Parameters:
data - not null.
target - not null.

newGroupAssignmentsWithOrder

public static GroupSortingResultsWithOrder newGroupAssignmentsWithOrder(IGroupSortingAssignments source)
Copy constructor by value. No reference is held to the given object.

Parameters:
source - not null.
Returns:
not null.

newGroupAssignments

public static IGroupSortingAssignments newGroupAssignments()

copyGroupDataToTarget

public static void copyGroupDataToTarget(IGroupSortingData data,
                                         IGroupSortingData target)
Replaces the contents in the given target by the given data.

Parameters:
data - not null.
target - not null.

newGroupPreferences

public static IGroupSortingPreferences newGroupPreferences(IGroupSortingPreferences source)
Copy constructor by value. No reference is held to the given object.

Parameters:
source - not null.
Returns:
not null.

copyGroupPreferencesToTarget

public static void copyGroupPreferencesToTarget(IGroupSortingPreferences preferences,
                                                IGroupSortingPreferences target)
Replaces the contents in the given target by the given data. The target is set to not keep shared informations.

Parameters:
preferences - not null.
target - not null.

newGroupPreferences

public static IGroupSortingPreferences newGroupPreferences()

getDimensionStr

public static String getDimensionStr(ISortingData data)

copyPreferencesToTarget

public static void copyPreferencesToTarget(ISortingPreferences source,
                                           ISortingPreferences target)

inferScales

public static boolean inferScales(ISortingData data)

Infers the scales of each criterion in the given data and sets them. The scales are inferred according to the evaluations of the alternatives: the bounds are set to the worst and best values found in the evaluations.

Any possibly existing scale in the given data is replaced by the inferred one.

Parameters:
data - not null.
Returns:
true iff the scales have changed, or equivalently, true iff the inferred scales are equal to the scales that were set in the given data.

newGroupResults

public static IGroupSortingResults newGroupResults(IGroupSortingResults source)

newGroupResultsWithCredibilities

public static IGroupSortingResultsWithCredibilities newGroupResultsWithCredibilities(IGroupSortingResultsWithCredibilities source)

newGroupResults

public static IGroupSortingResults newGroupResults()

newGroupResultsWithCredibilities

public static IGroupSortingResultsWithCredibilities newGroupResultsWithCredibilities()

copyGroupResultsToTarget

public static void copyGroupResultsToTarget(IGroupSortingResults source,
                                            IGroupSortingResults target)

getResultsWithOnlyAssignedAlternatives

public static ISortingResults getResultsWithOnlyAssignedAlternatives(IGroupSortingResults group,
                                                                     DecisionMaker dm)

newAssignmentsToMultiple

public static ISortingAssignmentsToMultiple newAssignmentsToMultiple(ISortingAssignments source)

newResults

public static ISortingResults newResults()

copyAssignmentsToMultipleToTarget

public static void copyAssignmentsToMultipleToTarget(ISortingAssignmentsToMultiple assignments,
                                                     ISortingAssignmentsToMultiple target)

newResults

public static ISortingResults newResults(ISortingResults source)

copyResultsToTarget

public static void copyResultsToTarget(ISortingResults results,
                                       ISortingResults target)

newAssignments

public static ISortingAssignments newAssignments()

copyGroupResultsWithCredibilitiesToTargetSingle

public static void copyGroupResultsWithCredibilitiesToTargetSingle(IGroupSortingResultsWithCredibilities source,
                                                                   IGroupSortingResults target)
                                                            throws InvalidInputException
Throws:
InvalidInputException

getReadView

public static IGroupSortingResultsWithCredibilities getReadView(IGroupSortingResultsWithCredibilities source)

getReadView

public static IGroupSortingPreferences getReadView(IGroupSortingPreferences source)

getReadView

public static ISortingPreferences getReadView(ISortingPreferences source)

getReadView

public static IGroupSortingData getReadView(IGroupSortingData source)

getReadView

public static IGroupSortingAssignments getReadView(IGroupSortingAssignments source)

getReadView

public static IGroupSortingResults getReadView(IGroupSortingResults source)

getReadView

public static ISortingData getReadView(ISortingData source)

copyGroupAssignmentsWithCredibilitiesToTargetSingle

public static void copyGroupAssignmentsWithCredibilitiesToTargetSingle(IGroupSortingAssignmentsWithCredibilities source,
                                                                       IGroupSortingAssignments target)
                                                                throws InvalidInputException
Throws:
InvalidInputException

newGroupAssignmentsToMultiple

public static IGroupSortingAssignmentsToMultiple newGroupAssignmentsToMultiple(IGroupSortingAssignmentsToMultiple source)
Copy constructor by value. No reference is held to the given object.

Parameters:
source - not null.
Returns:
not null.

getAssignedAlternatives

public static Set<Alternative> getAssignedAlternatives(IGroupSortingAssignments groupSortingAssignments)
Retrieves a read-only view of all the alternatives assigned by the dms contained in the given problem at the time this method is invoked. If the set of assignments change for a given dm in that set after this method returns, the change will be reflected in the returned set, but if a decision maker is added, the change is not reflected.

Parameters:
groupSortingAssignments - not null.
Returns:
not null.

newAssignmentsToMultiple

public static ISortingAssignmentsToMultiple newAssignmentsToMultiple()

newGroupAssignmentsWithCredibilities

public static IGroupSortingAssignmentsWithCredibilities newGroupAssignmentsWithCredibilities()

newResultsWithCredibilities

public static ISortingResultsWithCredibilities newResultsWithCredibilities()

getResultsWithOnlyAssignedAlternatives

public static ISortingResultsToMultiple getResultsWithOnlyAssignedAlternatives(ISortingResultsToMultiple results)

getResultsWithOnlyAssignedAlternatives

public static ISortingResults getResultsWithOnlyAssignedAlternatives(ISortingResults results)

getResultsWithAllAlternativesAssigned

public static ISortingResultsToMultiple getResultsWithAllAlternativesAssigned(ISortingResultsToMultiple input)

getReadViewToMultiple

public static ISortingResultsToMultiple getReadViewToMultiple(ISortingResultsToMultiple source)

getReadViewToMultiple

public static ISortingResultsToMultiple getReadViewToMultiple(ISortingResults source)

getReadView

public static ISortingResults getReadView(ISortingResults source)

getReadView

public static ISortingAssignmentsToMultiple getReadView(ISortingAssignmentsToMultiple source)

newGroupAssignments

public static IGroupSortingAssignments newGroupAssignments(IGroupSortingAssignments source)
Copy constructor by value. No reference is held to the given object.

Parameters:
source - not null.
Returns:
not null.

newGroupAssignmentsToMultiple

public static IGroupSortingAssignmentsToMultiple newGroupAssignmentsToMultiple()

newGroupAssignmentsToMultiple

public static IGroupSortingAssignmentsToMultiple newGroupAssignmentsToMultiple(IGroupSortingAssignments source)
Copy constructor by value. No reference is held to the given object.

Parameters:
source - not null.
Returns:
not null.

newAssignments

public static ISortingAssignments newAssignments(ISortingAssignments source)

copyAssignmentsToTarget

public static void copyAssignmentsToTarget(ISortingAssignments assignments,
                                           ISortingAssignments target)

newAssignmentsToMultiple

public static ISortingAssignmentsToMultiple newAssignmentsToMultiple(ISortingAssignmentsToMultiple source)

getReadView

public static ISortingAssignments getReadView(ISortingAssignments source)

copyResultsToMultipleToTarget

public static void copyResultsToMultipleToTarget(ISortingResultsToMultiple results,
                                                 ISortingResultsToMultiple target)

newGroupResultsWithOrder

public static GroupSortingResultsWithOrder newGroupResultsWithOrder(IGroupSortingResults source)
Copy constructor by value. No reference is held to the given object.

Parameters:
source - not null.
Returns:
not null.

copyGroupAssignmentsToTarget

public static void copyGroupAssignmentsToTarget(IGroupSortingAssignments source,
                                                IGroupSortingAssignments target)

getAssignedAlternativesByDm

public static Map<DecisionMaker,Set<Alternative>> getAssignedAlternativesByDm(IGroupSortingResults group)

setScales

public static void setScales(IProblemData target,
                             IOrderedInterval scale)
Associates the given scale to each criterion stored in the given problem.

Parameters:
scale - not null.


Copyright © 2011. All Rights Reserved.