java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.seqvar.SubSequence
- All Implemented Interfaces:
CPConstraint,ConcreteConstraint<ConcreteCPModel>
Links two
CPSeqVar, ensuring a subsequence appears within a super sequence-
Constructor Summary
ConstructorsConstructorDescriptionSubSequence(CPSeqVar mainSequence, CPSeqVar subSequence) Ensures that the ordering from a subsequence appears within a super sequence, including all of its nodes The super sequence can have other nodes belonging to its ordering as well Example: mainSequence: 0 -> 1 -> 2 -> 3 -> 4 subSequence: 0 -> 2 -> 4 -
Method Summary
Methods inherited from class org.maxicp.cp.engine.core.AbstractCPConstraint
getSolver, isActive, isScheduled, priority, registerDelta, setActive, setScheduled, updateDeltas
-
Constructor Details
-
SubSequence
Ensures that the ordering from a subsequence appears within a super sequence, including all of its nodes The super sequence can have other nodes belonging to its ordering as well Example: mainSequence: 0 -> 1 -> 2 -> 3 -> 4 subSequence: 0 -> 2 -> 4- Parameters:
mainSequence- super sequencesubSequence- sub sequence, whose ordering appears within the main sequence. The ordering appearing in the super sequence must not be consecutive
-
-
Method Details
-
post
public void post()Description copied from interface:CPConstraintInitializes the constraint when it is posted to the solver.- Specified by:
postin interfaceCPConstraint- Overrides:
postin classAbstractCPConstraint
-
propagate
public void propagate()Description copied from interface:CPConstraintPropagates the constraint.- Specified by:
propagatein interfaceCPConstraint- Overrides:
propagatein classAbstractCPConstraint
-