Modifier and Type | Field and Description |
---|---|
static ScalarWeight |
NON_VIABLE_WEIGHT
Instance of scalar weight to mark links/paths which
can not be traversed.
|
Constructor and Description |
---|
ScalarWeight(double value)
Creates a new scalar weight with the given double value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Weight otherWeight) |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isNegative()
Returns true if the weight is negative (means that aggregated
path cost will decrease if we add weighted subject to it).
|
boolean |
isViable()
Returns true if the weighted subject (link/path) can be traversed; false otherwise.
|
Weight |
merge(Weight otherWeight)
Merges the given weight with this one returning a new aggregated
weight.
|
static double |
samenessThreshold()
Returns the current sameness threshold for comparing cost values.
|
static void |
setSamenessThreshold(double threshold)
Sets a new sameness threshold for comparing cost values; default is
is
Double.MIN_VALUE . |
Weight |
subtract(Weight otherWeight)
Subtracts the given weight from this one and produces a new weight.
|
java.lang.String |
toString() |
static ScalarWeight |
toWeight(double value)
Creates a new scalar weight with the given double value.
|
double |
value()
Returns inner double value.
|
public static final ScalarWeight NON_VIABLE_WEIGHT
public ScalarWeight(double value)
value
- double valuepublic static ScalarWeight toWeight(double value)
value
- double valuepublic Weight merge(Weight otherWeight)
Weight
public Weight subtract(Weight otherWeight)
Weight
public boolean isViable()
Weight
public int compareTo(Weight otherWeight)
compareTo
in interface java.lang.Comparable<Weight>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isNegative()
Weight
isNegative
in interface Weight
public java.lang.String toString()
toString
in class java.lang.Object
public double value()
public static void setSamenessThreshold(double threshold)
Double.MIN_VALUE
.threshold
- fractional double valuepublic static double samenessThreshold()