Package org.ddolib.examples.max2sat
Class Max2SatRanking
java.lang.Object
org.ddolib.examples.max2sat.Max2SatRanking
- All Implemented Interfaces:
Comparator<Max2SatState>,StateRanking<Max2SatState>
Class used to compare two states for the Max2Sat problem.
A positive value means that we have a bigger benefit by setting
A negative value means that we have a bigger benefit by setting
When comparing two states, the best is the one that can generate the biggest benefit, independently of the decisions. That's why we sum the absolute value of each benefit to compare the states.
A positive value means that we have a bigger benefit by setting
xk to T.A negative value means that we have a bigger benefit by setting
xk to F.When comparing two states, the best is the one that can generate the biggest benefit, independently of the decisions. That's why we sum the absolute value of each benefit to compare the states.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(Max2SatState o1, Max2SatState o2) static intrank(Max2SatState state) 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
-
Max2SatRanking
public Max2SatRanking()
-
-
Method Details
-
rank
-
compare
- Specified by:
comparein interfaceComparator<Max2SatState>
-