public class PairwiseComparisons
extends java.lang.Object
PREFERENCE, INVERSE_PREFERENCE, INDIFFERENCE or INCOMPARABILITY.| Modifier and Type | Field | Description |
|---|---|---|
static int |
INCOMPARABILITY |
Constant indicating incomparability relation
|
static int |
INDIFFERENCE |
Constant indicating indifference relation
|
static int |
INVERSE_PREFERENCE |
Constant indicating inverse preference relation
|
static int |
PREFERENCE |
Constant indicating preference relation
|
static int |
UNDEFINED |
Constant indicating undefined binary relation
|
| Constructor | Description |
|---|---|
PairwiseComparisons() |
Sole constructor
|
PairwiseComparisons(SimpleRanking ranking) |
Converts given simple ranking to a set of pairwise comparisons stored in this object.
|
| Modifier and Type | Method | Description |
|---|---|---|
PairOfIndices[] |
getRelation(int relation) |
Get pairs of objects' indices for pairs of objects belonging to a given relation.
|
int |
getRelationOfPairOfObjects(int indexOfFirstObject,
int indexOfSecondObject) |
Gets relation for ordered pair of objects with given indices.
|
void |
removePairwiseComparison(int indexOfFirstObject,
int indexOfSecondObject) |
Removes pair of objects with given indices from the relation it belongs to.
|
int |
size() |
Gets the number of pairwise comparisons stored in this object
|
int |
sizeI() |
Gets the number of pairs in indifference relation
|
int |
sizeP() |
Gets the number of pairs in preference relation
|
int |
sizePc() |
Gets the number of pairs in inverse preference relation
|
int |
sizeR() |
Gets the number of pairs in incomparability relation
|
void |
storePairwiseComparison(int indexOfFirstObject,
int indexOfSecondObject,
int relation) |
Puts ordered pair of objects with given indices into given relation.
|
public static final int UNDEFINED
public static final int PREFERENCE
public static final int INVERSE_PREFERENCE
public static final int INDIFFERENCE
public static final int INCOMPARABILITY
public PairwiseComparisons()
public PairwiseComparisons(SimpleRanking ranking)
ranking - simple ranking to convertpublic void storePairwiseComparison(int indexOfFirstObject,
int indexOfSecondObject,
int relation)
indexOfFirstObject - index of the first object in an ordered pair of objectsindexOfSecondObject - index of the second object in an ordered pair of objectsrelation - Target relation. Can be one of PREFERENCE, INVERSE_PREFERENCE,
INDIFFERENCE or INCOMPARABILITY.InvalidValueException - when any of the given object's indices is smaller than zero
or when given relation is none of PREFERENCE, INVERSE_PREFERENCE,
INDIFFERENCE and INCOMPARABILITYpublic int getRelationOfPairOfObjects(int indexOfFirstObject,
int indexOfSecondObject)
indexOfFirstObject - index of the first object in an ordered pair of objectsindexOfSecondObject - index of the second object in an ordered pair of objectsPREFERENCE, INVERSE_PREFERENCE,
INDIFFERENCE or INCOMPARABILITY.
Otherwise, returns UNDEFINED.InvalidValueException - when any of the given object's indices is smaller than zeropublic PairOfIndices[] getRelation(int relation)
relation - relation in questionpublic void removePairwiseComparison(int indexOfFirstObject,
int indexOfSecondObject)
indexOfFirstObject - index of the first object in an ordered pair of objectsindexOfSecondObject - index of the second object in an ordered pair of objectsInvalidValueException - when any of the given object's indices is smaller than zeropublic int size()
public int sizeP()
public int sizePc()
public int sizeI()
public int sizeR()