Module org.maxicp
Class CPStepAtEndCumulFunction
java.lang.Object
org.maxicp.cp.engine.constraints.scheduling.CPStepAtEndCumulFunction
- All Implemented Interfaces:
CPCumulFunction,CumulFunction
CP implementation of a Step at End Cumulative Function
- Author:
- Pierre Schaus, Charles Thomas, Augustin Delecluse
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCPStepAtEndCumulFunction(CPIntervalVar var, int h) Creates a step-at-end cumulative function for an interval variable with fixed step heighth.CPStepAtEndCumulFunction(CPIntervalVar var, int hMin, int hMax) Creates a step-at-end cumulative function for an interval variable with step height in[hMin, hMax]. -
Method Summary
Modifier and TypeMethodDescriptionflatten(boolean positive) Returns a list of all the activities contributing to this cumulative function.heightAtEnd(IntervalVar interval) Returns anIntExpressionrepresenting the height of the cumul function at the end of the interval variable given in parameter.heightAtStart(IntervalVar interval) Returns anIntExpressionrepresenting the height of the cumul function at the start of the interval variable given in parameter.booleaninScope(IntervalVar interval) Returns whether the interval var given in parameter contributes to the cumul function
-
Field Details
-
var
-
height
-
-
Constructor Details
-
CPStepAtEndCumulFunction
Creates a step-at-end cumulative function for an interval variable with step height in[hMin, hMax].- Parameters:
var- the interval variable at the end of which the step occurshMin- the minimum step height (must be> 0)hMax- the maximum step height (must be>= hMin)
-
CPStepAtEndCumulFunction
Creates a step-at-end cumulative function for an interval variable with fixed step heighth.- Parameters:
var- the interval variable at the end of which the step occursh- the fixed step height (must be> 0)
-
-
Method Details
-
flatten
Description copied from interface:CPCumulFunctionReturns 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:
flattenin interfaceCPCumulFunction- 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.
-
inScope
Description copied from interface:CumulFunctionReturns whether the interval var given in parameter contributes to the cumul function- Specified by:
inScopein interfaceCPCumulFunction- Specified by:
inScopein interfaceCumulFunction- Parameters:
interval- anIntervalVar- Returns:
- a boolean that indicates if interval contributes to the cumul function.
-
heightAtStart
Description copied from interface:CumulFunctionReturns anIntExpressionrepresenting the height of the cumul function at the start of the interval variable given in parameter.- Specified by:
heightAtStartin interfaceCPCumulFunction- Specified by:
heightAtStartin interfaceCumulFunction- Parameters:
interval- anIntervalVar- Returns:
- an int expression representing the height of the cumul function at the start of interval
-
heightAtEnd
Description copied from interface:CumulFunctionReturns anIntExpressionrepresenting the height of the cumul function at the end of the interval variable given in parameter.- Specified by:
heightAtEndin interfaceCPCumulFunction- Specified by:
heightAtEndin interfaceCumulFunction- Parameters:
interval- anIntervalVar- Returns:
- an int expression representing the height of the cumul function at the end of interval
-