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 constraintPConstraintCategory
getCategory(PBody pBody, java.util.Set<PVariable> boundVariables)
PConstraint
getConstraint()
Get the constraint to be evaluateddouble
getCost()
java.util.Set<PVariable>
getFreeVariables()
Unbound variables at the time of evaluating the constraintQueryAnalyzer
getQueryAnalyzer()
IQueryRuntimeContext
getRuntimeContext()
java.util.Set<PConstraintInfo>
getSameWithDifferentBindings()
IQueryResultProviderAccess
resultProviderAccess()
Deprecated.ResultProviderRequestor
resultProviderRequestor()
java.lang.String
toString()
-
-
-
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:
getRuntimeContext
in interfaceIConstraintEvaluationContext
-
getQueryAnalyzer
public QueryAnalyzer getQueryAnalyzer()
- Specified by:
getQueryAnalyzer
in interfaceIConstraintEvaluationContext
-
getConstraint
public PConstraint getConstraint()
Description copied from interface:IConstraintEvaluationContext
Get the constraint to be evaluated- Specified by:
getConstraint
in interfaceIConstraintEvaluationContext
-
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 interfaceIConstraintEvaluationContext
-
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 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:
toString
in classjava.lang.Object
-
resultProviderAccess
@Deprecated public IQueryResultProviderAccess resultProviderAccess()
Deprecated.- Specified by:
resultProviderAccess
in interfaceIConstraintEvaluationContext
-
resultProviderRequestor
public ResultProviderRequestor resultProviderRequestor()
- Specified by:
resultProviderRequestor
in interfaceIConstraintEvaluationContext
-
-