java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
- All Implemented Interfaces:
CPConstraint,ConcreteConstraint<ConcreteCPModel>
- Direct Known Subclasses:
Absolute,Alternative,Among,AtLeastNValueDC,AtLeastNValueFWC,BinaryKnapsack,BinPacking,CardinalityMaxFWC,CardinalityMinFWC,Circuit,CostCardinalityMaxDC,CPConstraintClosure,CPConstraintClosureWithDelta,Cumulative,CumulativeDecomposition,Distance,Duration,Element1D,Element1DDC,Element1DVar,Element2D,EndAfter,EndAtEnd,EndAtStart,EndBefore,EndBeforeEnd,EndBeforeStart,Equal,Exclude,GeneralizedCumulativeChecker,GeneralizedCumulativeConstraint,GeneralizedCumulativeConstraintBaseLine,GeneralizedCumulativeSweepMax,GeneralizedCumulativeSweepMin,Insert,IntervalVarEnd,IntervalVarEndOrValue,IntervalVarLength,IntervalVarLengthOrValue,IntervalVarStart,IntervalVarStartOrValue,InversePerm,IsEndAfter,IsEndBefore,IsEndBeforeEnd,IsEndBeforeStart,IsEqual,IsEqualVar,IsIncluded,IsLessOrEqual,IsLessOrEqualVar,IsOr,IsStartBefore,IsStartBeforeEnd,IsStartBeforeStart,IsSubset,LessOrEqual,LightBinaryKnapsack,Maximum,Mul,MulCte,MulCteRes,MulVar,NegTableCT,NoOverlap,NoOverlapBC,NoOverlapBinary,NoOverlapBinaryWithTransitionTime,NotBetween,NotEqual,NotSubset,Or,Precedence,RelaxedSequence,Require,SetCard,ShortTableCT,SoftCardinalityDC,Sorted,Square,StartAfter,StartAtEnd,StartAtStart,StartBefore,StartBeforeEnd,StartBeforeStart,SubCircuit,SubSequence,Subset,Sum,TableCT,TransitionTimes
Abstract class the most of the constraints
should extend.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisActive()Returns the active status of the constraint.booleanReturns the schedule status in the fix-point.voidpost()Initializes the constraint when it is posted to the solver.intpriority()voidPropagates the constraint.voidregisterDelta(Delta delta) voidsetActive(boolean active) Activates or deactivates the constraint such that it is not scheduled any more.voidsetScheduled(boolean scheduled) Set the status of the constraint as scheduled to be propagated by the fix-point.void
-
Constructor Details
-
AbstractCPConstraint
-
-
Method Details
-
post
public void post()Description copied from interface:CPConstraintInitializes the constraint when it is posted to the solver.- Specified by:
postin interfaceCPConstraint
-
getSolver
-
propagate
public void propagate()Description copied from interface:CPConstraintPropagates the constraint.- Specified by:
propagatein interfaceCPConstraint
-
registerDelta
- Specified by:
registerDeltain interfaceCPConstraint
-
updateDeltas
public void updateDeltas()- Specified by:
updateDeltasin interfaceCPConstraint
-
setScheduled
public void setScheduled(boolean scheduled) Description copied from interface:CPConstraintSet the status of the constraint as scheduled to be propagated by the fix-point. This method Called by the solver when the constraint is enqueued in the propagation queue and is not intended to be called by the user.- Specified by:
setScheduledin interfaceCPConstraint- Parameters:
scheduled- a value that is true when the constraint is enqueued in the propagation queue, false when dequeued- See Also:
-
isScheduled
public boolean isScheduled()Description copied from interface:CPConstraintReturns the schedule status in the fix-point.- Specified by:
isScheduledin interfaceCPConstraint- Returns:
- the last
CPConstraint.setScheduled(boolean)given to setScheduled
-
setActive
public void setActive(boolean active) Description copied from interface:CPConstraintActivates or deactivates the constraint such that it is not scheduled any more.Typically called by the Constraint to let the solver know it should not be scheduled any more when it is subsumed.
By default the constraint is active.
- Specified by:
setActivein interfaceCPConstraint- Parameters:
active- the status to be set, this state is reversible and unset on state restorationStateManager.restoreState()
-
isActive
public boolean isActive()Description copied from interface:CPConstraintReturns the active status of the constraint.- Specified by:
isActivein interfaceCPConstraint- Returns:
- the last setValue passed to {
CPConstraint.setActive(boolean)in this state frameStateManager.restoreState().
-
priority
public int priority()- Specified by:
priorityin interfaceCPConstraint
-