Module org.maxicp

Class CPFlatCumulFunction

java.lang.Object
org.maxicp.cp.engine.constraints.scheduling.CPFlatCumulFunction
All Implemented Interfaces:
CPCumulFunction, CumulFunction

public class CPFlatCumulFunction extends Object implements CPCumulFunction
CP implementation of a Flat Cumulative Function
Author:
Pierre Schaus, Charles Thomas, Augustin Delecluse
  • Constructor Details

    • CPFlatCumulFunction

      public CPFlatCumulFunction()
  • Method Details

    • flatten

      public List<Activity> flatten(boolean positive)
      Description copied from interface: CPCumulFunction
      Returns a list of all the activities contributing to this cumulative function. Transformations are applied to the activities following the internal AST of the cumul function.
      Specified by:
      flatten in interface CPCumulFunction
      Parameters:
      positive - A boolean indicating the sign to be applied when flattening the cumul function
      Returns:
      A list of all the flattened activities contributing to this cumulative function.
    • heightAtStart

      public CPIntVar heightAtStart(IntervalVar interval)
      Description copied from interface: CumulFunction
      Returns an IntExpression representing the height of the cumul function at the start of the interval variable given in parameter.
      Specified by:
      heightAtStart in interface CPCumulFunction
      Specified by:
      heightAtStart in interface CumulFunction
      Parameters:
      interval - an IntervalVar
      Returns:
      an int expression representing the height of the cumul function at the start of interval
    • heightAtEnd

      public CPIntVar heightAtEnd(IntervalVar interval)
      Description copied from interface: CumulFunction
      Returns an IntExpression representing the height of the cumul function at the end of the interval variable given in parameter.
      Specified by:
      heightAtEnd in interface CPCumulFunction
      Specified by:
      heightAtEnd in interface CumulFunction
      Parameters:
      interval - an IntervalVar
      Returns:
      an int expression representing the height of the cumul function at the end of interval
    • inScope

      public boolean inScope(IntervalVar interval)
      Description copied from interface: CumulFunction
      Returns whether the interval var given in parameter contributes to the cumul function
      Specified by:
      inScope in interface CPCumulFunction
      Specified by:
      inScope in interface CumulFunction
      Parameters:
      interval - an IntervalVar
      Returns:
      a boolean that indicates if interval contributes to the cumul function.