java.lang.Object
java.lang.Record
org.maxicp.modeling.constraints.Cumulative
- Record Components:
start- the start time expressions of the activitiesduration- the duration expressions of the activitiesend- the end time expressions of the activities (or empty if not explicitly provided)demand- the resource demand expressions of the activitiescapa- the resource capacity expression
- All Implemented Interfaces:
Constraint,org.maxicp.modeling.constraints.helpers.CacheScope,org.maxicp.modeling.constraints.helpers.ConstraintFromRecord,DecisionVarsProvider
public record Cumulative(IntExpression[] start, IntExpression[] duration, IntExpression[] end, IntExpression[] demand, IntExpression capa)
extends Record
implements org.maxicp.modeling.constraints.helpers.ConstraintFromRecord, DecisionVarsProvider
Cumulative scheduling constraint ensuring that at any point in time, the total resource demand
of overlapping activities does not exceed the resource capacity
capa.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
org.maxicp.modeling.constraints.helpers.ConstraintFromRecord.IgnoreScope -
Constructor Summary
ConstructorsConstructorDescriptionCumulative(IntExpression[] start, int[] duration, int[] demand, int capa) Creates a Cumulative constraint with constant durations, demands, and capacity.Cumulative(IntExpression[] start, IntExpression[] duration, IntExpression[] end, IntExpression[] demand, IntExpression capa) Creates an instance of aCumulativerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncapa()Returns the value of thecaparecord component.Returns the sub-expressions of this node that should be considered decision variables (i.e., variables to branch on / freeze in LNS).demand()Returns the value of thedemandrecord component.duration()Returns the value of thedurationrecord component.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.start()Returns the value of thestartrecord 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
-
Cumulative
public Cumulative(IntExpression[] start, IntExpression[] duration, IntExpression[] end, IntExpression[] demand, IntExpression capa) Creates an instance of aCumulativerecord class. -
Cumulative
Creates a Cumulative constraint with constant durations, demands, and capacity.- Parameters:
start- the start time expressions of the activitiesduration- the durations of the activitiesdemand- the resource demands of the activitiescapa- the resource capacity
-
-
Method Details
-
decisionVariables
Description copied from interface:DecisionVarsProviderReturns the sub-expressions of this node that should be considered decision variables (i.e., variables to branch on / freeze in LNS).- Specified by:
decisionVariablesin interfaceDecisionVarsProvider- Returns:
- immutable collection of candidate decision variables; never
null, may be empty
-
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). -
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
demand
Returns the value of thedemandrecord component.- Returns:
- the value of the
demandrecord component
-
capa
Returns the value of thecaparecord component.- Returns:
- the value of the
caparecord component
-