Package org.ddolib.examples.srflp
Class SRFLPRanking
java.lang.Object
org.ddolib.examples.srflp.SRFLPRanking
- All Implemented Interfaces:
Comparator<SRFLPState>,StateRanking<SRFLPState>
Implements a ranking between two
SRFLPState instances for use in
decision diagram or search-based algorithms.
The ranking is based on the number of departments that still need to be placed,
i.e., the sum of departments in the must and maybe sets of a state.
A state with fewer remaining departments is considered "better" (ranked lower).
This class implements the StateRanking interface and can be used
to prioritize states during search, pruning, or frontier management in
SRFLP solvers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(SRFLPState o1, SRFLPState o2) Compares two SRFLP states based on the total number of remaining departments.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
-
SRFLPRanking
public SRFLPRanking()
-
-
Method Details
-
compare
Compares two SRFLP states based on the total number of remaining departments.- Specified by:
comparein interfaceComparator<SRFLPState>- Parameters:
o1- the first state to compareo2- the second state to compare- Returns:
- a negative integer if
o1has fewer remaining departments thano2, zero if they have the same number of remaining departments, or a positive integer ifo1has more remaining departments thano2.
-