Package org.ddolib.examples.max2sat
Record Class Max2SatState
java.lang.Object
java.lang.Record
org.ddolib.examples.max2sat.Max2SatState
- Record Components:
netBenefit- the net benefits by setting the variabledepth- the depth of the DD
Class to contain data for the Max2Sat sate. The state contains its depth in the associated MDD and a list of net
benefits.
This list contains:
- for each
k >= depth, the net benefits by setting the variableKtotrueknowing the assignment of the previous variables (a negative value is the net benefit to assign the variable tofalse); - for each
k < depth,0, modeling that these variables have been assigned in previous layer and cannot influence the objective anymore.
-
Constructor Summary
ConstructorsConstructorDescriptionMax2SatState(ArrayList<Integer> netBenefit, int depth) Creates an instance of aMax2SatStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenetBenefitrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Max2SatState
Creates an instance of aMax2SatStaterecord class.- Parameters:
netBenefit- the value for thenetBenefitrecord componentdepth- the value for thedepthrecord component
-
-
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 '=='. -
netBenefit
Returns the value of thenetBenefitrecord component.- Returns:
- the value of the
netBenefitrecord component
-
depth
public int depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-