Package com.bayesserver.optimization
Class GeneticOptionsBase
- java.lang.Object
-
- com.bayesserver.optimization.GeneticOptionsBase
-
- All Implemented Interfaces:
OptimizerOptions
- Direct Known Subclasses:
GeneticOptimizerOptions
,GeneticSimplificationOptions
public abstract class GeneticOptionsBase extends Object implements OptimizerOptions
Base class for common Genetic algorithm options.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Cancellation
getCancellation()
Gets of sets the instance implementingCancellation
, used for cancellation.CausalEffectKind
getCausalEffectKind()
Gets the kind of causal effect to optimize.double
getCrossoverProbability()
The probability of parents being crossed.InferenceFactory
getInferenceFactory()
Used to create one or more inference engines, used by the algorithm to determine the fitness of possible solutions.Integer
getMaximumConcurrency()
Gets the maximum number of inference engines used during optimization.double
getMutationProbability()
The probability of genes being mutated.int
getPopulationSize()
Gets the number of chromosomes in each generation.OptimizerProgress
getProgress()
Gets of sets the instance implementingOptimizerProgress
, used for progress notifications.List<QueryDistribution>
getQueryDistributions()
Determines which additional queries, if any, should be calculated by the inference engine when evaluating the fitness of a solution.List<QueryFunctionOutput>
getQueryFunctions()
Determines which additional functions, if any, should be calculated by the inference engine when evaluating the fitness of a solution.Boolean
getQueryLogLikelihood()
Determines whether the log-likelihood should be calculated by the inference engine when evaluating the fitness of a solution.Integer
getSeed()
The seed for the random number generator used by the Genetic Algorithm.Stop
getStopping()
Gets the instance implementingStop
used for early stopping.GeneticTerminationOptions
getTermination()
Termination options.protected void
raisePropertyChanged(String name)
void
setCancellation(Cancellation value)
Gets of sets the instance implementingCancellation
, used for cancellation.void
setCausalEffectKind(CausalEffectKind value)
Sets the kind of causal effect to optimize.void
setCrossoverProbability(double value)
The probability of parents being crossed.void
setInferenceFactory(InferenceFactory value)
Used to create one or more inference engines, used by the algorithm to determine the fitness of possible solutions.void
setMaximumConcurrency(Integer value)
void
setMutationProbability(double value)
The probability of genes being mutated.void
setPopulationSize(int value)
Sets the number of chromosomes in each generation.void
setProgress(OptimizerProgress value)
Gets of sets the instance implementingOptimizerProgress
, used for progress notifications.void
setQueryLogLikelihood(Boolean value)
Determines whether the log-likelihood should be calculated by the inference engine when evaluating the fitness of a solution.void
setSeed(Integer value)
The seed for the random number generator used by the Genetic Algorithm.void
setStopping(Stop value)
Sets the instance implementingStop
used for early stopping.
-
-
-
Method Detail
-
getTermination
public GeneticTerminationOptions getTermination()
Termination options.
-
getCrossoverProbability
public double getCrossoverProbability()
The probability of parents being crossed. Must be in the range [0,1].
-
setCrossoverProbability
public void setCrossoverProbability(double value)
The probability of parents being crossed. Must be in the range [0,1].
-
getMutationProbability
public double getMutationProbability()
The probability of genes being mutated. Must be in the range [0,1].
-
setMutationProbability
public void setMutationProbability(double value)
The probability of genes being mutated. Must be in the range [0,1].
-
raisePropertyChanged
protected void raisePropertyChanged(String name)
-
getQueryDistributions
public List<QueryDistribution> getQueryDistributions()
Determines which additional queries, if any, should be calculated by the inference engine when evaluating the fitness of a solution. For example, additional queries maybe referenced by function nodes.- Specified by:
getQueryDistributions
in interfaceOptimizerOptions
-
getMaximumConcurrency
public Integer getMaximumConcurrency()
Gets the maximum number of inference engines used during optimization. During optimization, multiple inference engines may be used in parallel. However each inference engine has its own memory requirements for inference, and so this parameter allows the number to be limited, to avoid excessive memory consumption. The amount of memory used per inference engine, depends on theNetwork
and also the evidence.- Specified by:
getMaximumConcurrency
in interfaceOptimizerOptions
-
setMaximumConcurrency
public void setMaximumConcurrency(Integer value)
-
getCausalEffectKind
public CausalEffectKind getCausalEffectKind()
Gets the kind of causal effect to optimize. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
getCausalEffectKind
in interfaceOptimizerOptions
-
setCausalEffectKind
public void setCausalEffectKind(CausalEffectKind value)
Sets the kind of causal effect to optimize. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
setCausalEffectKind
in interfaceOptimizerOptions
-
getPopulationSize
public int getPopulationSize()
Gets the number of chromosomes in each generation.
-
setPopulationSize
public void setPopulationSize(int value)
Sets the number of chromosomes in each generation.
-
getSeed
public Integer getSeed()
The seed for the random number generator used by the Genetic Algorithm.
-
setSeed
public void setSeed(Integer value)
The seed for the random number generator used by the Genetic Algorithm.
-
getQueryFunctions
public List<QueryFunctionOutput> getQueryFunctions()
Determines which additional functions, if any, should be calculated by the inference engine when evaluating the fitness of a solution. For example, functions that are referenced by a function node optimization target/objective.- Specified by:
getQueryFunctions
in interfaceOptimizerOptions
-
getInferenceFactory
public InferenceFactory getInferenceFactory()
Used to create one or more inference engines, used by the algorithm to determine the fitness of possible solutions.- Specified by:
getInferenceFactory
in interfaceOptimizerOptions
-
setInferenceFactory
public void setInferenceFactory(InferenceFactory value)
Used to create one or more inference engines, used by the algorithm to determine the fitness of possible solutions.- Specified by:
setInferenceFactory
in interfaceOptimizerOptions
-
getCancellation
public Cancellation getCancellation()
Gets of sets the instance implementingCancellation
, used for cancellation.- Specified by:
getCancellation
in interfaceOptimizerOptions
- See Also:
Cancellation
-
setCancellation
public void setCancellation(Cancellation value)
Gets of sets the instance implementingCancellation
, used for cancellation.- Specified by:
setCancellation
in interfaceOptimizerOptions
- See Also:
Cancellation
-
getStopping
public Stop getStopping()
Gets the instance implementingStop
used for early stopping. Stopping is different to cancellation, as stopping will still return an objective value from the optimization process, albeit having performed fewer iterations.- Specified by:
getStopping
in interfaceOptimizerOptions
- Returns:
- The instance used for stopping.
-
setStopping
public void setStopping(Stop value)
Sets the instance implementingStop
used for early stopping. Stopping is different to cancellation, as stopping will still return an objective value from the optimization process, albeit having performed fewer iterations.- Specified by:
setStopping
in interfaceOptimizerOptions
- Parameters:
value
- The instance used for stopping.
-
getQueryLogLikelihood
public Boolean getQueryLogLikelihood()
Determines whether the log-likelihood should be calculated by the inference engine when evaluating the fitness of a solution. For example, the log-likelihood maybe referenced by function nodes.- Specified by:
getQueryLogLikelihood
in interfaceOptimizerOptions
-
setQueryLogLikelihood
public void setQueryLogLikelihood(Boolean value)
Determines whether the log-likelihood should be calculated by the inference engine when evaluating the fitness of a solution. For example, the log-likelihood maybe referenced by function nodes.- Specified by:
setQueryLogLikelihood
in interfaceOptimizerOptions
-
getProgress
public OptimizerProgress getProgress()
Gets of sets the instance implementingOptimizerProgress
, used for progress notifications.- Specified by:
getProgress
in interfaceOptimizerOptions
- See Also:
OptimizerProgress
-
setProgress
public void setProgress(OptimizerProgress value)
Gets of sets the instance implementingOptimizerProgress
, used for progress notifications.- Specified by:
setProgress
in interfaceOptimizerOptions
- See Also:
OptimizerProgress
-
-