org.decisiondeck.jmcda.exc
Class ConsistencyChecker

java.lang.Object
  extended by org.decisiondeck.jmcda.exc.ConsistencyChecker

public class ConsistencyChecker
extends Object


Constructor Summary
ConsistencyChecker()
           
 
Method Summary
 void assertAssignmentsToIntervals(ISortingAssignmentsToMultiple data)
          Ensures that every assigned alternative contained in the given data are assigned to an interval over the ordered set of categories contained in this object, or equivalently, that for each alternative, either it is not assigned, or it is assigned to a subset of the categories in the given data which has no “hole”.
 void assertCompleteAlternativesEvaluations(IProblemData data)
          Ensures that the given object contains an evaluation for every alternative on every criteria contained in the data.
 void assertCompleteAssignments(ISortingAssignments data)
          Ensures that every alternative contained in the given data are assigned.
 void assertCompleteAssignments(ISortingAssignmentsToMultiple data)
          Ensures that every alternative contained in the given data are assigned.
 void assertCompleteAssignments(ISortingAssignmentsWithCredibilities data)
          Ensures that every alternative contained in the given data are assigned.
 void assertCompleteCatsAndProfs(ISortingData data)
          Ensures that the categories and profiles in the given data are complete.
 void assertCompleteCoalitions(ISortingPreferences data)
          Ensures that the given data have coalitions set with a weight for each criteria in the data and have the majority threshold set, and that the majority threshold is not greater than the sum of the weights + the tolerance set for the coalition.
 void assertCompleteIndifferenceThresholds(ISortingPreferences data)
          Ensures that the given data contain an indifference threshold (which may be zero) for every criteria in the contained data.
 void assertCompletePreferenceDirections(IProblemData data)
          Ensures that the preference directions are known for every criteria contained in the given data.
 void assertCompletePreferenceThresholds(ISortingPreferences data)
          Ensures that the given data contain a preference threshold (which may be zero) for every criteria in the contained data.
 void assertCompleteProfiles(ISortingData data)
          Ensures that the profiles contained in the given data are all contained into the categories and profiles object, or equivalently, ensures that the profiles are all ordered and unambiguously associated to the categories.
 void assertCompleteProfilesEvaluations(ISortingPreferences data)
          Ensures that the given object contains an evaluation for every profile on every criteria contained in the data.
 void assertCompleteWeights(Set<Criterion> criteria, Set<Criterion> withWeights)
          Ensures that all the given criteria have a weight, thus are contained in the given set of criteria having a weight.
 boolean assertConsistentData(ISortingData data)
           
 void assertDominance(ISortingPreferences data)
           Ensures that the profiles evaluations define a total ordering on the profiles in terms of strict dominance; and that this dominance order is the same as the order of the profiles given in the categories and profiles object contained in the given data.
 void assertWeightsBelowOne(ISortingPreferences data)
          Ensures that the weights contained in the given data are between zero and one, inclusive.
 boolean isConsistentData(ISortingData data)
           
 boolean isConsistentGroupData(IGroupSortingData data)
           
 boolean isConsistentGroupPreferences(IGroupSortingPreferences preferences)
           
 boolean isConsistentPreferences(ISortingPreferences preferences)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsistencyChecker

public ConsistencyChecker()
Method Detail

isConsistentPreferences

public boolean isConsistentPreferences(ISortingPreferences preferences)

assertConsistentData

public boolean assertConsistentData(ISortingData data)
                             throws InvalidInputException
Throws:
InvalidInputException

assertCompleteProfilesEvaluations

public void assertCompleteProfilesEvaluations(ISortingPreferences data)
                                       throws InvalidInputException
Ensures that the given object contains an evaluation for every profile on every criteria contained in the data. Note that this is a stronger condition than checking IRdFloatMatrix.isComplete().

Parameters:
data - not null.
Throws:
InvalidInputException - if the evaluations are incomplete.

assertCompleteCatsAndProfs

public void assertCompleteCatsAndProfs(ISortingData data)
                                throws InvalidInputException
Ensures that the categories and profiles in the given data are complete. The categories are said to be complete iff at least one category has been set and all categories have both their profiles set, except the worst one which has no down profile, and the best one which has no up profile. This implies that the number of profiles set equals the number of categories minus one. Note that completeness in that sense does not imply that no categories will be added any more to this object.

Parameters:
data - not null.
Throws:
InvalidInputException - if the categories and profiles object in the given data are incomplete.
See Also:
ICatsAndProfs

assertCompleteProfiles

public void assertCompleteProfiles(ISortingData data)
                            throws InvalidInputException
Ensures that the profiles contained in the given data are all contained into the categories and profiles object, or equivalently, ensures that the profiles are all ordered and unambiguously associated to the categories.

Parameters:
data - not null.
Throws:
InvalidInputException - if the profiles are not completely ordered.

isConsistentGroupPreferences

public boolean isConsistentGroupPreferences(IGroupSortingPreferences preferences)

isConsistentGroupData

public boolean isConsistentGroupData(IGroupSortingData data)

assertCompleteAssignments

public void assertCompleteAssignments(ISortingAssignmentsWithCredibilities data)
                               throws InvalidInputException
Ensures that every alternative contained in the given data are assigned.

Parameters:
data - not null.
Throws:
InvalidInputException - if some assignments are missing.

assertDominance

public void assertDominance(ISortingPreferences data)
                     throws InvalidInputException

Ensures that the profiles evaluations define a total ordering on the profiles in terms of strict dominance; and that this dominance order is the same as the order of the profiles given in the categories and profiles object contained in the given data. This test fails if not every preference directions are set in the given data, as this is a required data to compute the dominance relation.

This test does not ensure that the profiles evaluations are complete in the sense of assertCompleteProfilesEvaluations(org.decisiondeck.jmcda.structure.sorting.problem.preferences.ISortingPreferences): if the profiles are evaluated only on a subset of the set of criteria contained in this object, and these evaluations yield an adequate order, this test will pass.

If the given data contain no profiles, this test succeeds. Indeed, the profiles evaluations, empty in that case, are complete as every profile is evaluated on every criteria, the dominance order, empty in that case, is the same as the profiles order, etc.

Parameters:
data - not null.
Throws:
InvalidInputException - if the order of the profiles given in the categories and profiles object is not the same as the order of the profiles according to their evaluations, or if some preference direction is missing, or if the profiles evaluations are not a complete matrix (in the sense of IRdFloatMatrix.isComplete()).

assertCompletePreferenceDirections

public void assertCompletePreferenceDirections(IProblemData data)
                                        throws InvalidInputException
Ensures that the preference directions are known for every criteria contained in the given data.

Parameters:
data - not null.
Throws:
InvalidInputException - if some preference directions are missing.

assertCompleteWeights

public void assertCompleteWeights(Set<Criterion> criteria,
                                  Set<Criterion> withWeights)
                           throws InvalidInputException
Ensures that all the given criteria have a weight, thus are contained in the given set of criteria having a weight.

Parameters:
criteria - not null.
withWeights - not null.
Throws:
InvalidInputException - if some weights are missing.

assertCompleteCoalitions

public void assertCompleteCoalitions(ISortingPreferences data)
                              throws InvalidInputException
Ensures that the given data have coalitions set with a weight for each criteria in the data and have the majority threshold set, and that the majority threshold is not greater than the sum of the weights + the tolerance set for the coalition. The last check ensures that at least one coalition is sufficient.

Parameters:
data - not null.
Throws:
InvalidInputException - if the coalitions are incomplete.

assertCompletePreferenceThresholds

public void assertCompletePreferenceThresholds(ISortingPreferences data)
                                        throws InvalidInputException
Ensures that the given data contain a preference threshold (which may be zero) for every criteria in the contained data.

Parameters:
data - not null.
Throws:
InvalidInputException - if at least one preference threshold is missing.

assertCompleteIndifferenceThresholds

public void assertCompleteIndifferenceThresholds(ISortingPreferences data)
                                          throws InvalidInputException
Ensures that the given data contain an indifference threshold (which may be zero) for every criteria in the contained data.

Parameters:
data - not null.
Throws:
InvalidInputException - if at least one preference threshold is missing.

assertCompleteAlternativesEvaluations

public void assertCompleteAlternativesEvaluations(IProblemData data)
                                           throws InvalidInputException
Ensures that the given object contains an evaluation for every alternative on every criteria contained in the data. Note that this is a stronger condition than checking IRdFloatMatrix.isComplete().

Parameters:
data - not null.
Throws:
InvalidInputException - if the evaluations are incomplete.

assertCompleteAssignments

public void assertCompleteAssignments(ISortingAssignments data)
                               throws InvalidInputException
Ensures that every alternative contained in the given data are assigned.

Parameters:
data - not null.
Throws:
InvalidInputException - if some assignments are missing.

assertCompleteAssignments

public void assertCompleteAssignments(ISortingAssignmentsToMultiple data)
                               throws InvalidInputException
Ensures that every alternative contained in the given data are assigned.

Parameters:
data - not null.
Throws:
InvalidInputException - if some assignments are missing.

assertAssignmentsToIntervals

public void assertAssignmentsToIntervals(ISortingAssignmentsToMultiple data)
                                  throws InvalidInputException
Ensures that every assigned alternative contained in the given data are assigned to an interval over the ordered set of categories contained in this object, or equivalently, that for each alternative, either it is not assigned, or it is assigned to a subset of the categories in the given data which has no “hole”.

Parameters:
data - not null.
Throws:
InvalidInputException - if some alternatives are assigned to some categories that do not form an interval over the set of categories contained in the given data.

assertWeightsBelowOne

public void assertWeightsBelowOne(ISortingPreferences data)
                           throws InvalidInputException
Ensures that the weights contained in the given data are between zero and one, inclusive.

Parameters:
data - not null.
Throws:
InvalidInputException - if at least one weight is higher than one.

isConsistentData

public boolean isConsistentData(ISortingData data)


Copyright © 2011. All Rights Reserved.