Changeset 2919 for trunk/sources/HeuristicLab.Encodings.RealVector/3.3
- Timestamp:
- 03/03/10 14:44:49 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/SimulatedBinaryCrossover.cs
r2918 r2919 70 70 if (u < 0.5) { // if u is smaller than 0.5 perform a contracting crossover 71 71 beta = Math.Pow(2 * u, 1.0 / (contiguity.Value + 1)); 72 } else { // otherwise perform an expanding crossover72 } else if (u > 0.5) { // otherwise perform an expanding crossover 73 73 beta = Math.Pow(1.0 / (2 - 2 * u), (contiguity.Value + 1)); 74 } 74 } else if (u == 0.5) 75 beta = 1; 76 75 77 if (random.NextDouble() < 0.5) 76 78 result[i] = ((parent1[i] + parent2[i]) / 2.0) - beta * 0.5 * Math.Abs(parent1[i] - parent2[i]);
Note: See TracChangeset
for help on using the changeset viewer.