Class Neo4jHeuristicsCalculator
java.lang.Object
org.evomaster.client.java.controller.neo4j.heuristics.Neo4jHeuristicsCalculator
Computes the search heuristic
H(Q, G) of a parsed Cypher MATCH query Q against a
captured graph G, returning a Truthness (how close G is to satisfying
Q). It works in Truthness end-to-end, reusing the shared TruthnessUtils
primitives for the aggregations.
H(Q, G) = andAggregation(H_match(P_s, G), H_where(C_all, matched_elements(P_s, G))), where
P_s is the structural pattern and C_all the conditions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleBase value a partial score is scaled from, so that a query that matched nothing still ranks below one that matched something.static final doubleDistance reported when a query could not be evaluated at all, so that a failure never looks closer to satisfied than a genuine miss. -
Constructor Summary
ConstructorsConstructorDescriptionNeo4jHeuristicsCalculator(org.evomaster.client.java.sql.internal.TaintHandler taintHandler) -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeDistance(MatchOperation query, Neo4jGraph graph) Converts a heuristic to the distance form:1 - ofTrue, which lies in[0,1]by construction ofTruthness, where 0 means the query is satisfied.org.evomaster.client.java.distance.heuristics.TruthnesscomputeHeuristic(MatchOperation query, Neo4jGraph graph) org.evomaster.client.java.distance.heuristics.TruthnesscomputeHeuristicMatchNodes(int required, int available) Count-based node availability: enough graph nodes to bind the pattern's nodes.
-
Field Details
-
C
public static final double CBase value a partial score is scaled from, so that a query that matched nothing still ranks below one that matched something. NamedCafter the constant inFormalizing.md; it is the same valueTruthnessUtils.TRUE_TRUTHNESSuses for itsofFalse.- See Also:
-
MAX_NEO4J_DISTANCE
public static final double MAX_NEO4J_DISTANCEDistance reported when a query could not be evaluated at all, so that a failure never looks closer to satisfied than a genuine miss.- See Also:
-
-
Constructor Details
-
Neo4jHeuristicsCalculator
public Neo4jHeuristicsCalculator() -
Neo4jHeuristicsCalculator
public Neo4jHeuristicsCalculator(org.evomaster.client.java.sql.internal.TaintHandler taintHandler)
-
-
Method Details
-
computeHeuristic
public org.evomaster.client.java.distance.heuristics.Truthness computeHeuristic(MatchOperation query, Neo4jGraph graph) -
computeDistance
Converts a heuristic to the distance form:1 - ofTrue, which lies in[0,1]by construction ofTruthness, where 0 means the query is satisfied. -
computeHeuristicMatchNodes
public org.evomaster.client.java.distance.heuristics.Truthness computeHeuristicMatchNodes(int required, int available) Count-based node availability: enough graph nodes to bind the pattern's nodes. Pure cardinality, no label/property check (those are conditions evaluated by H_where).
-