Package org.ddolib.examples.msct
Class MSCTRanking
java.lang.Object
org.ddolib.examples.msct.MSCTRanking
- All Implemented Interfaces:
Comparator<MSCTState>,StateRanking<MSCTState>
Provides a ranking strategy for
MSCTState objects
used in the search process for solving the
Maximum Sum of Completion Times (MSCT) problem.
The ranking is based on the current time value of each state.
States with a smaller currentTime are considered
more promising and are therefore ranked higher (i.e., explored first).
This ranking function is typically used in Decision Diagram Optimization (DDO) or A* search algorithms to prioritize states in the frontier, helping the solver guide the exploration towards better solutions faster.
Ranking policy:
- If
s1.currentTime() < s2.currentTime(), thens1is preferred (ranked first). - If
s1.currentTime() > s2.currentTime(), thens2is preferred. - If both have the same current time, they are considered equivalent in ranking.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
MSCTRanking
public MSCTRanking()
-
-
Method Details
-
compare
Compares two scheduling states according to their current completion time.The state with the smaller
currentTimeis ranked higher (considered better).- Specified by:
comparein interfaceComparator<MSCTState>- Parameters:
s1- the first state to compare.s2- the second state to compare.- Returns:
- a negative integer if
s1should be ranked befores2, zero if both states have the same rank, or a positive integer ifs1should be ranked afters2.
-