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

## Class PConstraintInfo

- java.lang.Object
- - org.eclipse.viatra.query.runtime.localsearch.planner.PConstraintInfo

- All Implemented Interfaces:
    IConstraintEvaluationContext

      public class PConstraintInfo
      extends java.lang.Object
      implements IConstraintEvaluationContext

  Wraps a PConstraint together with information required for the planner. Currently contains information about the expected binding state of the affected variables also called application condition, and the cost of the enforcement, based on the meta and/or the runtime context.
  No Reference:
    This class is not intended to be referenced by clients.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PConstraintInfo(PConstraint constraint, java.util.Set<PVariable> boundMaskVariables, java.util.Set<PVariable> freeMaskVariables, java.util.Set<PConstraintInfo> sameWithDifferentBindings, IQueryBackendContext context, ResultProviderRequestor resultRequestor, java.util.function.Function<IConstraintEvaluationContext,java.lang.Double> costFunction)` Instantiates the wrapper

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Set<PVariable>` | `getBoundVariables()` Bound variables at the time of evaluating the constraint
    `PConstraintCategory` | `getCategory(PBody pBody, java.util.Set<PVariable> boundVariables)`
    `PConstraint` | `getConstraint()` Get the constraint to be evaluated
    `double` | `getCost()`
    `java.util.Set<PVariable>` | `getFreeVariables()` Unbound variables at the time of evaluating the constraint
    `QueryAnalyzer` | `getQueryAnalyzer()`
    `IQueryRuntimeContext` | `getRuntimeContext()`
    `java.util.Set<PConstraintInfo>` | `getSameWithDifferentBindings()`
    `IQueryResultProviderAccess` | `resultProviderAccess()` Deprecated. use `resultProviderRequestor()`
    `ResultProviderRequestor` | `resultProviderRequestor()`
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### PConstraintInfo

          public PConstraintInfo(PConstraint constraint,
                                 java.util.Set<PVariable> boundMaskVariables,
                                 java.util.Set<PVariable> freeMaskVariables,
                                 java.util.Set<PConstraintInfo> sameWithDifferentBindings,
                                 IQueryBackendContext context,
                                 ResultProviderRequestor resultRequestor,
                                 java.util.function.Function<IConstraintEvaluationContext,java.lang.Double> costFunction)

      Instantiates the wrapper
      Parameters:
        `constraintfor` - which the information is added and stored
        `boundMaskVariables` - the bound variables in the operation mask
        `freeMaskVariables` - the free variables in the operation mask
        `sameWithDifferentBindings` - during the planning process, multiple operation adornments are considered for a constraint, so that it is represented by multiple plan infos. This parameter contains all plan infos that are for the same constraint, but with different adornment
        `context` - the query backend context

  - ### Method Detail

    - #### getRuntimeContext

          public IQueryRuntimeContext getRuntimeContext()

      Specified by:
        `getRuntimeContext` in interface `IConstraintEvaluationContext`

    - #### getQueryAnalyzer

          public QueryAnalyzer getQueryAnalyzer()

      Specified by:
        `getQueryAnalyzer` in interface `IConstraintEvaluationContext`

    - #### getConstraint

          public PConstraint getConstraint()

      Description copied from interface: `IConstraintEvaluationContext`
      Get the constraint to be evaluated
      Specified by:
        `getConstraint` in interface `IConstraintEvaluationContext`

    - #### getFreeVariables

          public java.util.Set<PVariable> getFreeVariables()

      Description copied from interface: `IConstraintEvaluationContext`
      Unbound variables at the time of evaluating the constraint
      Specified by:
        `getFreeVariables` in interface `IConstraintEvaluationContext`

    - #### getBoundVariables

          public java.util.Set<PVariable> getBoundVariables()

      Description copied from interface: `IConstraintEvaluationContext`
      Bound variables at the time of evaluating the constraint
      Specified by:
        `getBoundVariables` in interface `IConstraintEvaluationContext`

    - #### getSameWithDifferentBindings

          public java.util.Set<PConstraintInfo> getSameWithDifferentBindings()

    - #### getCost

          public double getCost()

    - #### getCategory

          public PConstraintCategory getCategory(PBody pBody,
                                                 java.util.Set<PVariable> boundVariables)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### resultProviderAccess

          @Deprecated
          public IQueryResultProviderAccess resultProviderAccess()

      Deprecated. use `resultProviderRequestor()`
      Specified by:
        `resultProviderAccess` in interface `IConstraintEvaluationContext`

    - #### resultProviderRequestor

          public ResultProviderRequestor resultProviderRequestor()

      Specified by:
        `resultProviderRequestor` in interface `IConstraintEvaluationContext`