metaheuristic_designer.operators.operator_functions package#
Submodules#
- metaheuristic_designer.operators.operator_functions.crossover module
- metaheuristic_designer.operators.operator_functions.differential_evolution module
- metaheuristic_designer.operators.operator_functions.mutation module
- metaheuristic_designer.operators.operator_functions.permutation module
- metaheuristic_designer.operators.operator_functions.probability_distributions module
DistributionScipyUnivarDistributionScipyMultivarDistributionmultivariate_categoricaluniform_param_fix()normal_heuristic()uniform_heuristic()cauchy_heuristic()laplace_heuristic()gamma_heuristic()expon_heuristic()levy_stable_heuristic()poisson_heuristic()bernoulli_heuristic()binomial_heuristic()tikhinov_heuristic()multivariate_normal_heuristic()dirichlet_heuristic()tikhinov_fisher_heuristic()
- metaheuristic_designer.operators.operator_functions.probability_distributions_factory module
- metaheuristic_designer.operators.operator_functions.random_generation module
- metaheuristic_designer.operators.operator_functions.swarm module
- metaheuristic_designer.operators.operator_functions.utils module
Module contents#
Pure function implementation of mutation operators
- class ObtainStatisticDef(operator_fn, params=<factory>, forced_params=<factory>)[source]#
Bases:
objectWrap a statistic‑computing function into an
Operator.This adapter is used for functions that compute a single summary vector (e.g., population mean, median, standard deviation) and store it as the new genotype (usually a single-row population).
- Parameters:
- operator_fncallable
Function with signature
(population_matrix, rng, **kwargs) -> np.ndarray.- paramsdict, optional
Default keyword arguments.
- forced_paramsdict, optional
Keyword arguments that override user-supplied ones.
- Parameters:
operator_fn (callable)
params (dict)
forced_params (dict)
Methods
__call__(population[, rng])Compute a statistic and replace the population’s genotype.
-
operator_fn:
callable#
-
params:
dict#
-
forced_params:
dict#
- class OperatorRandomDef(operator_fn, params=<factory>, forced_params=<factory>)[source]#
Bases:
objectBridge a random-style operator function into an
Operator.This wrapper is intended for operators that replace the genotype with entirely new random values (e.g., uniform sampling, initializer-based reset). It passes the population’s genotype matrix, the initializer, and the random state to the underlying function.
- Parameters:
- operator_fncallable
Function with signature
(population_matrix, initializer, rng, **kwargs) -> np.ndarray.- paramsdict, optional
Default keyword arguments.
- forced_paramsdict, optional
Keyword arguments that override any user-supplied ones.
- Parameters:
operator_fn (callable)
params (dict)
forced_params (dict)
Methods
__call__(population, initializer[, rng])Execute the random operator and return a new population.
-
operator_fn:
callable#
-
params:
dict#
-
forced_params:
dict#
- class OperatorSwarmDef(operator_fn, params=<factory>, forced_params=<factory>)[source]#
Bases:
objectBridge a swarm operator function into an
Operator.This wrapper is designed for operators that directly receive the whole
Populationobject and the initializer, and are responsible for returning an updatedPopulationthemselves (e.g., PSO operators that need access to historical bests).- Parameters:
- operator_fncallable
Function with signature
(population, initializer, rng, **kwargs) -> Population.- paramsdict, optional
Default keyword arguments.
- forced_paramsdict, optional
Keyword arguments that override user-supplied ones.
- Parameters:
operator_fn (callable)
params (dict)
forced_params (dict)
Methods
__call__(population, rng, **kwargs)Execute the swarm operator and return the new population.
-
operator_fn:
callable#
-
params:
dict#
-
forced_params:
dict#
- class OperatorFnDef(operator_fn, params=<factory>, forced_params=<factory>)[source]#
Bases:
objectBridge a matrix-to-matrix operator function into an
Operator.This wrapper accepts a callable that operates on a genotype matrix, fitness array, and random state, and turns it into an object that can be used directly on a
Population. It merges user-supplied keyword arguments with stored defaults and forced parameters, then invokes the underlying function and updates the population’s genotype.- Parameters:
- operator_fncallable
Function with signature
(population_matrix, fitness_array, rng, **kwargs) -> np.ndarray.- paramsdict, optional
Default keyword arguments for the operator.
- forced_paramsdict, optional
Keyword arguments that always override user-supplied ones.
- Parameters:
operator_fn (callable)
params (dict)
forced_params (dict)
Methods
__call__(population[, rng])Execute the wrapped operator and return a new population.
-
operator_fn:
callable#
-
params:
dict#
-
forced_params:
dict#