Internals
Listing all non-exported types and functions here for now, but split off categories onto separate pages in the future!
GlobalOptimization.AbstractAdaptationStrategy — Type
AbstractAdaptationStrategySubtypes of this type should be used in conjunction with subtypes of AbstractMutationParameters and AbstractCrossoverParameters to control how the parameters are adapted in their respective adapt! methods.
GlobalOptimization.AbstractAlgorithmSpecificOptions — Type
AbstractAlgorithmSpecificOptionsAbstract type for algorithm specific options
All subtypes must define the following fields:
general: The general options for an optimizer.
GlobalOptimization.AbstractBinomialCrossoverParameters — Type
AbstractBinomialCrossoverParametersAn abstract type representing the parameters for a binomial crossover strategy in Differential Evolution (DE). The crossover! method is provided for subtypes of this abstract type, however, the get_parameter, initialize!, and adapt! methods are must still be defined.
GlobalOptimization.AbstractCandidate — Type
AbstractCandidateAbstract type for a candidate
GlobalOptimization.AbstractCrossoverParameters — Type
AbstractCrossoverParametersAn abstract type representing the parameters for a crossover strategy in Differential Evolution (DE).
Subtypes of this abstract type should define the following methods:
get_parameter(params::AbstractCrossoverParameters, i): Returns the crossover parameter for thei-th candidate.initialize!(params::AbstractCrossoverParameters, num_dims, population_size): Initializes the crossover parameters.adapt!(params::AbstractCrossoverParameters, improved, global_best_improved): Adapts the crossover parameters based on the improvement status of the candidates.crossover!(population::DEPopulation, crossover_params, search_space): Performs the crossover operation on the population using the specified crossover parameters.
GlobalOptimization.AbstractCrossoverTransformation — Type
AbstractCrossoverTransformationAn abstract type representing a transformation applied to a candidate prior to applying the crossover operator.
Subtypes of this abstract type should define the following methods:
initialize!(transformation::AbstractCrossoverTransformation, population_size): Initializes the transformation with the populationupdate_transformation!(transformation::AbstractCrossoverTransformation, population): Updates the transformation based on the current populationto_transformed(transformation::AbstractCrossoverTransformation, c, m): Transforms the candidatecand mutantmto an alternative representation, returning the transformed candidate, transformed mutant, and a boolean indicating whether the transformation was applied.from_transformed!(transformation::AbstractCrossoverTransformation, mt, m): Transforms the mutantmtback to the original representationm.
GlobalOptimization.AbstractEvaluator — Type
AbstractEvaluatorAbstract type for an evaluator. An evaluator is responsible for evaluating the fitness of a population or candidate.
GlobalOptimization.AbstractFunctionEvaluationMethod — Type
AbstractFunctionEvaluationMethodA function evaluation method is a strategy for evaluating the fitness/objective, as well as possibly other algorithm specific things.
GlobalOptimization.AbstractMBHDistribution — Type
AbstractMBHDistribution{T}Abstract type for MBH distributions.
All subtypes of AbstractMBHDistribution must implement the following methods:
initialize!(dist::AbstractMBHDistribution, ss::ContinuousRectangularSearchSpace): Initializes the distribution with the search space.draw_step!(step::AbstractVector{T}, dist::AbstractMBHDistribution{T}): Draws a step from the distribution and stores it instep.get_show_trace_elements(dist::AbstractMBHDistribution{T}, trace_mode::Union{Val{:detailed}, Val{:all}}): Returns the trace elements for the distribution to be shown in the terminal terminal terminal terminal terminal terminal terminal terminal terminal.get_save_trace_elements(dist::AbstractMBHDistribution{T}, trace_mode::Union{Val{:detailed}, Val{:all}}): Returns the trace elements for the distribution to be saved to a file.
Note: The AbstractMBHDistribution interface is tightly coupled with the AbstractHopperSet interface and could use some refactoring to decouple the two. If an additional adaptive distribution is added, a new abstract type, such as AbstractAdaptiveMBHDistribution, should be added, and MBHAdaptiveDistribution should be re-named to something more specific.
GlobalOptimization.AbstractMutationOperator — Type
AbstractMutationOperatorThe abstract type for all DE mutation strategies. This type is used to define the mutation strategies available in the DE algorithm.
Subtypes of this type should implement the following method:
get_parameters(strategy::AbstractMutationOperator, dist): Returns the mutation parameters for the given strategy and distribution. The parameters should be returned as aSVector{4, Float64}containing the F₁, F₂, F₃, and F₄ weights for the unified mutation strategy.
GlobalOptimization.AbstractMutationParameters — Type
AbstractMutationParametersThe abstract type for all DE mutation parameters. This type is used to define the mutation parameters available in the DE algorithm.
Subtypes of this type should implement the following methods:
get_parameters(params::AbstractMutationParameters, i): Returns the mutation parameters for the given mutation parameters object and indexi. The parameters should be returned as a tuple of fourFloat64values representing the F₁, F₂, F₃, and F₄ weights for the unified mutation strategy.initialize!(params::AbstractMutationParameters, population_size): Initializes the mutation parameters for the given population size.adapt!(params::AbstractMutationParameters, improved, global_best_improved): Adapts the mutation parameters based on whether the population has improved and whether the global best candidate has improved.mutate!(population::DEPopulation, F::AbstractMutationParameters): Mutates the population using the mutation parameters.
GlobalOptimization.AbstractNonlinearEquationProblem — Type
AbstractNonlinearEquationProblemAbstract type for problems involving a set of nonlinear equations to solve.
GlobalOptimization.AbstractOptimizationProblem — Type
AbstractOptimizationProblemAbstract type for optimization problems.
GlobalOptimization.AbstractOptimizer — Type
AbstractOptimizerAbstract type of all optimization algorithms.
All subtypes must have the following fields:
options<:AbstractAlgorithmSpecificOptions: The options for the optimizer. See theAbstractAlgorithmSpecificOptionsinterface documentation for details.cache<:AbstractOptimizerCache: The cache for the optimizer. See theAbstractOptimizerCacheinterface documentation for details.
All subtypes must define the following methods:
initialize!(opt<:AbstractOptimizer): Initialize the optimizer.step!(opt<:AbstractOptimizer): Perform a single step/iteration with the optimizer.get_best_fitness(opt<:AbstractOptimizer): Get the best fitness of the optimizer.get_best_candidate(opt<:AbstractOptimizer): Get the best candidate of the optimizer.get_show_trace_elements(opt<:AbstractOptimizer, trace_mode::Union{Val{:detailed}, Val{:all}}): Returns a Tuple ofTraceElements and, if necessary,Vector{TraceElement}s, of data to be printed to the terminal. Note that separate methods should be defined forVal{:detailed}andVal{:all}if applicable.get_save_trace_elements(opt<:AbstractOptimizer, trace_mode::Union{Val{:detailed}, Val{:all}}): Returns a Tuple ofTraceElements and, if necessary,Vector{TraceElement}s, of data to be saved to the trace file. Note that separate methods should be defined forVal{:detailed}andVal{:all}if applicable.
GlobalOptimization.AbstractOptimizerCache — Type
AbstractOptimizerCacheAbstract type of all optimization algorithm caches.
All subtypes must have the following fields:
iteration: The current iteration number of the optimizer.start_time: The start time of the optimization.stall_start_time: THe start time of the stall.stall_iteration: The iteration number of the stall.stall_value: The objective function value at start of stall.
These fields must be initialized in the initialize!(opt) method of the optimizer.
GlobalOptimization.AbstractOptions — Type
AbstractOptionsAbstract type for multiple options
GlobalOptimization.AbstractPopulation — Type
AbstractPopulationAbstract type for a population of candidates.
GlobalOptimization.AbstractPopulationBasedOptimizer — Type
AbstractPopulationBasedOptimizerAbstract type of all population based optimization algorithms.
All subtypes must have the following fields:
options<:AbstractAlgorithmSpecificOptions: The options for the optimizer. See theAbstractAlgorithmSpecificOptionsinterface documentation for details.cache<:AbstractPopulationBasedOptimizerCache: The cache for the optimizer. See theAbstractPopulationBasedOptimizerCacheinterface documentation for details.
All subtypes must define the following methods:
initialize!(<:AbstractPopulationBasedOptimizer): Initialize the optimizer.step!(<:AbstractPopulationBasedOptimizer): Perform a single step/iteration with the optimizer.get_population(opt<:AbstractPopulationBasedOptimizer): Get the population of the optimizer. This should return a subtype ofAbstractPopulation.get_show_trace_elements(opt<:AbstractOptimizer, trace_mode::Union{Val{:detailed}, Val{:all}}): Returns a Tuple ofTraceElements and, if necessary,Vector{TraceElement}s, of data to be printed to the terminal. Note that separate methods should be defined forVal{:detailed}andVal{:all}if applicable.get_save_trace_elements(opt<:AbstractOptimizer, trace_mode::Union{Val{:detailed}, Val{:all}}): Returns a Tuple ofTraceElements and, if necessary,Vector{TraceElement}s, of data to be saved to the trace file. Note that separate methods should be defined forVal{:detailed}andVal{:all}if applicable.
Note that the get_best_fitness and get_best_candidate methods required by the AbstractOptimizer interface are provided for subtypes of AbstractPopulationBasedOptimizer.
GlobalOptimization.AbstractPopulationBasedOptimizerCache — Type
AbstractPopulationBasedOptimizerCacheAbstract type of all population based optimization algorithm caches.
All subtypes must have the following fields:
- All fields of
AbstractOptimizerCache. global_best_candidate: The global best candidate of the population.global_best_fitness: The global best fitness of the population.
These fields must be initialized in the initialize!(opt) method of the optimizer. Additionally, the global_best_candidate and global_best_fitness fields must be updated in each iteration when appropriate (i.e., when the global best candidate improves) in iterate!(opt).
GlobalOptimization.AbstractProblem — Type
AbstractProblemAbstract type for all solvable problems.
GlobalOptimization.AbstractRandomNeighborhoodVelocityUpdateScheme — Type
AbstractRandomNeighborhoodVelocityUpdateSchemeAbstract type for a velocity update scheme that randomly selects the particles in the neighborhood of a given particle.
Subtypes of this abstract type have an implementation of the update_velocity! method provided, but must still define the initialize! and adapt! methods.
GlobalOptimization.AbstractSelector — Type
AbstractSelectorSubtypes of this type should be used to select candidates from the population and must implement the following methods:
initialize!(s::AbstractSelector, population_size::Int): Initializes the selector with the population size.select(s::AbstractSelector, target::Int, pop_size::Int): Selects candidates based on the target index and population size.
GlobalOptimization.AbstractVelocityUpdateScheme — Type
AbstractVelocityUpdateSchemeAbstract type for velocity update schemes in Particle Swarm Optimization (PSO).
All subtypes much define the following methods:
initialize!(vu::AbstractVelocityUpdateScheme, swarm_size::Int): Initialize the velocity update scheme for a given swarm size.update_velocity!(swarm::Swarm, vu::AbstractVelocityUpdateScheme): Update the velocity of each candidate in the swarm using the specified velocity update scheme.adapt!(vu::AbstractVelocityUpdateScheme, improved::Bool, stall_iteration::Int): Adapt the velocity update scheme based on the improvement status of the swarm and the stall iteration counter.get_show_trace_elements(vu::AbstractVelocityUpdateScheme, trace_mode::Union{Val{:detailed},Val{:all}}): Get the elements to show in the trace for the velocity update scheme.get_save_trace_elements(vu::AbstractVelocityUpdateScheme, trace_mode::Union{Val{:detailed},Val{:all}}): Get the elements to save in the trace for the velocity update scheme.
GlobalOptimization.AsyncEvaluator — Type
AsyncEvaluatorAbstract type for an evaluator that evaluates the fitness of a single candidate asyncronously.
GlobalOptimization.BatchEvaluator — Type
BatchEvaluatorAbstract type for an evaluator that evaluates the fitness of an entire population.
GlobalOptimization.BatchJobEvaluator — Type
BatchJobEvaluatorAn evaluator that evaluates a batch of jobs
GlobalOptimization.DEBasePopulation — Type
DEBasePopulation{T <: AbstractFloat} <: AbstractPopulation{T}The base representation of some population for the DE algorithms.
GlobalOptimization.DEOptions — Type
DEOptions
Options for the Differential Evolution (DE) algorithms.
Fields:
general<:GeneralOptions: The general options.pop_init_method<:AbstractPopulationInitialization: The population initialization method.mutation_params<:AbstractMutationParameters: The mutation strategy parameters.crossover_params<:AbstractCrossoverParameters: The crossover strategy parameters.initial_space<:Union{Nothing,ContinuousRectangularSearchSpace}: The initial space to initialize the population.
GlobalOptimization.DEPopulation — Type
DEPopulation{T <: AbstractFloat} <: AbstractPopulation{T}The full population representation for the DE algorithms, including both the candidates and the mutants.
GlobalOptimization.DEPopulation — Method
DEPopulation(num_candidates::Integer, num_dims::Integer)Constructs a DEPopulation with num_candidates candidates in num_dims dimensions.
GlobalOptimization.FeasibilityHandlingEvaluator — Type
FeasibilityHandlingEvaluatorAn evaluator that handled a functions returned infeasibility penalty
GlobalOptimization.FixedDimensionSearchSpace — Type
FixedDimensionSearchSpaceThe base abstract type for a search space with a fixed finite number of dimensions. Applicable to the vast majority of optimization problems.
GlobalOptimization.GeneralOptions — Type
GeneralOptionsGeneral options for all optimizers
GlobalOptimization.GlobalOptimizationTrace — Type
GlobalOptimizationTrace{SHT, SAT, TM}A structure to hold the global optimization trace settings.
Fields:
show_trace::SHT: A flag indicating whether to show the trace in the console.save_trace::SAT: A flag indicating whether to save the trace to a file.save_file::String: The file path where the trace will be saved.trace_level::TraceLevel{TM}: The trace level settings, which can beTraceMinimal,TraceDetailed, orTraceAll.
GlobalOptimization.LinearOperatorCrossoverTransformation — Type
LinearOperatorCrossoverTransformationAn abstract type representing a transformation applied to a candidate prior to applying the crossover operator which uses a linear operator.
GlobalOptimization.MBHOptions — Type
MBHOptions <: AbstractAlgorithmSpecificOptionsOptions for the Monotonic Basin Hopping (MBH) algorithm.
GlobalOptimization.MBHStepMemory — Type
MBHStepMemory{T}Memory about MBH accepted steps.
GlobalOptimization.MinimalOptimizerCache — Type
MinimalOptimizerCache{T}A minimal implementation of the AbstractOptimizerCache type.
GlobalOptimization.MinimalPopulationBasedOptimizerCache — Type
MinimalPopulationBasedOptimizerCache{T}A minimal implementation of the AbstractPopulationBasedOptimizerCache type.
Algorithms employing this cache must initialize all fields in initialize!(opt) and must update the iteration field each iteration in iterate!(opt). Additionally, the global_best_candidate and global_best_fitness fields must be updated in each iteration when appropriate (i.e., when the global best candidate improves) in iterate!(opt).
GlobalOptimization.NoAdaptation — Type
NoAdaptationParameters are not adapted at all.
GlobalOptimization.NoTransformation — Type
NoTransformationA transformation that does not apply any transformation to the candidate or mutant.
GlobalOptimization.PSOOptions — Type
PSOOptions <: AbstractAlgorithmSpecificOptionsOptions for the PSO algorithm.
GlobalOptimization.PolyesterBatchEvaluator — Type
PolyesterBatchEvaluatorAn evaluator that evaluates the fitness of a population in parallel using multi-threading using Polyester.jl.
GlobalOptimization.PolyesterBatchJobEvaluator — Type
PolyesterBatchJobEvaluatorAn evaluator that evaluates a batch of jobs in parallel using Polyester.jl.
GlobalOptimization.RandomAdaptation — Type
RandomAdaptationParameters are randomly adapted.
GlobalOptimization.RectangularSearchSpace — Type
RectangularSearchSpaceA FixedDimensionSearchSpace with N dimensional rectangle as the set of feasible points.
GlobalOptimization.Results — Type
Results{T}A simple struct for returning results.
Fields
fbest::T: The best function value found.xbest::Vector{T}: The best candidate found.iters::Int: The number of iterations performed.time::Float64: The time taken to perform the optimization in seconds.exitFlag::Int: The exit flag of the optimization.
GlobalOptimization.Results — Method
Results(fbest::T, xbest::AbstractVector{T}, iters, time, exitFlag)Constructs a new Results struct.
Arguments
fbest::T: The best function value found.xbest::AbstractVector{T}: The best candidate found.iters::Int: The number of iterations performed.time::AbstractFloat: The time taken to perform the optimization in seconds.exitFlag::Int: The exit flag of the optimization.
Returns
Results{T}
GlobalOptimization.SearchSpace — Type
SearchSpaceThe base abstract type for a Problem search space.
GlobalOptimization.SerialBatchEvaluator — Type
SerialBatchEvaluatorAn evaluator that evaluates the fitness of a population in serial.
GlobalOptimization.SerialBatchJobEvaluator — Type
SerialBatchJobEvaluatorAn evaluator that evaluates a batch of jobs in serial.
GlobalOptimization.SingleEvaluator — Type
SingleEvaluatorAbstract type for an evaluator that evaluates the fitness of a single candidate
GlobalOptimization.Swarm — Type
Swarm{T <: AbstractFloat} <: AbstractPopulationA population of particles for the PSO algorithm.
GlobalOptimization.ThreadedBatchEvaluator — Type
ThreadedBatchEvaluatorAn evaluator that evaluates the fitness of a population in parallel using multi-threading.
GlobalOptimization.ThreadedBatchJobEvaluator — Type
ThreadedBatchJobEvaluatorAn evaluator that evaluates a batch of jobs in parallel using Threads.jl and ChunkSplitters.jl.
GlobalOptimization.TraceElement — Type
TraceElement{T}A structure to hold a single trace element, which includes a label, flag, length, precision, and value.
An AbstractOptimizer should return a tuple of TraceElement objects when the get_show_trace_elements or get_save_trace_elements functions are called.
Fields:
label::String: The label for the trace element.flag::Char: A character indicating the format of the value (e.g., 'd' for integer, 'f' for float).length::Int: The length of the formatted string representation of the value.precision::Int: The precision for floating-point values.value::T: The value of the trace element, which can be of any typeT.
GlobalOptimization.TraceLevel — Type
TraceLevel{TM}A structure to with information about the tracing of the global optimization process.
GlobalOptimization.UniformInitialization — Type
UniformInitializationInitializes a population from a uniform distribution in the search space.
Base.eachindex — Method
eachindex(pop::AbstractPopulation)Returns an iterator for the indices of the population.
Base.length — Method
length(pop::AbstractPopulation)Returns the number of candidates in the population.
GlobalOptimization.DEPopulation_F64 — Method
DEPopulation_F64(num_candidates::Integer, num_dims::Integer)Constructs a Float64 DEPopulation with num_candidate candidates in num_dims dimensions.
GlobalOptimization.adapt! — Method
adapt!(vu::AbstractVelocityUpdateScheme, improved::Bool, stall_iteration::Int)Adapt the velocity update scheme based on the improvement status of the swarm and the stall iteration counter.
GlobalOptimization.all_correlated — Method
all_correlated(cor, tol)Checks if the absolute value of the lower-triangular part of the correlation matrix cor are above the correlation tolerance tol and returns true if so, otherwise, returns false.
Arguments:
cor::AbstractMatrix: The correlation matrixtol::AbstractFloat: The correlation tolerance. Elements ofcorwith an absolute value greater thantolare assumed to be correlated.
Returns:
Bool:trueif all elements are correlated andfalseotherwise
GlobalOptimization.candidate — Method
candidate(c::AbstractCandidate)Returns the candidate c.
GlobalOptimization.candidates — Method
candidates(pop::AbstractPopulation, [i::Integer])Returns the candidates from a population. If i is specified, returns the i-th candidate.
GlobalOptimization.check_fitness! — Method
check_fitness!(c::AbstractCandidate, ::Val)Checks the fitness if the option has been enabled.
GlobalOptimization.check_fitness! — Method
check_fitness!(c::AbstractHopperSet, options::Union{GeneralOptions,Val{true},Val{false}})Checks the fitness of the candidate c to ensure that it is valid iff the option has been enabled.
GlobalOptimization.check_fitness! — Method
check_fitness!(pop::AbstractPopulation, options::Union{GeneralOptions,Val{true},Val{false}})Checks the fitness of each candidate in the population pop to ensure that it is valid iff options <: Union{GeneralOptions{D,Val{true}}, Val{true}}, otherwise, does nothing.
GlobalOptimization.check_stopping_criteria — Method
check_stopping_criteria(opt::AbstractOptimizer)Check if opt satisfies any stopping criteria. Returns the appropriate Status enum.
GlobalOptimization.construct_batch_evaluator — Method
construct_batch_evaluator(
method::AbstractFunctionEvaluationMethod,
prob::OptimizationProblem,
)Constructs a batch evaluator for the given method and prob.
GlobalOptimization.construct_batch_job_evaluator — Method
construct_batch_job_evaluator(method::AbstractFunctionEvaluationMethod)Constructs a batch job evaluator for the given method.
GlobalOptimization.construct_results — Method
construct_results(opt::AbstractOptimizer, status::Status)Construct the results from the optimizer opt with the appropriate Status to indicate the stopping criteria.
GlobalOptimization.crossover! — Method
crossover!(population::DEPopulation{T}, crossover_params, search_space)Performs the crossover operation on the population population using the DE crossover strategy.
This function also ensures that, after crossover, the mutants are within the search space.
GlobalOptimization.dim_delta — Method
dim_delta(ss::ContinuousRectangularSearchSpace{T}, [i::Integer])Returns the difference between the maximum and minimum values for the i-th dimension of ss. If i is not specified, returns a vector of all differences.
Arguments
ss::ContinuousRectangularSearchSpace{T}`i::Integer: the dimension to return the difference between the maximum and minimum values for.
Returns
TorVector{T}the difference between the maximum and minimum values for thei-th dimension ofssor a vector of all differences ifinot provided.
GlobalOptimization.dim_max — Method
dim_max(ss::ContinuousRectangularSearchSpace{T}, [i::Integer])Returns the maximum value for the i-th dimension of ss. If i is not specified, returns a vector of all maximum values.
Arguments
ss::ContinuousRectangularSearchSpace{T}i::Integer: the dimension to return the maximum value for.
Returns
TorVector{T}: the minimum value for thei-th dimension ofssor a vector of all minimum values ifinot provided.
GlobalOptimization.dim_min — Method
dim_min(ss::ContinuousRectangularSearchSpace{T}, [i::Integer])Returns the minimum value for the i-th dimension of ss. If i is not specified, returns a vector of all minimum values.
Arguments
ss::RontinuousRectangularSearchSpace{T}i::Integer: the dimension to return the minimum value for.
Returns
TorVector{T}: the minimum value for thei-th dimension ofssor a vector of all minimum values ifinot provided.
GlobalOptimization.dim_range — Method
dim_range(ss::ContinuousRectangularSearchSpace{T}, [i::Integer])Returns the range of values for the i-th dimension of ss. If i is not specified, returns a vector of all ranges.
Arguments
ss::ContinuousRectangularSearchSpace{T}i::Integer: the dimension to return the range of values for.
Returns
Tuple{T, T}orVector{Tuple{T, T}}: the range of values for thei-th dimension ofssor a vector of all ranges ifinot provided.
GlobalOptimization.draw_step! — Method
draw_step!(step::AbstractVector{T}, dist::AbstractMBHDistribution{T})Draws a step from the distribution dist and stores it in step.
GlobalOptimization.draw_update! — Method
draw_update!(hopper::Hopper{T}, distribution::AbstractMBHDistribution{T})Draws a perterbation from distribution and updates candidate for the hopper hopper.
GlobalOptimization.enforce_bounds! — Method
enforce_bounds!(swarm::Swarm{T}, evaluator::BatchEvaluator)Enforces the bounds of the search space on each candidate in the swarm swarm. If a candidate
GlobalOptimization.evaluate! — Method
evaluate!(job::Function, job_ids::AbstractVector{Int}, evaluator::BatchJobEvaluator)Evaluates job for each element of job_args using the given evaluator.
GlobalOptimization.evaluate! — Method
evaluate!(pop::AbstractPopulation, evaluator::BatchEvaluator)Evaluates the fitness of a population using the given evaluator.
GlobalOptimization.evaluate_fitness! — Method
evaluate_fitness!(swarm::Swarm{T}, evaluator::BatchEvaluator)Evaluates the fitness of each candidate in the swarm swarm using the evaluator. Updates the swarms best candidates if any are found.
GlobalOptimization.evaluate_with_penalty — Method
evaluate_with_penalty(evaluator::FeasibilityHandlingEvaluator, candidate::AbstractArray)GlobalOptimization.feasible — Method
feasible(x, ss::ContinuousRectangularSearchSpace)Returns true if the point x is feasible in the search space ss, otherwise returns false.
Arguments
x::AbstractVector{T}: the point to check for feasibility.ss::ContinuousRectangularSearchSpace{T}: the search space to check for feasibility in.
Returns
Bool:trueifxis inss, otherwisefalse.
Throws
DimensionMismatch: ifxdoes not have the same number of dimensions asss.
GlobalOptimization.fill_identity! — Method
fill_identity!(mat)Fills the mat in-place with the identity matrix.
GlobalOptimization.fitness — Method
fitness(c::AbstractCandidate)Returns the fitness of the candidate c.
GlobalOptimization.fitness — Method
fitness(pop::AbstractPopulation, [i::Integer])Returns the fitness of the candidates from a population. If i is specified, returns the i-th fitness.
GlobalOptimization.get_batch_evaluator — Method
get_batch_evaluator(hopper_type::AbstractHopperType)Returns the batch job evaluator for a given hopper type.
GlobalOptimization.get_best_candidate — Method
get_best_candidate(opt::AbstractOptimizer)Get the best candidate found by opt.
GlobalOptimization.get_best_candidate_in_subset — Method
get_best_candidate_in_subset(population::DEPopulation, idxs)Get the best candidate in the selected subset of population (as specified by the indices in idxs).
GlobalOptimization.get_best_fitness — Method
get_best_fitness(opt::AbstractOptimizer)Get the fitness of the best candidate found by opt.
GlobalOptimization.get_elapsed_time — Method
get_elapsed_time(opt::AbstractOptimizer)Get the elapsed time of the optimizer opt in seconds.
GlobalOptimization.get_function_tolerance — Method
get_function_tolerance(opts::AbstractAlgorithmSpecificOptions)Returns the function tolerance option from an algorithm options type.
GlobalOptimization.get_function_value_check — Method
get_function_value_check(opts::AbstractAlgorithmSpecificOptions)Returns the function value check option from an algorithm options type.
GlobalOptimization.get_general — Method
get_general(opts::AbstractAlgorithmSpecificOptions)Returns the general options from an algorithm options type.
GlobalOptimization.get_hopper_set — Method
get_hopper_set(prob::AbstractProblem, hopper_type::AbstractHopperType)Returns the hopper set for a given problem and hopper type.
GlobalOptimization.get_iteration — Method
get_iteration(opt::AbstractOptimizer)Get the current iteration number of the optimizer opt.
GlobalOptimization.get_max_iterations — Method
get_max_iterations(opts::AbstractAlgorithmSpecificOptions)Returns the max iterations option from an algorithm options type.
GlobalOptimization.get_max_stall_iterations — Method
get_max_stall_iterations(opts::AbstractAlgorithmSpecificOptions)Returns the max stall iterations option from an algorithm options type.
GlobalOptimization.get_max_stall_time — Method
get_max_stall_time(opts::AbstractAlgorithmSpecificOptions)Returns the max stall time option from an algorithm options type.
GlobalOptimization.get_max_time — Method
get_max_time(opts::AbstractAlgorithmSpecificOptions)Returns the max time option from an algorithm options type.
GlobalOptimization.get_min_cost — Method
get_min_cost(opts::AbstractAlgorithmSpecificOptions)Returns the min cost option from an algorithm options type.
GlobalOptimization.get_population — Method
get_population(opt::AbstractPopulationBasedOptimizer)Returns the population of the optimizer opt. This should return a subtype of AbstractPopulation.
GlobalOptimization.get_scalar_function — Method
get_scalar_function(prob::AbstractProblem)
Returns cost function plus the infeasibility penalty squared as a scalar value.
This is used for PSO (GA, Differential Evolution, etc. if we ever get around to adding those)GlobalOptimization.get_scalar_function_with_penalty — Method
get_scalar_function_with_penalty(prob::AbstractProblem)GlobalOptimization.get_trace — Method
get_trace(opts::AbstractOptions)Returns the display option from an options type.
GlobalOptimization.handle_local_search — Method
handle_local_search(local_search::AbstractLocalSearch, hopper_type::AbstractHopperType)Returns the local search algorithm for a given hopper type.
GlobalOptimization.handle_stall! — Method
handle_stall!(opt::AbstractOptimizer)Handles updating the stall related fields of the AbstractOptimizerCache for opt.
GlobalOptimization.has_gradient — Method
has_gradient(evaluator::AbstractEvaluator)Returns true if the evaluator has a gradient, otherwise, false.
GlobalOptimization.hop! — Method
hop!(hopper::Union{Hopper, AbstractHopperSet}, ss, eval, dist, ls)Performs a single hop for the hopper hopper in the search space ss using the evaluator eval, the distribution dist, and the local search ls.
GlobalOptimization.initialize! — Method
initialize!(dist::AbstractMBHDistribution, num_dims)Initializes the distribution dist with the number of dimensions num_dims.
GlobalOptimization.initialize! — Method
initialize!(cache::AbstractOptimizerCache, best_fitness)A helper function to initialize the cache of an optimizer. This function should be called in the initialize!(opt) method of the optimizer.
GlobalOptimization.initialize! — Method
initialize!(opt::AbstractOptimizer)Initialize the optimizer opt. All memory allocations that are not possible to do in the constructor should be done here when possible.
GlobalOptimization.initialize! — Method
initialize!(cache::AbstractPopulationBasedOptimizerCache)A helper function to initialize the cache of a population based optimizer. This function should be called in the initialize!(opt) method of the optimizer, after initializing the global_best_candidate and global_best_fitness fields of the cache.
GlobalOptimization.initialize! — Method
initialize!(vu::AbstractVelocityUpdateScheme, swarm_size::Int)Initialize the velocity update scheme for a given swarm size.
GlobalOptimization.initialize! — Method
initialize!(
hopper::Hopper{T},
search_space::ContinuousRectangularSearchSpace{T},
evaluator::FeasibilityHandlingEvaluator{T},
)Initializes the hopper position in the search space.
GlobalOptimization.initialize! — Method
initialize!(
swarm::Swarm{T},
pop_init_method::AbstractPopulationInitialization,
search_space::ContinuousRectangularSearchSpace{T}
)Initializes the swarm population with pop_init_method in the search_space.
GlobalOptimization.initialize_fitness! — Method
initialize_fitness!(swarm::Swarm{T}, evaluator::BatchEvaluator)Initializes the fitness of each candidate in the swarm swarm using the evaluator.
GlobalOptimization.intersection — Method
intersection(
ss1::ContinuousRectangularSearchSpace{T1},
ss2::ContinuousRectangularSearchSpace{T2}
)Returns the intersection of the two search spaces ss1 and ss2 as a new search space.
Arguments
ss1::ContinuousRectangularSearchSpace{T1}ss2::ContinuousRectangularSearchSpace{T2}
Returns
- `ContinuousRectangularSearchSpace{promote_type(T1, T2)}
Throws
DimensionMismatch: ifss1andss2do not have the same number of dimensions.
GlobalOptimization.mutate! — Method
mutate!(population::DEPopulation{T}, F)Mutates the population population using the DE mutation strategy.
This is an implementation of the unified mutation strategy proposed by Ji Qiang and Chad Mitchell in "A Unified Differential Evolution Algorithm for Global Optimization".
GlobalOptimization.num_dims — Method
num_dims(ss::ContinuousRectangularSearchSpace)Returns the number of dimensions in the search space ss.
Arguments
ss::ContinuousRectangularSearchSpace
Returns
Integer
GlobalOptimization.num_dims — Method
num_dims(prob::AbstractProblem)Returns the number of dimensions of the decision vector of the optimization problem prob.
GlobalOptimization.push! — Method
push!(step_memory::MBHStepMemoory{T}, step::Vector{T}, pre_step_fitness::T, post_step_fitness::T)Pushes a step into the step memory.
GlobalOptimization.push_accepted_step! — Method
push_accepted_step!(
dist::MBHAdaptiveDistribution{T},
step::AbstractVector{T},
pre_step_fitness::T,
post_step_fitness::T,
) where {T}GlobalOptimization.reset! — Method
reset!(hopper::Hopper)Resets the candidate to state prior to the last draw_update! call.
Note: This just subtracts the last step from the candidate.
GlobalOptimization.scalar_function — Method
scalar_function(prob::OptimizationProblem, x::AbstractArray)Evaluates the objective function f of the optimization problem prob at x and returns the cost function plus the infeasibility.
GlobalOptimization.scalar_function — Method
scalar_function(prob::AbstractNonlinearEquationProblem, x::AbstractArray)Evaluates the set of nonlinear equations f and returns the nonlinear least squares cost plus half the infeasibility squared.
GlobalOptimization.scalar_function_with_penalty — Method
scalar_function_with_penalty(prob::OptimizationProblem, x::AbstractArray)Evaluates the objective function f of the optimization problem prob at x and returns the cost function and the infeasibility penalty term as tuple. i.e., for an OptimizationProblem, this is simply the original function.
GlobalOptimization.scalar_function_with_penalty — Method
scalar_function_with_penalty(prob::AbstractNonlinearEquationProblem, x::AbstractArray)Evaluates the set of nonlinear equations f and returns the nonlinear least squares cost and the infeasibility penalty term as a tuple.
GlobalOptimization.search_space — Method
search_space(prob::AbstractProblem)Returns the search space of the optimization problem prob.
GlobalOptimization.selection! — Method
selection!(population::DEPopulation{T}, evaluator::BatchEvaluator)Replace candidates with mutants if they have a better fitness.
GlobalOptimization.set_fitness! — Method
set_fitness!(c::AbstractCandidate, fitness)GlobalOptimization.set_fitness! — Method
set_fitness(pop::AbstractPopulation, fitness, [i::Integer])Sets the fitness of the candidates from a population. If i is specified, sets the i-th fitness.
GlobalOptimization.step! — Method
step!(opt::AbstractOptimizer)Perform a single step/iteration with the optimizer opt. This function should be non-allocating if possible.
GlobalOptimization.step! — Method
step!(swarm::Swarm)Steps the swarm swarm forward one iteration.
GlobalOptimization.step_MAD_median — Method
step_MAD_median(step_memory::MBHStepMemory{T}, var_idx::Integer)Returns the mean absolute deviation (MAD) around the median of the step memory. If var_idx is specified, then the MAD median of the step memory for the variable at index var_idx is returned.
GlobalOptimization.step_std — Method
step_std(step_memory::MBHStepMemory{T}, var_idx::Integer)Returns the standard deviation of the step memory. If var_idx is specified, then the standard deviation of the step memory for the variable at index var_idx is returned.
GlobalOptimization.update_fitness! — Method
update_fitness!(hopper::AbstractHopperSet{T}, distribution::AbstractMBHDistribution{T})Updates the hopper fitness information after previously evaluating the fitness of the hopper.
GlobalOptimization.update_global_best! — Method
update_global_best!(opt::AbstractPopulationBasedOptimizer)Updates the global best candidate and fitness in the cache of the population based optimizer opt when a better candidate is found. Returns true if the global best candidate was updated, false otherwise.
GlobalOptimization.update_velocity! — Method
update_velocity!(swarm::Swarm, vu::AbstractVelocityUpdateScheme)Update the velocity of each candidate in the swarm using the specified velocity update scheme.