Class EdgeWeight
java.lang.Object
org.ranksys.core.util.tuples.Tuple2id
es.uam.eps.ir.ranksys.fast.preference.IdxPref
es.uam.eps.ir.relison.graph.edges.EdgeWeight
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<org.ranksys.core.util.tuples.Tuple2id>
public class EdgeWeight
extends es.uam.eps.ir.ranksys.fast.preference.IdxPref
Class that represents the weight of the edges. Each weight is represented as
a double value. Value 1.0 is considered a default valid value, and NaN as a default
invalid value. Every other value has the interpretation the user wants to give
it.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description EdgeWeight(int idx)Constructor.EdgeWeight(int idx, double value)Constructor. -
Method Summary
Modifier and Type Method Description static doublegetDefaultValue()Default valid type value.static doublegetErrorValue()Default value for the error type.static booleanisDefaultValue(double weight)Given a weight, indicates whether it is the default value.static booleanisErrorValue(double weight)Given a weight, indicates whether it is the error value.
-
Constructor Details
-
EdgeWeight
public EdgeWeight(int idx, double value)Constructor.- Parameters:
idx- Incoming node identifier.value- weight value.
-
EdgeWeight
public EdgeWeight(int idx)Constructor. Assigns the default value weight.- Parameters:
idx- Incoming node identifier.
-
-
Method Details
-
getErrorValue
public static double getErrorValue()Default value for the error type.- Returns:
- The default value for the error type.
-
getDefaultValue
public static double getDefaultValue()Default valid type value.- Returns:
- The default valid type value.
-
isErrorValue
public static boolean isErrorValue(double weight)Given a weight, indicates whether it is the error value.- Parameters:
weight- the weight value.- Returns:
- true if it is, false otherwise.
-
isDefaultValue
public static boolean isDefaultValue(double weight)Given a weight, indicates whether it is the default value.- Parameters:
weight- the weight value.- Returns:
- true if it is, false otherwise.
-