Module org.maxicp
Record Class CPMinusCumulFunction
java.lang.Object
java.lang.Record
org.maxicp.cp.engine.constraints.scheduling.CPMinusCumulFunction
- All Implemented Interfaces:
CPCumulFunction,CumulFunction
public record CPMinusCumulFunction(CPCumulFunction left, CPCumulFunction right)
extends Record
implements CPCumulFunction
CP implementation of a Minus Cumulative Function
- Author:
- Pierre Schaus, Charles Thomas, Augustin Delecluse
-
Constructor Summary
ConstructorsConstructorDescriptionCPMinusCumulFunction(CPCumulFunction left, CPCumulFunction right) Creates an instance of aCPMinusCumulFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.flatten(boolean positive) Returns a list of all the activities contributing to this cumulative function.final inthashCode()Returns a hash code value for this object.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 functionleft()Returns the value of theleftrecord component.right()Returns the value of therightrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CPMinusCumulFunction
Creates an instance of aCPMinusCumulFunctionrecord class.- Parameters:
left- the value for theleftrecord componentright- the value for therightrecord component
-
-
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
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-