java.lang.Object
java.lang.Record
org.maxicp.modeling.constraints.BinPacking
- All Implemented Interfaces:
Constraint,org.maxicp.modeling.constraints.helpers.CacheScope,org.maxicp.modeling.constraints.helpers.ConstraintFromRecord,DecisionVarsProvider
public record BinPacking(IntExpression[] x, int[] weights, IntExpression[] loads)
extends Record
implements org.maxicp.modeling.constraints.helpers.ConstraintFromRecord, org.maxicp.modeling.constraints.helpers.CacheScope, DecisionVarsProvider
BinPacking constraint.
x[i] is the bin assigned to item i;
loads[b] is derived from the assignments and weights.
Only x is considered to contain decision variables.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
org.maxicp.modeling.constraints.helpers.ConstraintFromRecord.IgnoreScope -
Constructor Summary
ConstructorsConstructorDescriptionBinPacking(IntExpression[] x, int[] weights, IntExpression[] loads) Creates an instance of aBinPackingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the sub-expressions of this node that should be considered decision variables (i.e., variables to branch on / freeze in LNS).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.loads()Returns the value of theloadsrecord component.final StringtoString()Returns a string representation of this record class.int[]weights()Returns the value of theweightsrecord component.x()Returns the value of thexrecord component.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
-
BinPacking
Creates an instance of aBinPackingrecord class.- Parameters:
x- the value for thexrecord componentweights- the value for theweightsrecord componentloads- the value for theloadsrecord component
-
-
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). -
x
Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
weights
public int[] weights()Returns the value of theweightsrecord component.- Returns:
- the value of the
weightsrecord component
-
loads
Returns the value of theloadsrecord component.- Returns:
- the value of the
loadsrecord component
-