org.eclipse.viatra.query.runtime.localsearch.planner.cost.impl

## Class IndexerBasedConstraintCostFunction

- java.lang.Object
- - org.eclipse.viatra.query.runtime.localsearch.planner.cost.impl.StatisticsBasedConstraintCostFunction
  - - org.eclipse.viatra.query.runtime.localsearch.planner.cost.impl.IndexerBasedConstraintCostFunction

- All Implemented Interfaces:
    ICostFunction
  Direct Known Subclasses:
    HybridMatcherConstraintCostFunction

      public class IndexerBasedConstraintCostFunction
      extends StatisticsBasedConstraintCostFunction

  Cost function which calculates cost based on the cardinality of items in the runtime model, provided by the base indexer
  Since:
    1.4

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.viatra.query.runtime.localsearch.planner.cost.impl.StatisticsBasedConstraintCostFunction

      `DEFAULT_COST, EVAL_UNWIND_EXTENSION_FACTOR, INVERSE_NAVIGATION_PENALTY_DEFAULT, INVERSE_NAVIGATION_PENALTY_GENERIC, MAX_COST`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexerBasedConstraintCostFunction()`
    `IndexerBasedConstraintCostFunction(double inverseNavigationPenalty)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Optional<java.lang.Long>` | `projectionSize(IConstraintEvaluationContext input, IInputKey supplierKey, TupleMask groupMask, Accuracy requiredAccuracy)` Override this to provide custom statistics on edge/node counts.

    - ### Methods inherited from class org.eclipse.viatra.query.runtime.localsearch.planner.cost.impl.StatisticsBasedConstraintCostFunction

      `_calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, _calculateCost, apply, bucketSize, calculateBinaryCost, calculateBinaryExtendCost, calculateCost, calculateUnaryConstraintCost, countTuples, navigatesThroughFunctionalDependency, navigatesThroughFunctionalDependency, navigatesThroughFunctionalDependencyInverse`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IndexerBasedConstraintCostFunction

          public IndexerBasedConstraintCostFunction()

    - #### IndexerBasedConstraintCostFunction

          public IndexerBasedConstraintCostFunction(double inverseNavigationPenalty)

      Parameters:
        `inverseNavigationPenalty` -
      Since:
        2.1

  - ### Method Detail

    - #### projectionSize

          public java.util.Optional<java.lang.Long> projectionSize(IConstraintEvaluationContext input,
                                                                   IInputKey supplierKey,
                                                                   TupleMask groupMask,
                                                                   Accuracy requiredAccuracy)

      Description copied from class: `StatisticsBasedConstraintCostFunction`
      Override this to provide custom statistics on edge/node counts. New implementors shall implement this instead of `StatisticsBasedConstraintCostFunction.countTuples(IConstraintEvaluationContext, IInputKey)`
      Overrides:
        `projectionSize` in class `StatisticsBasedConstraintCostFunction`