|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.xmcda_oo.structure.Coalitions
public class Coalitions
Represents coalitions of criteria, by the way of a majority threshold and a set of weights.
TODO Better document (e.g. can weights be null?).
| Constructor Summary | |
|---|---|
Coalitions()
|
|
Coalitions(ICoalitions source)
|
|
Coalitions(Weights weights)
|
|
Coalitions(Weights weights,
double majorityThreshold)
|
|
| Method Summary | |
|---|---|
boolean |
approxEquals(ICoalitions c2,
double tolerance)
|
boolean |
equals(Object obj)
|
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. |
int |
hashCode()
|
boolean |
hasNulWeight()
Must have at least one weight and lambda set. |
boolean |
isEmpty()
Tests whether this object contains no information. |
boolean |
isNormalized()
|
int |
numberOfWeights()
|
void |
putAll(Weights weights)
|
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 |
removeWeight(Criterion criterion)
|
Double |
setMajorityThreshold(double majorityThreshold)
Sets or replaces the majority threshold. |
void |
setMajorityThreshold(Double majorityThreshold)
TODO remove and replace with set and with remove. |
void |
setWeight(Criterion criterion,
Double weight)
TODO implement remove. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Coalitions(Weights weights,
double majorityThreshold)
weights - not null.majorityThreshold - a valid value (not infinite or NaN).public Coalitions(ICoalitions source)
public Coalitions()
public Coalitions(Weights weights)
weights - not null.| Method Detail |
|---|
public String toString()
toString in class Objectpublic boolean hasNulWeight()
true iff at least one weight is semantically nul, i.e. does not take part in any winning
coalition except the total one. If true, at least the smallest weight is nul.public int hashCode()
hashCode in class Object
public boolean approxEquals(ICoalitions c2,
double tolerance)
approxEquals in interface ICoalitionspublic Double getMajorityThreshold()
getMajorityThreshold in interface ICoalitionsnull iff no threshold. Otherwise, a positive or zero value.public Double setMajorityThreshold(double majorityThreshold)
ICoalitions
setMajorityThreshold in interface ICoalitionsmajorityThreshold - a positive or zero value.
null iff it was not set.public Weights getNormalizedWeights()
ICoalitions
getNormalizedWeights in interface ICoalitionsnull.public Double getWeight(Criterion criterion)
getWeight in interface ICoalitionscriterion - not null.
null if the given
criterion is unknown.public boolean isNormalized()
isNormalized in interface ICoalitionspublic void putAll(Weights weights)
public int numberOfWeights()
public Weights getWeights()
ICoalitions
getWeights in interface ICoalitionsnull.public Set<Criterion> getCriteria()
ICoalitions
getCriteria in interface ICoalitionsnull.public void setMajorityThreshold(Double majorityThreshold)
majorityThreshold - a valid value (not infinite or NaN). To unset the value, set it to null.
public void setWeight(Criterion criterion,
Double weight)
setWeight in interface ICoalitionscriterion - not null.weight - a positive or zero value, or null to remove it.
public Double putWeight(Criterion criterion,
double weight)
ICoalitions
putWeight in interface ICoalitionscriterion - not null.weight - a positive or zero value.
null if
it was unknown.public Double removeMajorityThreshold()
ICoalitions
removeMajorityThreshold in interface ICoalitionsnull iff it was not set.public Double getNormalizedWeight(Criterion criterion)
getNormalizedWeight in interface ICoalitionspublic Double removeWeight(Criterion criterion)
public boolean equals(Object obj)
equals in class Objectpublic boolean isEmpty()
ICoalitions
isEmpty in interface ICoalitionstrue iff this object contains no weights and no majority threshold.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||