Class TSRanking

java.lang.Object
org.ddolib.examples.talentscheduling.TSRanking
All Implemented Interfaces:
Comparator<TSState>, StateRanking<TSState>

public class TSRanking extends Object implements StateRanking<TSState>
Class that defines a ranking (ordering) between two TSState instances.

This ranking is based on the total number of scenes that are either remaining or marked as "maybe" in the state. States with fewer total scenes are considered smaller (i.e., ranked higher) than states with more total scenes.

This class implements the StateRanking interface and is used in DDO or other search algorithms to prioritize states when merging or pruning.

  • Constructor Details

    • TSRanking

      public TSRanking()
  • Method Details

    • compare

      public int compare(TSState o1, TSState o2)
      Compares two TSState instances based on the total number of scenes in their remainingScenes and maybeScenes sets.
      Specified by:
      compare in interface Comparator<TSState>
      Parameters:
      o1 - The first state to compare.
      o2 - The second state to compare.
      Returns:
      A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.