metaheuristic_designer.simple.hill_climb module#
Ready-to-run Hill Climbing wrappers.
- hill_climb_binary(objfunc, mutated_bits=1, encoding=None, rng=None, **kwargs)[source]#
Hill Climbing for binary-coded vectors.
- Return type:
- Parameters:
- objfuncObjectiveFunc
The objective function to optimize.
- mutated_bitsint, optional
Number of bits flipped per mutation (default 1).
- encodingEncoding, optional
Encoding; defaults to
TypeCastEncoding(int → bool).- rngRNGLike, optional
Random seed or generator.
- **kwargs
Forwarded to
Algorithm.
- Parameters:
objfunc (ObjectiveFunc)
mutated_bits (int)
encoding (Encoding | None)
rng (int | Generator | None)
- hill_climb_permutation(objfunc, swapped_positions=2, encoding=None, rng=None, **kwargs)[source]#
Hill Climbing for permutation-coded vectors.
- Return type:
- Parameters:
- objfuncObjectiveFunc
The objective function to optimize.
- swapped_positionsint, optional
Number of positions swapped per mutation (default 2).
- encodingEncoding, optional
Encoding applied to the genotype.
- rngRNGLike, optional
Random seed or generator.
- **kwargs
Forwarded to
Algorithm.
- Parameters:
objfunc (ObjectiveFunc)
swapped_positions (int)
encoding (Encoding | None)
rng (int | Generator | None)
- hill_climb_discrete(objfunc, resampled_components=1, encoding=None, rng=None, **kwargs)[source]#
Hill Climbing for integer-coded vectors.
- Return type:
- Parameters:
- objfuncObjectiveFunc
The objective function to optimize.
- resampled_componentsint, optional
Number of components resampled per mutation (default 1).
- encodingEncoding, optional
Encoding applied to the genotype.
- rngRNGLike, optional
Random seed or generator.
- **kwargs
Forwarded to
Algorithm.
- Parameters:
objfunc (ObjectiveFunc)
resampled_components (int)
encoding (Encoding | None)
rng (int | Generator | None)
- hill_climb_real(objfunc, mutation_strength=0.01, mutated_components=1, encoding=None, rng=None, **kwargs)[source]#
Hill Climbing for real-coded vectors.
- Return type:
- Parameters:
- objfuncObjectiveFunc
The objective function to optimize.
- mutation_strengthfloat, optional
Standard deviation of Gaussian mutation (default 1e-2).
- mutated_componentsint, optional
Number of components mutated per individual (default 1).
- encodingEncoding, optional
Encoding applied to the genotype.
- rngRNGLike, optional
Random seed or generator.
- **kwargs
Forwarded to
Algorithm.
- Parameters:
objfunc (ObjectiveFunc)
mutation_strength (float)
mutated_components (int)
encoding (Encoding | None)
rng (int | Generator | None)