Record Class MaxCoverState
java.lang.Object
java.lang.Record
org.ddolib.examples.maximumcoverage.MaxCoverState
- Record Components:
coveredItems- a BitSet representing the items that are covered in this state
Represents a state in the Maximum Coverage (MaxCover) problem.
Each state tracks which items have been covered so far using a BitSet.
This is used in Decision Diagram Optimization (DDO) and other search or
combinatorial algorithms to evaluate partial solutions.
The record is immutable: the set of covered items cannot be changed once
the state is created. Use state transitions in MaxCoverProblem to
generate new states with additional items covered.
-
Constructor Summary
ConstructorsConstructorDescriptionMaxCoverState(BitSet coveredItems) Creates an instance of aMaxCoverStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecoveredItemsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.toString()Returns a string representation of the state.
-
Constructor Details
-
MaxCoverState
Creates an instance of aMaxCoverStaterecord class.- Parameters:
coveredItems- the value for thecoveredItemsrecord component
-
-
Method Details
-
toString
Returns a string representation of the state. -
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). -
coveredItems
Returns the value of thecoveredItemsrecord component.- Returns:
- the value of the
coveredItemsrecord component
-