org.decisiondeck.xmcda_oo.structure
Interface ICoalitions

All Known Implementing Classes:
Coalitions

public interface ICoalitions

A set of weights (bound to criteria) and a majority threshold. The weights and the majority threshold are not requested to be between 0 and 1 (that would be restrictive as some users may which to use non normalized weights). They must however be positive or zero. This represent criteria satisfying coalitions (or sometimes winning coalitions), where a coalition is a set of criteria whose sum of weight is at least the majority threshold.


Method Summary
 boolean approxEquals(ICoalitions c2, double tolerance)
           
 Set<Criterion> getCriteria()
          Retrieves a read-only view of the set of criteria on which weights are defined.
 Double getMajorityThreshold()
           
 Double getNormalizedWeight(Criterion criterion)
           
 Weights getNormalizedWeights()
          TODO talk about tolerance (through weights); provide a r-o view.
 Double getWeight(Criterion criterion)
           
 Weights getWeights()
          Retrieves a view that reads and writes through to this object.
 boolean isEmpty()
          Tests whether this object contains no information.
 boolean isNormalized()
           
 Double putWeight(Criterion criterion, double weight)
          Sets or replaces the weight associated to the given criterion.
 Double removeMajorityThreshold()
          Removes the possibly associated majority threshold.
 Double setMajorityThreshold(double majorityThreshold)
          Sets or replaces the majority threshold.
 void setWeight(Criterion criterion, Double weight)
          Sets or remove the weight associated to the given criterion.
 

Method Detail

getCriteria

Set<Criterion> getCriteria()
Retrieves a read-only view of the set of criteria on which weights are defined.

Returns:
not null.

getMajorityThreshold

Double getMajorityThreshold()
Returns:
null iff no threshold. Otherwise, a positive or zero value.

getWeight

Double getWeight(Criterion criterion)
Parameters:
criterion - not null.
Returns:
the weight of the given criterion (a positive or zero number), or null if the given criterion is unknown.

setWeight

void setWeight(Criterion criterion,
               Double weight)
Sets or remove the weight associated to the given criterion.

Parameters:
criterion - not null.
weight - a positive or zero value, or null to remove it.

putWeight

Double putWeight(Criterion criterion,
                 double weight)
Sets or replaces the weight associated to the given criterion.

Parameters:
criterion - not null.
weight - a positive or zero value.
Returns:
the weight that was previously associated to that criterion (positive or zero), or null if it was unknown.

setMajorityThreshold

Double setMajorityThreshold(double majorityThreshold)
Sets or replaces the majority threshold.

Parameters:
majorityThreshold - a positive or zero value.
Returns:
the previous majority threshold value, or null iff it was not set.

removeMajorityThreshold

Double removeMajorityThreshold()
Removes the possibly associated majority threshold. If not set, this method has no effect.

Returns:
the previous value of the majority threshold, or null iff it was not set.

isNormalized

boolean isNormalized()

getWeights

Weights getWeights()
Retrieves a view that reads and writes through to this object. Changing the tolerance in the returned weights also changes the tolerance used by this object.

Returns:
not null.

getNormalizedWeight

Double getNormalizedWeight(Criterion criterion)

getNormalizedWeights

Weights getNormalizedWeights()
TODO talk about tolerance (through weights); provide a r-o view.

Returns:
not null.

approxEquals

boolean approxEquals(ICoalitions c2,
                     double tolerance)

isEmpty

boolean isEmpty()
Tests whether this object contains no information.

Returns:
true iff this object contains no weights and no majority threshold.


Copyright © 2011. All Rights Reserved.