public class EvaluateSolverData
extends org.licas.data.EvaluateData
EvaluateData
object to allow some other
AI-related structures to be included. The main methods are evalComparison
to mathCompare two objects, or mathOperation
to perform a mathematical operator over
two objects. As well as Integer
, Long
, Float
, Double
and
String
, this implementation also evaluates a BagOfWords
or a MetaBagOfWords
object.Constructor and Description |
---|
EvaluateSolverData(org.licas.data.DataQueryModel theDataQuery)
Create a new instance of EvaluateSolverData
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Double |
add(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
Add the two BagOfWords values together.
|
protected java.lang.Double |
add(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
Add the two MetaBagOfWords values together.
|
java.lang.Object |
add(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Add the two objects together and return.
|
protected java.lang.Double |
divide(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
Divide the first value by the second and return the result.
|
protected java.lang.Double |
divide(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
Divide the first value by the second and return the result.
|
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.
|
protected java.lang.Double |
dotproduct(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
This is the dot-product of the two structures.
|
protected java.lang.Double |
dotproduct(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
This is the dot-product of the two structures.
|
java.lang.Object |
dotproduct(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Dot-product of the object values.
|
protected boolean |
evaluate(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2,
java.lang.String operator)
Evaluate the expression and return true if true.
|
protected boolean |
evaluate(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2,
java.lang.String operator)
Evaluate the expression and return true if true.
|
protected org.ai_heuristic.model.BagOfWords |
intersection(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
This is the intersection of the two structures.
|
protected org.ai_heuristic.model.MetaBagOfWords |
intersection(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
This is the intersection of the two structures.
|
java.lang.Object |
intersection(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Intersection of the object values.
|
protected java.lang.Double |
magnitude(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
This is the magnitude of the two structures.
|
protected java.lang.Double |
magnitude(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
This is the magnitude of the two structures.
|
java.lang.Object |
magnitude(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Magnitude of the object values.
|
boolean |
mathCompare(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2,
java.lang.String operator)
Evaluate the expression and return true if true.
|
java.lang.Object |
mathOperation(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2,
java.lang.String operator)
Evaluate the expression.
|
protected java.lang.Double |
multiply(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
Multiply the first value by the second and return the result.
|
protected java.lang.Double |
multiply(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
Multiply the first value by the second and return the result.
|
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.
|
protected java.lang.Double |
subtract(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
Subtract the values.
|
protected java.lang.Double |
subtract(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
Subtract the values.
|
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.model.BagOfWords |
union(org.ai_heuristic.model.BagOfWords value1,
org.ai_heuristic.model.BagOfWords value2)
This is the union of the two structures.
|
protected org.ai_heuristic.model.MetaBagOfWords |
union(org.ai_heuristic.model.MetaBagOfWords value1,
org.ai_heuristic.model.MetaBagOfWords value2)
This is the union of the two structures.
|
java.lang.Object |
union(java.lang.String valueType,
java.lang.Object value1,
java.lang.Object value2)
Union of the object values.
|
public EvaluateSolverData(org.licas.data.DataQueryModel theDataQuery)
theDataQuery
- defines what evaluators are used.public java.lang.Object mathOperation(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.value1
- first value.value2
- second value.operator
- mathematical operator - can be add, subtract, multiply, divide.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
mathCompare
in class org.licas.data.EvaluateData
valueType
- the type of the value.value1
- first value.value2
- second value.operator
- comparison operator.java.lang.Exception
- any error.protected boolean evaluate(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2, java.lang.String operator)
value1
- first value.value2
- second value.operator
- comparison operator.protected boolean evaluate(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2, java.lang.String operator)
value1
- first value.value2
- second value.operator
- comparison operator.public java.lang.Object union(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.java.lang.Exception
- any error.protected org.ai_heuristic.model.BagOfWords union(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.java.lang.Exception
- any error.protected org.ai_heuristic.model.MetaBagOfWords union(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.java.lang.Exception
- any error.public java.lang.Object intersection(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.java.lang.Exception
- any error.protected org.ai_heuristic.model.BagOfWords intersection(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.java.lang.Exception
- any error.protected org.ai_heuristic.model.MetaBagOfWords intersection(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.java.lang.Exception
- any error.public java.lang.Object dotproduct(java.lang.String valueType, java.lang.Object value1, java.lang.Object value2)
valueType
- the type of the value.value1
- first value.value2
- second value.protected java.lang.Double dotproduct(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2)
value1
- first value.value2
- second value.protected java.lang.Double dotproduct(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2)
value1
- first value.value2
- second value.public java.lang.Object magnitude(java.lang.String valueType, java.lang.Object value1, java.lang.Object value2)
valueType
- the type of the value.value1
- first value.value2
- second value.protected java.lang.Double magnitude(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2)
value1
- first value.value2
- second value.protected java.lang.Double magnitude(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2)
value1
- first value.value2
- second value.public java.lang.Object add(java.lang.String valueType, java.lang.Object value1, java.lang.Object value2) throws java.lang.Exception
add
in class org.licas.data.EvaluateData
valueType
- the type of the value.value1
- first value.value2
- second value.java.lang.Exception
- any error.protected java.lang.Double add(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.java.lang.Exception
- any error.protected java.lang.Double add(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.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
subtract
in class org.licas.data.EvaluateData
valueType
- the type of the value.value1
- first value.value2
- second value.java.lang.Exception
- any error.protected java.lang.Double subtract(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.java.lang.Exception
- any error.protected java.lang.Double subtract(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2) throws java.lang.Exception
value1
- first value.value2
- second value.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
multiply
in class org.licas.data.EvaluateData
valueType
- the type of the value.value1
- first value.value2
- second value.java.lang.Exception
- any error.protected java.lang.Double multiply(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2)
value1
- first value.value2
- second value.protected java.lang.Double multiply(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2)
value1
- first value.value2
- second value.public java.lang.Object divide(java.lang.String valueType, java.lang.Object value1, java.lang.Object value2) throws java.lang.Exception
divide
in class org.licas.data.EvaluateData
valueType
- the type of the value.value1
- first value.value2
- second value.java.lang.Exception
- any error.protected java.lang.Double divide(org.ai_heuristic.model.BagOfWords value1, org.ai_heuristic.model.BagOfWords value2)
value1
- first value.value2
- second value.protected java.lang.Double divide(org.ai_heuristic.model.MetaBagOfWords value1, org.ai_heuristic.model.MetaBagOfWords value2)
value1
- first value.value2
- second value.