org.decisiondeck.jmcda.structure.sorting.problem.data
Interface IProblemData

All Known Subinterfaces:
IGroupSortingAssignments, IGroupSortingAssignmentsToMultiple, IGroupSortingAssignmentsWithCredibilities, IGroupSortingData, IGroupSortingPreferences, IGroupSortingResults, IGroupSortingResultsToMultiple, IGroupSortingResultsWithCredibilities, ISortingAssignments, ISortingAssignmentsToMultiple, ISortingAssignmentsWithCredibilities, ISortingData, ISortingPreferences, ISortingResults, ISortingResultsToMultiple, ISortingResultsWithCredibilities
All Known Implementing Classes:
GroupSortingAssignmentsFiltering, GroupSortingDataArray, GroupSortingDataFiltering, GroupSortingDataForwarder, GroupSortingDataImpl, GroupSortingDataWithOrder, GroupSortingPreferencesFiltering, GroupSortingPreferencesForwarder, GroupSortingPreferencesImpl, GroupSortingPreferencesWithOrder, GroupSortingResultsFiltering, GroupSortingResultsForwarder, GroupSortingResultsImpl, GroupSortingResultsToMultipleImpl, GroupSortingResultsWithCredibilitiesFiltering, GroupSortingResultsWithCredibilitiesForwarder, GroupSortingResultsWithCredibilitiesImpl, GroupSortingResultsWithOrder, ProblemDataFiltering, ProblemDataForwarder, SortingAssignmentsFiltering, SortingAssignmentsToMultipleFiltering, SortingDataArray, SortingDataFiltering, SortingDataForwarder, SortingDataImpl, SortingDataWithOrder, SortingPreferencesFiltering, SortingPreferencesForwarder, SortingPreferencesViewGroupBacked, SortingResultsFiltering, SortingResultsToMultipleComplete, SortingResultsToMultipleFiltering, SortingResultsToMultipleForwarder, SortingResultsToMultipleViewGroupBacked, SortingResultsViewGroupBacked, SortingResultsWithCredibilitiesViewGroupBacked

public interface IProblemData

An object representing the objective data of a typical MCDA problem:

This object provides methods to check that it is in a consistent state. Note however that if its state is changed after a check for consistency, the consistency is not guaranteed any more.

This object is consistent iff all the following holds.

Read-only versions of this interface may be used where the setter methods throw UnsupportedOperationException . Note that read-only does not imply immutable: the implementing class may be a read-only view of some mutable delegate.

Implementing objects might want to impose further restrictions to the data this object accepts, e.g., to accept only evaluations in the right scale, or accept only all equal scales. Such objects will not be fully compliant with this interface but it is suggested that a non accepted input throw as a result an UnsupportedOperationException. Objects using this interface and wanting to capture such case might then react, e.g., by wrapping this exception into an InvalidInputException.

Objects implementing this interface are forbidden to implement an auto-remove behavior, that is, once a criterion (e.g.) has been added to the data, e.g. through addition of a new scale, deletion of that scale does not automatically remove the criterion from the data, even though no information is linked to that criterion any more. Such a behavior would generally be difficult to implement efficiently, would be most of the time useless, and would render this interface difficult to understand e.g. when setting manually the sets of criteria (the user would not want these criteria to be auto-removed).


Method Summary
 Set<Alternative> getAlternatives()
          Retrieves a writable view of the alternatives.
 IRdEvaluations getAlternativesEvaluations()
           Retrieves a read-only view of the evaluations of the alternatives.
 Set<Criterion> getCriteria()
          Retrieves a writable view of the criteria.
 Map<Criterion,IOrderedInterval> getScales()
          Retrieves a read-only view of the scales.
 boolean setEvaluation(Alternative alternative, Criterion criterion, Double value)
          Sets, replaces, or removes the evaluation of the given alternative according to the given criterion.
 boolean setEvaluations(IRdEvaluations evaluations)
          Sets replaces, or remove the evaluations of the alternatives.
 boolean setScale(Criterion criterion, IOrderedInterval scale)
           Sets, replaces, or removes the scale of the given criterion.
 

Method Detail

getAlternativesEvaluations

IRdEvaluations getAlternativesEvaluations()

Retrieves a read-only view of the evaluations of the alternatives. The set of alternatives on which evaluations are provided is a subset of the set returned by getAlternatives(). The set of criteria on which evaluations are provided is a subset of the set returned by getCriteria().

Returns:
not null.

getCriteria

Set<Criterion> getCriteria()
Retrieves a writable view of the criteria.

Returns:
not null.

getAlternatives

Set<Alternative> getAlternatives()
Retrieves a writable view of the alternatives.

Returns:
not null.

getScales

Map<Criterion,IOrderedInterval> getScales()
Retrieves a read-only view of the scales. Scales are defined on all criteria in this object: adding a criterion to this object automatically associates it with a scale representing the set of real numbers.

Returns:
not null, no null key or value.

setEvaluation

boolean setEvaluation(Alternative alternative,
                      Criterion criterion,
                      Double value)
Sets, replaces, or removes the evaluation of the given alternative according to the given criterion. The given alternative and criterion are added to this object if necessary.

Parameters:
alternative - not null.
criterion - not null.
value - null to remove a possibly previously associated value.
Returns:
true iff this call changed the data contained in this object.

setEvaluations

boolean setEvaluations(IRdEvaluations evaluations)
Sets replaces, or remove the evaluations of the alternatives. The given information is added to any possibly existing information. The set of alternatives and criteria on which the given evaluations are defined are added, if not already existing, to this object.

Parameters:
evaluations - if null, the possibly existing evaluations will be removed.
Returns:
true iff this call changed this object.

setScale

boolean setScale(Criterion criterion,
                 IOrderedInterval scale)

Sets, replaces, or removes the scale of the given criterion. The criterion is added to this object if it is not known already.

Parameters:
criterion - not null.
scale - null to remove a possibly previously associated scale.
Returns:
true iff this call changed the data contained in this object.


Copyright © 2011. All Rights Reserved.