Package org.ddolib.examples.msct
Record Class MSCTState
java.lang.Object
java.lang.Record
org.ddolib.examples.msct.MSCTState
- Record Components:
remainingJobs- the set of job indices that have not yet been scheduled.currentTime- the current time (sum of processing times of scheduled jobs).
Represents a state in the
MSCTProblem (Minimum Sum of Completion Times) scheduling problem.
A state captures the current status of the scheduling process: it stores the set of jobs that remain to be scheduled and the current simulation time (i.e., the total time elapsed so far in the partial schedule).
Structure:
remainingJobs: the set of jobs that have not yet been scheduled.currentTime: the time at which the next job can start, representing the accumulated processing time of all scheduled jobs so far.
This class is implemented as a Java record, meaning it is immutable and
provides automatically generated implementations for equals, hashCode, and accessors.
Example:
Set<Integer> jobs = Set.of(0, 1, 2);
MSCTState state = new MSCTState(jobs, 5);
System.out.println(state);
// Output: RemainingJobs [0, 1, 2] ----> currentTime 5
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecurrentTimerecord 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 theremainingJobsrecord component.toString()Returns a string representation of the state for debugging or logging purposes.
-
Constructor Details
-
MSCTState
Creates an instance of aMSCTStaterecord class.- Parameters:
remainingJobs- the value for theremainingJobsrecord componentcurrentTime- the value for thecurrentTimerecord component
-
-
Method Details
-
toString
Returns a string representation of the state for debugging or logging purposes.The output includes the list of remaining jobs and the current simulation time.
-
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 '=='. -
remainingJobs
Returns the value of theremainingJobsrecord component.- Returns:
- the value of the
remainingJobsrecord component
-
currentTime
public int currentTime()Returns the value of thecurrentTimerecord component.- Returns:
- the value of the
currentTimerecord component
-