|
OptiPy
|
Implements the DE/rand/1 mutation strategy. More...
#include <Rand1.h>
Public Member Functions | |
| std::vector< double > | mutate (const std::vector< std::vector< double > > &population, size_t targetIndex, double F, const std::vector< double > &bestVector, MersenneTwister &mt, double lowerBound, double upperBound) override |
| Generates a mutant vector using DE/rand/1 strategy. | |
| Public Member Functions inherited from Mutation | |
| virtual | ~Mutation ()=default |
| Virtual destructor for safe polymorphic deletion. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Mutation | |
| std::vector< size_t > | getSubset (size_t populationSize, size_t subsetSize, size_t source, MersenneTwister &mt) |
| Selects a random subset of population indices, excluding a source index. | |
Implements the DE/rand/1 mutation strategy.
Strategy: DE/rand/1 (Random-1)
The most basic and exploratory DE mutation strategy. Uses a random base vector and applies a single weighted difference vector to generate variation.
Formula:
\[ v_i(t) = x_{r0}(t) + F \cdot (x_{r1}(t) - x_{r2}(t)) \]
Where:
Algorithm:
Characteristics:
Exploration: Very high
Exploitation: Very low
Robustness: Excellent
Convergence Speed: Slow
Parameter Recommendations:
Comparison with Other Strategies:
| Strategy | Base | Differences | Exploration | Convergence |
|---|---|---|---|---|
| Rand1 | Random | 1 | Very High | Very Slow |
| Best1 | Best | 1 | Low | Very Fast |
| Rand2 | Random | 2 | Extreme | Slow |
| Best2 | Best | 2 | Moderate | Moderate |
| RandBest1 | Hybrid | 1 | Moderate | Moderate |
Use Cases:
Avoid When:
Implementation Details:
The implementation follows a straightforward pattern:
Complexity:
Time: O(dimension) Space: O(dimension) for the mutant vector
Example Usage:
Historical Note:
DE/rand/1 was the original DE mutation strategy proposed by Storn and Price (1997). Despite the availability of more refined strategies, it remains a benchmark for algorithm robustness and is commonly used as the default strategy.
|
inlineoverridevirtual |
Generates a mutant vector using DE/rand/1 strategy.
Applies the formula: mutant = r0 + F * (r1 - r2) where r0, r1, r2 are three randomly selected distinct individuals.
| [in] | population | Current population of solutions |
| [in] | targetIndex | Index of the target individual (excluded from selection) |
| [in] | F | Differential weight; typical range 0.5-1.5 |
| [in] | bestVector | Best solution (unused by Rand1, but required by interface) |
| [in,out] | mt | Random number generator for selection |
| [in] | lowerBound | Lower domain bound |
| [in] | upperBound | Upper domain bound |
Implements Mutation.