Class MSCTRanking

java.lang.Object
org.ddolib.examples.msct.MSCTRanking
All Implemented Interfaces:
Comparator<MSCTState>, StateRanking<MSCTState>

public class MSCTRanking extends Object implements 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(), then s1 is preferred (ranked first).
  • If s1.currentTime() > s2.currentTime(), then s2 is preferred.
  • If both have the same current time, they are considered equivalent in ranking.
See Also:
  • Constructor Details

    • MSCTRanking

      public MSCTRanking()
  • Method Details

    • compare

      public int compare(MSCTState s1, MSCTState s2)
      Compares two scheduling states according to their current completion time.

      The state with the smaller currentTime is ranked higher (considered better).

      Specified by:
      compare in interface Comparator<MSCTState>
      Parameters:
      s1 - the first state to compare.
      s2 - the second state to compare.
      Returns:
      a negative integer if s1 should be ranked before s2, zero if both states have the same rank, or a positive integer if s1 should be ranked after s2.