Package org.ojalgo.optimisation.integer
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 java.lang.Object implements IntegerStrategy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ojalgo.optimisation.integer.IntegerStrategy
IntegerStrategy.ConfigurableStrategy, IntegerStrategy.GMICutConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.BiFunction<ExpressionsBasedModel,IntegerStrategy,ModelStrategy>
myFactory
private NumberContext
myGapTolerance
private IntegerStrategy.GMICutConfiguration
myGMICutConfiguration
private NumberContext
myIntegralityTolerance
private java.util.function.IntSupplier
myParallelism
private java.util.Comparator<NodeKey>[]
myPriorityDefinitions
-
Fields inherited from interface org.ojalgo.optimisation.integer.IntegerStrategy
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description ConfigurableStrategy(java.util.function.IntSupplier parallelism, java.util.Comparator<NodeKey>[] definitions, NumberContext integrality, NumberContext gap, java.util.function.BiFunction<ExpressionsBasedModel,IntegerStrategy,ModelStrategy> factory, IntegerStrategy.GMICutConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerStrategy.ConfigurableStrategy
addPriorityDefinitions(java.util.Comparator<NodeKey>... additionalDefinitions)
Retains any existing definitions, but adds these to be used rather than the existing.NumberContext
getGapTolerance()
The MIP gap is the difference between the best integer solution found so far and a node's relaxed non-integer solution.IntegerStrategy.GMICutConfiguration
getGMICutConfiguration()
NumberContext
getIntegralityTolerance()
Used to determine if a variable value is integer or notjava.util.List<java.util.Comparator<NodeKey>>
getWorkerPriorities()
There will be 1 worker thread per item in the returnedList
.ModelStrategy
newModelStrategy(ExpressionsBasedModel model)
IntegerStrategy.ConfigurableStrategy
withGapTolerance(NumberContext newTolerance)
Change the MIP gapIntegerStrategy.ConfigurableStrategy
withGMICutConfiguration(IntegerStrategy.GMICutConfiguration newConfiguration)
IntegerStrategy.ConfigurableStrategy
withModelStrategyFactory(java.util.function.BiFunction<ExpressionsBasedModel,IntegerStrategy,ModelStrategy> newFactory)
IntegerStrategy.ConfigurableStrategy
withParallelism(java.util.function.IntSupplier newParallelism)
How many threads will be used? Perhaps useParallelism
to obtain a suitable value.IntegerStrategy.ConfigurableStrategy
withPriorityDefinitions(java.util.Comparator<NodeKey>... newDefinitions)
Replace the priority definitions with these ones.
-
-
-
Field Detail
-
myFactory
private final java.util.function.BiFunction<ExpressionsBasedModel,IntegerStrategy,ModelStrategy> myFactory
-
myGapTolerance
private final NumberContext myGapTolerance
-
myGMICutConfiguration
private final IntegerStrategy.GMICutConfiguration myGMICutConfiguration
-
myIntegralityTolerance
private final NumberContext myIntegralityTolerance
-
myParallelism
private final java.util.function.IntSupplier myParallelism
-
myPriorityDefinitions
private final java.util.Comparator<NodeKey>[] myPriorityDefinitions
-
-
Constructor Detail
-
ConfigurableStrategy
ConfigurableStrategy(java.util.function.IntSupplier parallelism, java.util.Comparator<NodeKey>[] definitions, NumberContext integrality, NumberContext gap, java.util.function.BiFunction<ExpressionsBasedModel,IntegerStrategy,ModelStrategy> factory, IntegerStrategy.GMICutConfiguration configuration)
-
-
Method Detail
-
addPriorityDefinitions
public IntegerStrategy.ConfigurableStrategy addPriorityDefinitions(java.util.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.
-
getGapTolerance
public NumberContext getGapTolerance()
Description copied from interface:IntegerStrategy
The 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:
getGapTolerance
in interfaceIntegerStrategy
- Returns:
- The tolerance context used to determine if the gap is too small or not
-
getGMICutConfiguration
public IntegerStrategy.GMICutConfiguration getGMICutConfiguration()
- Specified by:
getGMICutConfiguration
in interfaceIntegerStrategy
-
getIntegralityTolerance
public NumberContext getIntegralityTolerance()
Description copied from interface:IntegerStrategy
Used to determine if a variable value is integer or not- Specified by:
getIntegralityTolerance
in interfaceIntegerStrategy
-
getWorkerPriorities
public java.util.List<java.util.Comparator<NodeKey>> getWorkerPriorities()
Description copied from interface:IntegerStrategy
There will be 1 worker thread per item in the returnedList
. TheComparator
instances need not be unique. Used to prioritise among the nodes waiting to be evaluated.- Specified by:
getWorkerPriorities
in interfaceIntegerStrategy
-
newModelStrategy
public ModelStrategy newModelStrategy(ExpressionsBasedModel model)
- Specified by:
newModelStrategy
in interfaceIntegerStrategy
-
withGapTolerance
public IntegerStrategy.ConfigurableStrategy withGapTolerance(NumberContext newTolerance)
Change the MIP gap
-
withGMICutConfiguration
public IntegerStrategy.ConfigurableStrategy withGMICutConfiguration(IntegerStrategy.GMICutConfiguration newConfiguration)
-
withModelStrategyFactory
public IntegerStrategy.ConfigurableStrategy withModelStrategyFactory(java.util.function.BiFunction<ExpressionsBasedModel,IntegerStrategy,ModelStrategy> newFactory)
-
withParallelism
public IntegerStrategy.ConfigurableStrategy withParallelism(java.util.function.IntSupplier newParallelism)
How many threads will be used? Perhaps useParallelism
to obtain a suitable value.
-
withPriorityDefinitions
public IntegerStrategy.ConfigurableStrategy withPriorityDefinitions(java.util.Comparator<NodeKey>... newDefinitions)
Replace the priority definitions with these ones.
-
-