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 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 Description java.util.Set<PVariable>getBoundVariables()Bound variables at the time of evaluating the constraintPConstraintCategorygetCategory(PBody pBody, java.util.Set<PVariable> boundVariables)PConstraintgetConstraint()Get the constraint to be evaluateddoublegetCost()java.util.Set<PVariable>getFreeVariables()Unbound variables at the time of evaluating the constraintQueryAnalyzergetQueryAnalyzer()IQueryRuntimeContextgetRuntimeContext()java.util.Set<PConstraintInfo>getSameWithDifferentBindings()IQueryResultProviderAccessresultProviderAccess()Deprecated.ResultProviderRequestorresultProviderRequestor()java.lang.StringtoString()
-
-
-
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 storedboundMaskVariables- the bound variables in the operation maskfreeMaskVariables- the free variables in the operation masksameWithDifferentBindings- 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 adornmentcontext- the query backend context
-
-
Method Detail
-
getRuntimeContext
public IQueryRuntimeContext getRuntimeContext()
- Specified by:
getRuntimeContextin interfaceIConstraintEvaluationContext
-
getQueryAnalyzer
public QueryAnalyzer getQueryAnalyzer()
- Specified by:
getQueryAnalyzerin interfaceIConstraintEvaluationContext
-
getConstraint
public PConstraint getConstraint()
Description copied from interface:IConstraintEvaluationContextGet the constraint to be evaluated- Specified by:
getConstraintin interfaceIConstraintEvaluationContext
-
getFreeVariables
public java.util.Set<PVariable> getFreeVariables()
Description copied from interface:IConstraintEvaluationContextUnbound variables at the time of evaluating the constraint- Specified by:
getFreeVariablesin interfaceIConstraintEvaluationContext
-
getBoundVariables
public java.util.Set<PVariable> getBoundVariables()
Description copied from interface:IConstraintEvaluationContextBound variables at the time of evaluating the constraint- Specified by:
getBoundVariablesin interfaceIConstraintEvaluationContext
-
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:
toStringin classjava.lang.Object
-
resultProviderAccess
@Deprecated public IQueryResultProviderAccess resultProviderAccess()
Deprecated.- Specified by:
resultProviderAccessin interfaceIConstraintEvaluationContext
-
resultProviderRequestor
public ResultProviderRequestor resultProviderRequestor()
- Specified by:
resultProviderRequestorin interfaceIConstraintEvaluationContext
-
-