java.lang.Object
java.lang.Record
org.maxicp.modeling.constraints.scheduling.AlwaysIn
- Record Components:
expr- the cumulative function to constrainminValue- the minimum allowed value of the function at any time pointmaxValue- the maximum allowed value of the function at any time point
- All Implemented Interfaces:
Constraint,org.maxicp.modeling.constraints.helpers.CacheScope,org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
public record AlwaysIn(CumulFunction expr, int minValue, int maxValue)
extends Record
implements org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
Constraint that enforces a
CumulFunction to remain within bounds
at every point overlapping the execution of at least one interval.
Specifically, for all time points t overlapping at least one interval:
minValue invalid input: '<'= expr(t) invalid input: '<'= maxValue
This is typically used in cumulative scheduling to enforce resource capacity limits,
e.g. a resource that can handle at most maxValue concurrent tasks and must
never drop below minValue (e.g. for inventory or stock constraints).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
org.maxicp.modeling.constraints.helpers.ConstraintFromRecord.IgnoreScope -
Constructor Summary
ConstructorsConstructorDescriptionAlwaysIn(CumulFunction expr, int minValue, int maxValue) Creates an instance of aAlwaysInrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.expr()Returns the value of theexprrecord component.final inthashCode()Returns a hash code value for this object.intmaxValue()Returns the value of themaxValuerecord component.intminValue()Returns the value of theminValuerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.maxicp.modeling.constraints.helpers.CacheScope
scopeMethods inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
computeScope
-
Constructor Details
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
expr
Returns the value of theexprrecord component.- Returns:
- the value of the
exprrecord component
-
minValue
public int minValue()Returns the value of theminValuerecord component.- Returns:
- the value of the
minValuerecord component
-
maxValue
public int maxValue()Returns the value of themaxValuerecord component.- Returns:
- the value of the
maxValuerecord component
-