Package org.ddolib.examples.mcp
Record Class MCPState
java.lang.Object
java.lang.Record
org.ddolib.examples.mcp.MCPState
- Record Components:
netBenefit- the list of cumulative net benefitsdepth- the current depth of the search
Class to contain data for the MCP state. 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 variablekto the partitionTknowing the assignment of the previous variables; - for each
k < depth,0, modeling that these variable has been assigned in previous layer and cannot influence the objective anymore.
-
Constructor Summary
Constructors -
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
-
MCPState
Creates an instance of aMCPStaterecord 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
-