metaheuristic_designer.operators.operator_functions.random_generation module#
- compute_statistic(population_matrix, stat_name='mean', weights=None)[source]#
- Parameters:
- population_matrix: numpy.array
Matrix containing the set of tentative solutions.
- initializer: Initializer
Initializer instance that handles random initialization of the population.
- stat_name: str, optional
Name of the statistic to use, options are “mean”, “average”, “median” and “std”, by default “mean”.
- weights: numpy.array, optional
Vector indicating the weights to apply if “average” is selected, by default None.
- Returns:
- Component-wise statistic vector.
- random_initialize(population_matrix, initializer, rng=None)[source]#
Randomly regenerate the entire population from scratch with the initializer’s distribution.
- Parameters:
- population_matrix: numpy.array
Matrix containing the set of tentative solutions.
- initializer: Initializer
Initializer instance that handles random initialization of the population.
- Returns:
- Randomly initialized population
- Parameters:
initializer (Initializer)
- random_reset(population_matrix, initializer, rng=None, n=1)[source]#
Randomly resets n components of each solution.
- Parameters:
- population_matrix: numpy.array
Matrix containing the set of tentative solutions.
- initializer: Initializer
Initializer instance that handles random initialization of the population.
- n: int, optional
Number of components to reset, by default 1
- Returns:
- Population matrix with randomly changed components.
- Parameters:
initializer (Initializer)
n (int)