Module org.maxicp

Class Alternative

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

public class Alternative extends AbstractCPConstraint
Alternative Constraint with cardinality: Enforces that if the interval a is present, then c intervals from the array alt must be present and synchronized with a. If a is not present, then all the intervals of alt must be absent.
Author:
Charles Thomas
  • Constructor Details

    • Alternative

      public Alternative(CPIntervalVar a, CPIntervalVar[] alts, CPIntVar c)
      Creates an Alternative constraint with cardinality c.
      Parameters:
      a - the main interval variable
      alts - the array of alternative interval variables
      c - the cardinality variable specifying how many intervals in alts are present when a is present
  • Method Details