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

## Class VariableBindingBasedCostFunction

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

- All Implemented Interfaces:
    ICostFunction

      public class VariableBindingBasedCostFunction
      extends java.lang.Object
      implements ICostFunction

  This class can be used to calculate cost of application of a constraint with a given adornment. For now the logic is based on the following principles:
- The transitive closures, NACs and count finds are the most expensive operations
- The number of free variables increase the cost
- If all the variables of a constraint are free, then its cost equals to twice the number of its parameter variables. This solves the problem of unnecessary iteration over instances at the beginning of a plan (thus causing very long run times when executing the plan) by applying constraints based on structural features as soon as possible.

Since:
  1.4

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VariableBindingBasedCostFunction()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `apply(IConstraintEvaluationContext input)`

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

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

- - ### Constructor Detail

    - #### VariableBindingBasedCostFunction

          public VariableBindingBasedCostFunction()

  - ### Method Detail

    - #### apply

          public double apply(IConstraintEvaluationContext input)

      Specified by:
        `apply` in interface `ICostFunction`