Module org.maxicp

Class IntervalVarLengthOrValue

java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.scheduling.IntervalVarLengthOrValue
All Implemented Interfaces:
CPConstraint, ConcreteConstraint<ConcreteCPModel>

public class IntervalVarLengthOrValue extends AbstractCPConstraint
Constraint linking the length (duration) of an interval variable var to an integer variable length when var is present, or fixing length to a default value when var is absent.
Author:
Charles Thomas
  • Constructor Details

    • IntervalVarLengthOrValue

      public IntervalVarLengthOrValue(CPIntervalVar var, CPIntVar length, int value)
      Creates a constraint enforcing length == length(var) if var is present, and length == value if var is absent.
      Parameters:
      var - the interval variable
      length - the integer variable representing the length of var or value
      value - the fallback value assigned to length when var is absent
  • Method Details