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 CancellationgetCancellation()Gets of sets the instance implementingCancellation, used for cancellation.CausalEffectKindgetCausalEffectKind()Gets the kind of causal effect to optimize.doublegetCrossoverProbability()The probability of parents being crossed.InferenceFactorygetInferenceFactory()Used to create one or more inference engines, used by the algorithm to determine the fitness of possible solutions.IntegergetMaximumConcurrency()Gets the maximum number of inference engines used during optimization.doublegetMutationProbability()The probability of genes being mutated.intgetPopulationSize()Gets the number of chromosomes in each generation.OptimizerProgressgetProgress()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.BooleangetQueryLogLikelihood()Determines whether the log-likelihood should be calculated by the inference engine when evaluating the fitness of a solution.IntegergetSeed()The seed for the random number generator used by the Genetic Algorithm.StopgetStopping()Gets the instance implementingStopused for early stopping.GeneticTerminationOptionsgetTermination()Termination options.protected voidraisePropertyChanged(String name)voidsetCancellation(Cancellation value)Gets of sets the instance implementingCancellation, used for cancellation.voidsetCausalEffectKind(CausalEffectKind value)Sets the kind of causal effect to optimize.voidsetCrossoverProbability(double value)The probability of parents being crossed.voidsetInferenceFactory(InferenceFactory value)Used to create one or more inference engines, used by the algorithm to determine the fitness of possible solutions.voidsetMaximumConcurrency(Integer value)voidsetMutationProbability(double value)The probability of genes being mutated.voidsetPopulationSize(int value)Sets the number of chromosomes in each generation.voidsetProgress(OptimizerProgress value)Gets of sets the instance implementingOptimizerProgress, used for progress notifications.voidsetQueryLogLikelihood(Boolean value)Determines whether the log-likelihood should be calculated by the inference engine when evaluating the fitness of a solution.voidsetSeed(Integer value)The seed for the random number generator used by the Genetic Algorithm.voidsetStopping(Stop value)Sets the instance implementingStopused 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:
getQueryDistributionsin 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 theNetworkand also the evidence.- Specified by:
getMaximumConcurrencyin 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:
getCausalEffectKindin 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:
setCausalEffectKindin 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:
getQueryFunctionsin 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:
getInferenceFactoryin 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:
setInferenceFactoryin interfaceOptimizerOptions
-
getCancellation
public Cancellation getCancellation()
Gets of sets the instance implementingCancellation, used for cancellation.- Specified by:
getCancellationin interfaceOptimizerOptions- See Also:
Cancellation
-
setCancellation
public void setCancellation(Cancellation value)
Gets of sets the instance implementingCancellation, used for cancellation.- Specified by:
setCancellationin interfaceOptimizerOptions- See Also:
Cancellation
-
getStopping
public Stop getStopping()
Gets the instance implementingStopused 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:
getStoppingin interfaceOptimizerOptions- Returns:
- The instance used for stopping.
-
setStopping
public void setStopping(Stop value)
Sets the instance implementingStopused 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:
setStoppingin 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:
getQueryLogLikelihoodin 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:
setQueryLogLikelihoodin interfaceOptimizerOptions
-
getProgress
public OptimizerProgress getProgress()
Gets of sets the instance implementingOptimizerProgress, used for progress notifications.- Specified by:
getProgressin interfaceOptimizerOptions- See Also:
OptimizerProgress
-
setProgress
public void setProgress(OptimizerProgress value)
Gets of sets the instance implementingOptimizerProgress, used for progress notifications.- Specified by:
setProgressin interfaceOptimizerOptions- See Also:
OptimizerProgress
-
-