public class EvaluateData
extends java.lang.Object
DataQueryModel object and try to make the appropriate evaluation call.
The evaluation can be on a single object, or a comparison between two objects.
The DataQuery should include the data type and also the method to be invoked.
If the invocation is on a single object, then only the dataset is required.
If it is a comparison then both datasets and the operator as well are required.| Modifier and Type | Field and Description |
|---|---|
protected DataQueryModel |
dataInfo
Parameters for constructing the data evaluator
|
protected org.ai_heuristic.def.EvaluateMathDef |
mathCompare
For comparisons of simple java types
|
protected org.ai_heuristic.def.FunctionDef |
mathDistance
For distance measurements between simple java types
|
| Constructor and Description |
|---|
EvaluateData(DataQueryModel theDataInfo)
Create a new instance of EvaluateData.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
abs(java.lang.String valueType,
java.lang.Object value1)
Get the absolute value of the value passed in.
|
java.lang.Object |
add(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Add the two objects together and return.
|
java.lang.Object |
divide(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Divide the first value by the second and return the result.
|
java.lang.Object |
evaluate()
Evaluate using the data settings of
dataInfo. |
org.ai_heuristic.eval.metric.ReplySet |
evaluate(org.ai_heuristic.eval.metric.MetricDataset toEvaluate)
Evaluate the data object directly.
|
org.ai_heuristic.def.EvaluateMathDef |
getMathCompare()
Return the comparison function if one can be created from the
dataInfo. |
boolean |
isCompareFunction()
Return true if the data info relates to a comparison function, not a distance one.
|
boolean |
mathCompare(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2,
java.lang.String operator)
Evaluate the expression.
|
java.lang.Object |
multiply(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Multiply the first value by the second and return the result.
|
java.lang.Object |
numEquiv(java.lang.String valueType,
int numerical)
Get the equivalent of the integer numerical value for the data type.
|
java.lang.Object |
subtract(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Subtract the second value from the first and return the result.
|
protected org.ai_heuristic.def.FunctionDef mathDistance
protected org.ai_heuristic.def.EvaluateMathDef mathCompare
protected DataQueryModel dataInfo
public EvaluateData(DataQueryModel theDataInfo)
theDataInfo - defines what evaluators are used.public boolean isCompareFunction()
EvaluateMathDef and not FunctionMetricDef.public java.lang.Object evaluate()
throws java.lang.Exception
dataInfo. This method performs a comparison
calculation, where a comparison method compares the dataset with the compareWith dataset
in the ComparisonQueryModel dataInfo object.java.lang.Exception - any error.public org.ai_heuristic.eval.metric.ReplySet evaluate(org.ai_heuristic.eval.metric.MetricDataset toEvaluate)
throws java.lang.Exception
toEvaluate - the object to evaluate.java.lang.Exception - any error.public boolean mathCompare(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2,
java.lang.String operator)
throws java.lang.Exception
valueType - the type of the value. This is the object type class name.value1 - first value.value2 - second value.operator - comparison operator - greater than (GT), less than (LT), etc.
These are evaluated using a SimpleEvaluate object from the heuristic package.java.lang.Exception - any error.public java.lang.Object add(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
throws java.lang.Exception
valueType - the type of the value.value1 - first value.value2 - second value.null.java.lang.Exception - any error.public java.lang.Object subtract(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
throws java.lang.Exception
valueType - the type of the value.value1 - first value.value2 - second value.null.java.lang.Exception - any error.public java.lang.Object multiply(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
throws java.lang.Exception
valueType - the type of the value.value1 - first value.value2 - second value.null.java.lang.Exception - any error.public java.lang.Object divide(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
throws java.lang.Exception
valueType - the type of the value.value1 - first value.value2 - second value.null.java.lang.Exception - any error.public java.lang.Object abs(java.lang.String valueType,
java.lang.Object value1)
throws java.lang.Exception
valueType - the type of the value.value1 - first value.java.lang.Exception - any error.public java.lang.Object numEquiv(java.lang.String valueType,
int numerical)
throws java.lang.Exception
valueType - the type of the value.numerical - an integer numerical value.java.lang.Exception - any error.public org.ai_heuristic.def.EvaluateMathDef getMathCompare()
throws java.lang.Exception
dataInfo.null if one cannot be created.java.lang.Exception - any error.