Class IntegerStrategy.ConfigurableStrategy
java.lang.Object
org.ojalgo.optimisation.integer.IntegerStrategy.ConfigurableStrategy
- All Implemented Interfaces:
IntegerStrategy
- Enclosing interface:
IntegerStrategy
public static final class IntegerStrategy.ConfigurableStrategy
extends Object
implements IntegerStrategy
Apart from being able to configure various standard properties, you can also provide your own
ModelStrategy factory.-
Nested Class Summary
Nested classes/interfaces inherited from interface IntegerStrategy
IntegerStrategy.ConfigurableStrategy, IntegerStrategy.GMICutConfiguration -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiFunction<ExpressionsBasedModel, IntegerStrategy, ModelStrategy> private final NumberContextprivate final IntegerStrategy.GMICutConfigurationprivate final NumberContextprivate final IntSupplierprivate final Comparator<NodeKey>[]Fields inherited from interface IntegerStrategy
DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionConfigurableStrategy(IntSupplier parallelism, Comparator<NodeKey>[] definitions, NumberContext integrality, NumberContext gap, BiFunction<ExpressionsBasedModel, IntegerStrategy, ModelStrategy> factory, IntegerStrategy.GMICutConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionaddPriorityDefinitions(Comparator<NodeKey>... additionalDefinitions) Retains any existing definitions, but adds these to be used rather than the existing.intThe MIP gap is the difference between the best integer solution found so far and a node's relaxed non-integer solution.Used to determine if a variable value is integer or notThere will be 1 worker thread per item in the returnedList.withGapTolerance(NumberContext newTolerance) Change the MIP gapwithGMICutConfiguration(IntegerStrategy.GMICutConfiguration newConfiguration) withModelStrategyFactory(BiFunction<ExpressionsBasedModel, IntegerStrategy, ModelStrategy> newFactory) Create a sub-class ofModelStrategyand provide a factory method for it here.withParallelism(IntSupplier newParallelism) How many threads will be used? Perhaps useParallelismto obtain a suitable value.withPriorityDefinitions(Comparator<NodeKey>... newDefinitions) Replace the priority definitions with these ones.
-
Field Details
-
myFactory
-
myGapTolerance
-
myGMICutConfiguration
-
myIntegralityTolerance
-
myParallelism
-
myPriorityDefinitions
-
-
Constructor Details
-
ConfigurableStrategy
ConfigurableStrategy(IntSupplier parallelism, Comparator<NodeKey>[] definitions, NumberContext integrality, NumberContext gap, BiFunction<ExpressionsBasedModel, IntegerStrategy, ModelStrategy> factory, IntegerStrategy.GMICutConfiguration configuration)
-
-
Method Details
-
addPriorityDefinitions
public IntegerStrategy.ConfigurableStrategy addPriorityDefinitions(Comparator<NodeKey>... additionalDefinitions) Retains any existing definitions, but adds these to be used rather than the existing. If there are enough threads both these additional and the previously existing definitions will be used. -
countUniqueStrategies
public int countUniqueStrategies()- Specified by:
countUniqueStrategiesin interfaceIntegerStrategy
-
getGapTolerance
Description copied from interface:IntegerStrategyThe MIP gap is the difference between the best integer solution found so far and a node's relaxed non-integer solution. The relative MIP gap is that difference divided by the optimal value (approximated by the currently best integer solution). If the gap (absolute or relative) is too small, then the corresponding branch is terminated as it is deemed unlikely or too "expensive" to find better integer solutions there.- Specified by:
getGapTolerancein interfaceIntegerStrategy- Returns:
- The tolerance context used to determine if the gap is too small or not
-
getGMICutConfiguration
- Specified by:
getGMICutConfigurationin interfaceIntegerStrategy
-
getIntegralityTolerance
Description copied from interface:IntegerStrategyUsed to determine if a variable value is integer or not- Specified by:
getIntegralityTolerancein interfaceIntegerStrategy
-
getWorkerPriorities
Description copied from interface:IntegerStrategyThere will be 1 worker thread per item in the returnedList. TheComparatorinstances need not be unique. Used to prioritise among the nodes waiting to be evaluated.- Specified by:
getWorkerPrioritiesin interfaceIntegerStrategy
-
newModelStrategy
- Specified by:
newModelStrategyin interfaceIntegerStrategy
-
withGapTolerance
Change the MIP gap -
withGMICutConfiguration
public IntegerStrategy.ConfigurableStrategy withGMICutConfiguration(IntegerStrategy.GMICutConfiguration newConfiguration) -
withModelStrategyFactory
public IntegerStrategy.ConfigurableStrategy withModelStrategyFactory(BiFunction<ExpressionsBasedModel, IntegerStrategy, ModelStrategy> newFactory) Create a sub-class ofModelStrategyand provide a factory method for it here. -
withParallelism
How many threads will be used? Perhaps useParallelismto obtain a suitable value. -
withPriorityDefinitions
public IntegerStrategy.ConfigurableStrategy withPriorityDefinitions(Comparator<NodeKey>... newDefinitions) Replace the priority definitions with these ones.
-