public abstract class FunctionMetric extends Function implements FunctionMetricDef
MetricCompare
objects only.config, mathCompare, valueType
Constructor and Description |
---|
FunctionMetric()
Create a new instance of FunctionMetric.
|
FunctionMetric(java.lang.String thisValueType)
Create a new instance of FunctionMetric.
|
FunctionMetric(java.lang.String thisValueType,
java.util.HashMap<java.lang.String,?> thisConfig)
Create a new instance of FunctionMetric.
|
Modifier and Type | Method and Description |
---|---|
abstract ReplySet |
evaluate(MetricDataset ds1,
MetricDataset ds2)
Evaluate the comparison between the two datasets and return the result.
|
protected ReplySet |
evaluateCompare(MetricCompare dataset)
Return a value based on the function evaluation.
|
abstract boolean |
isBetter(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Return true if value2 is better than value1, as determined by the measurements of
this evaluation function.
|
boolean |
lib()
Return true if a larger distance between the two vectors is better.
|
abstract FunctionMetric |
newInstance()
Create and return a new instance of the function, initialised with this function's
value type
valueType and math evaluator eval . |
abstract boolean |
sib()
Return true if a smaller distance between the two vectors is better.
|
checkValueType, createFunction, createFunction, createFunction, evaluate, getConfigParams, initialise, innerObject, isLegalNumber, setConfigParams, setEvaluator, setValueType
public FunctionMetric() throws java.lang.Exception
java.lang.Exception
- any error.public FunctionMetric(java.lang.String thisValueType) throws java.lang.Exception
eval
evaluator is set to SimpleMathCompare
.
To change this, use the setEvaluator
method.thisValueType
- the type of object being evaluated. Can be null if set later or not used.java.lang.Exception
- any error.public FunctionMetric(java.lang.String thisValueType, java.util.HashMap<java.lang.String,?> thisConfig) throws java.lang.Exception
eval
evaluator is set to SimpleMathCompare
.
To change this, use the setEvaluator
method.thisValueType
- the type of object being evaluated. Can be null if set later or not used.thisConfig
- list of initialisation function-specific parameters.java.lang.Exception
- any error.public abstract boolean isBetter(java.lang.String valueType, java.lang.Object value1, java.lang.Object value2) throws java.lang.Exception
valueType
- the java type of the values to be evaluated.value1
- the first value type.value2
- the second value type.java.lang.Exception
- any error.public abstract boolean sib()
public boolean lib()
sib()
.public abstract FunctionMetric newInstance() throws java.lang.Exception
valueType
and math evaluator eval
.java.lang.Exception
- any error.protected ReplySet evaluateCompare(MetricCompare dataset) throws java.lang.Exception
dataset
- the value to pass through the function. This must
be of type MetricCompare
, for comparing two different value sets. The
individual components of the MetricCompare object are then passed to the
evaluate
function which would be expected to return a floating point
evaluation.java.lang.Exception
- any error.public abstract ReplySet evaluate(MetricDataset ds1, MetricDataset ds2) throws java.lang.Exception
evaluate
in interface FunctionMetricDef
ds1
- first dataset.ds2
- second dataset.ReplySet
object.java.lang.Exception
- any error.