Class Neo4jDistanceWithMetrics

java.lang.Object
org.evomaster.client.java.controller.internal.db.neo4j.Neo4jDistanceWithMetrics

public final class Neo4jDistanceWithMetrics extends Object
Result of scoring one captured Cypher query against the live graph: the distance to satisfying the query, how many graph nodes were considered, and whether the evaluation failed.

The distance is 1 - ofTrue of the Truthness computed by the heuristics calculator, so a computed value lies in [0,1] by construction, with 0 meaning the query is satisfied. A failed evaluation carries Neo4jHeuristicsCalculator.MAX_NEO4J_DISTANCE.

  • Constructor Details

    • Neo4jDistanceWithMetrics

      public Neo4jDistanceWithMetrics(double distance, int numberOfEvaluatedNodes, boolean evaluationFailure)
      Creates a Neo4j heuristic result.
      Parameters:
      distance - distance to satisfying the query, 0 meaning satisfied
      numberOfEvaluatedNodes - number of graph nodes considered
      evaluationFailure - whether the evaluation failed, in which case the distance must be Neo4jHeuristicsCalculator.MAX_NEO4J_DISTANCE
  • Method Details

    • getDistance

      public double getDistance()
      Returns:
      distance to satisfying the query, 0 meaning satisfied, Neo4jHeuristicsCalculator.MAX_NEO4J_DISTANCE on failure
    • getNumberOfEvaluatedNodes

      public int getNumberOfEvaluatedNodes()
      Returns:
      number of graph nodes considered
    • isEvaluationFailure

      public boolean isEvaluationFailure()
      Returns:
      whether the evaluation failed