java.lang.Object
java.lang.Record
org.maxicp.modeling.constraints.LexLe
- Record Components:
x- the first array of integer expressionsy- the second array of integer expressionsstrict-truefor strict lexicographic inequality (<_lex),falsefor non-strict (<=_lex)
- All Implemented Interfaces:
Constraint,org.maxicp.modeling.constraints.helpers.CacheScope,org.maxicp.modeling.constraints.helpers.ConstraintFromRecord,DecisionVarsProvider
public record LexLe(IntExpression[] x, IntExpression[] y, boolean strict)
extends Record
implements org.maxicp.modeling.constraints.helpers.ConstraintFromRecord, DecisionVarsProvider
Lexicographic ordering constraint enforcing
x <=_lex y (or x <_lex y if strict is true).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.maxicp.modeling.constraints.helpers.ConstraintFromRecord
org.maxicp.modeling.constraints.helpers.ConstraintFromRecord.IgnoreScope -
Constructor Summary
ConstructorsConstructorDescriptionLexLe(IntExpression[] x, IntExpression[] y) Creates a non-strict lexicographic ordering constraint (x <=_lex y).LexLe(IntExpression[] x, IntExpression[] y, boolean strict) Creates an instance of aLexLerecord 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.booleanstrict()Returns the value of thestrictrecord component.final StringtoString()Returns a string representation of this record class.x()Returns the value of thexrecord component.y()Returns the value of theyrecord 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
-
LexLe
Creates a non-strict lexicographic ordering constraint (x <=_lex y).- Parameters:
x- the first array of integer expressionsy- the second array of integer expressions
-
LexLe
Creates an instance of aLexLerecord class.
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
x
Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
strict
public boolean strict()Returns the value of thestrictrecord component.- Returns:
- the value of the
strictrecord component
-