Class MaxCoverDominance
java.lang.Object
org.ddolib.examples.maximumcoverage.MaxCoverDominance
- All Implemented Interfaces:
Dominance<MaxCoverState>
Dominance rule for
MaxCoverState used in the Maximum Coverage problem.
This class implements the Dominance interface and defines a dominance
relationship between states based on set inclusion:
a state is dominated if its set of covered items is a subset of another state's
covered items.
All states are assigned the same dominance key, meaning that any two states are comparable for dominance checking.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey(MaxCoverState state) Returns the dominance key associated with a state.booleanisDominatedOrEqual(MaxCoverState state1, MaxCoverState state2) Determines whetherstate1is dominated by or equal tostate2.
-
Constructor Details
-
MaxCoverDominance
public MaxCoverDominance()
-
-
Method Details
-
getKey
Returns the dominance key associated with a state.All states share the same key (
0), which indicates that dominance comparisons are allowed between any pair of states.- Specified by:
getKeyin interfaceDominance<MaxCoverState>- Parameters:
state- the state for which the key is requested- Returns:
- the dominance key (always
0)
-
isDominatedOrEqual
Determines whetherstate1is dominated by or equal tostate2.A state
state1is considered dominated bystate2if the set of items covered bystate1is a subset of the set of items covered bystate2. Equality is included as a special case.- Specified by:
isDominatedOrEqualin interfaceDominance<MaxCoverState>- Parameters:
state1- the potentially dominated statestate2- the dominating state- Returns:
trueifstate1is dominated by or equal tostate2,falseotherwise
-