Class HeuristicOptimizationAlgorithmConfig.Builder
java.lang.Object
com.dna.jopt.framework.body.scheme.helper.HeuristicOptimizationAlgorithmConfig.Builder
- All Implemented Interfaces:
HeuristicOptimizationAlgorithmConfig.AlgorithmBuildStage
,HeuristicOptimizationAlgorithmConfig.BuildFinal
- Enclosing class:
- HeuristicOptimizationAlgorithmConfig
@NotThreadSafe
public static final class HeuristicOptimizationAlgorithmConfig.Builder
extends Object
implements HeuristicOptimizationAlgorithmConfig.AlgorithmBuildStage, HeuristicOptimizationAlgorithmConfig.BuildFinal
Builds instances of type
HeuristicOptimizationAlgorithmConfig
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionInitializes the value for thealgorithm
attribute.build()
Builds a newHeuristicOptimizationAlgorithmConfig
.hasAutoFilter
(boolean hasAutoFilter) Initializes the value for thehasAutoFilter
attribute.simulatedAnnealingOverrideNumIterationsValue
(int simulatedAnnealingOverrideNumIterationsValue) Initializes the optional valuesimulatedAnnealingOverrideNumIterationsValue
to simulatedAnnealingOverrideNumIterationsValue.simulatedAnnealingOverrideNumIterationsValue
(Optional<Integer> simulatedAnnealingOverrideNumIterationsValue) Initializes the optional valuesimulatedAnnealingOverrideNumIterationsValue
to simulatedAnnealingOverrideNumIterationsValue.
-
Method Details
-
algorithm
@CanIgnoreReturnValue public final HeuristicOptimizationAlgorithmConfig.Builder algorithm(AbstractHeuristicOptimizationAlgorithmConfig.OptimizationAlgorithmConfig algorithm) Initializes the value for thealgorithm
attribute.- Specified by:
algorithm
in interfaceHeuristicOptimizationAlgorithmConfig.AlgorithmBuildStage
- Parameters:
algorithm
- The value for algorithm- Returns:
this
builder for use in a chained invocation
-
simulatedAnnealingOverrideNumIterationsValue
@CanIgnoreReturnValue public final HeuristicOptimizationAlgorithmConfig.Builder simulatedAnnealingOverrideNumIterationsValue(int simulatedAnnealingOverrideNumIterationsValue) Initializes the optional valuesimulatedAnnealingOverrideNumIterationsValue
to simulatedAnnealingOverrideNumIterationsValue.- Specified by:
simulatedAnnealingOverrideNumIterationsValue
in interfaceHeuristicOptimizationAlgorithmConfig.BuildFinal
- Parameters:
simulatedAnnealingOverrideNumIterationsValue
- The value for simulatedAnnealingOverrideNumIterationsValue- Returns:
this
builder for chained invocation
-
simulatedAnnealingOverrideNumIterationsValue
@CanIgnoreReturnValue public final HeuristicOptimizationAlgorithmConfig.Builder simulatedAnnealingOverrideNumIterationsValue(Optional<Integer> simulatedAnnealingOverrideNumIterationsValue) Initializes the optional valuesimulatedAnnealingOverrideNumIterationsValue
to simulatedAnnealingOverrideNumIterationsValue.- Specified by:
simulatedAnnealingOverrideNumIterationsValue
in interfaceHeuristicOptimizationAlgorithmConfig.BuildFinal
- Parameters:
simulatedAnnealingOverrideNumIterationsValue
- The value for simulatedAnnealingOverrideNumIterationsValue- Returns:
this
builder for use in a chained invocation
-
hasAutoFilter
@CanIgnoreReturnValue public final HeuristicOptimizationAlgorithmConfig.Builder hasAutoFilter(boolean hasAutoFilter) Initializes the value for thehasAutoFilter
attribute.If not set, this attribute will have a default value as returned by the initializer of
hasAutoFilter
.- Specified by:
hasAutoFilter
in interfaceHeuristicOptimizationAlgorithmConfig.BuildFinal
- Parameters:
hasAutoFilter
- The value for hasAutoFilter- Returns:
this
builder for use in a chained invocation
-
build
Builds a newHeuristicOptimizationAlgorithmConfig
.- Specified by:
build
in interfaceHeuristicOptimizationAlgorithmConfig.BuildFinal
- Returns:
- An immutable instance of HeuristicOptimizationAlgorithmConfig
- Throws:
IllegalStateException
- if any required attributes are missing
-