Package org.ddolib.examples.tsptw
Record Class TSPTWDominanceKey
java.lang.Object
java.lang.Record
org.ddolib.examples.tsptw.TSPTWDominanceKey
- Record Components:
p- The current position in the tour.mustVisit- The set of locations that must still be visited.
public record TSPTWDominanceKey(org.ddolib.examples.tsptw.Position p, BitSet mustVisit)
extends Record
Key used for dominance checking in the Traveling Salesman Problem with Time Windows (TSPTW).
A TSPTWDominanceKey uniquely identifies a group of states that share the same
current position p and the same set of locations that still must be visited
(mustVisit). It is used by TSPTWDominance to determine which states
can be compared for dominance.
Two states with the same dominance key are comparable: the state with the lower current time dominates the other, allowing pruning in the search.
-
Constructor Summary
ConstructorsConstructorDescriptionTSPTWDominanceKey(org.ddolib.examples.tsptw.Position p, BitSet mustVisit) Creates an instance of aTSPTWDominanceKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themustVisitrecord component.org.ddolib.examples.tsptw.Positionp()Returns the value of theprecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
p
public org.ddolib.examples.tsptw.Position p()Returns the value of theprecord component.- Returns:
- the value of the
precord component
-
mustVisit
Returns the value of themustVisitrecord component.- Returns:
- the value of the
mustVisitrecord component
-