Package org.ddolib.examples.tsptw
Record Class TimeWindow
java.lang.Object
java.lang.Record
org.ddolib.examples.tsptw.TimeWindow
- Record Components:
start- The beginning of the time window (inclusive).end- The end of the time window (inclusive).
Represents a time window with a start and end time.
A TimeWindow defines an interval [start, end] during which
an event, task, or visit must occur. Both start and end
are inclusive and usually represented as integer time units (e.g., minutes, hours).
Typical usage is in scheduling problems such as the Traveling Salesman Problem with Time Windows (TSPTW), where each location or task has a limited time window in which it can be visited or executed.
-
Constructor Summary
ConstructorsConstructorDescriptionTimeWindow(int start, int end) Creates an instance of aTimeWindowrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intstart()Returns the value of thestartrecord component.final StringtoString()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 with '=='. -
start
public int start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
public int end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-