public class SparseDyadRankingInstance extends ADyadRankingInstance implements INumericArrayInstance
| Constructor and Description |
|---|
SparseDyadRankingInstance(ai.libs.jaicore.math.linearalgebra.Vector instance,
java.util.List<ai.libs.jaicore.math.linearalgebra.Vector> alternatives)
Construct a new sparse dyad ranking instance containing the given instance
vector and ordering of alternatives.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
IAttributeValue<?>[] |
getAllAttributeValues() |
double[] |
getAsDoubleVector()
Turns the instance into a double vector.
|
IAttributeValue<java.lang.Double> |
getAttributeValue(int position) |
<T> IAttributeValue<T> |
getAttributeValueAtPosition(int position,
java.lang.Class<T> type)
Getter for the value of an attribute for the given position.
|
Dyad |
getDyadAtPosition(int position)
Get the dyad at the specified position in the ordering contained in this
instance.
|
int |
getNumberOfAttributes()
Getter for the number of attributes for the instance.
|
SparseDyadRankingInstance |
getTargetValue()
Getter for the value of the target attribute.
|
int |
hashCode() |
java.util.Iterator<Dyad> |
iterator() |
int |
length()
Get the number of dyads in the ranking.
|
java.lang.String |
toString() |
toMatrixclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPointpublic SparseDyadRankingInstance(ai.libs.jaicore.math.linearalgebra.Vector instance,
java.util.List<ai.libs.jaicore.math.linearalgebra.Vector> alternatives)
instance - the instance for all of the alternativesalternatives - the ordering of alternatives that, when combined with the
instances is an ordering of dyadspublic <T> IAttributeValue<T> getAttributeValueAtPosition(int position, java.lang.Class<T> type)
IAttributeArrayInstancegetAttributeValueAtPosition in interface IAttributeArrayInstanceposition - The position of the attribute within the instance.type - The type for which the attribute value shall be returned.public SparseDyadRankingInstance getTargetValue()
ILabeledInstancegetTargetValue in interface ILabeledInstance<IDyadRankingInstance>public double[] getAsDoubleVector()
throws ContainsNonNumericAttributesException
INumericArrayInstancegetAsDoubleVector in interface INumericArrayInstanceContainsNonNumericAttributesException - Thrown if the instance is to be converted into a double vector and still contains non-numeric attributes.public java.util.Iterator<Dyad> iterator()
iterator in interface java.lang.Iterable<Dyad>public Dyad getDyadAtPosition(int position)
IDyadRankingInstancegetDyadAtPosition in interface IDyadRankingInstanceposition - The position in the ordering for which to get the dyadpublic int length()
IDyadRankingInstancelength in interface IDyadRankingInstancepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic IAttributeValue<?>[] getAllAttributeValues()
getAllAttributeValues in interface IAttributeArrayInstancepublic int getNumberOfAttributes()
IAttributeArrayInstancegetNumberOfAttributes in interface IAttributeArrayInstancepublic IAttributeValue<java.lang.Double> getAttributeValue(int position)
getAttributeValue in interface INumericArrayInstance