Class TSRanking
java.lang.Object
org.ddolib.examples.talentscheduling.TSRanking
- All Implemented Interfaces:
Comparator<TSState>,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 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
-
TSRanking
public TSRanking()
-
-
Method Details
-
compare
Compares twoTSStateinstances based on the total number of scenes in theirremainingScenesandmaybeScenessets.- Specified by:
comparein interfaceComparator<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.
-