Changeset 1184 for trunk/sources/HeuristicLab.RealVector/LocalCrossover.cs
- Timestamp:
- 01/28/09 10:20:40 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.RealVector/LocalCrossover.cs
r102 r1184 27 27 28 28 namespace HeuristicLab.RealVector { 29 /// <summary> 30 /// Local crossover for real vectors: Takes for each element the allele of the first parent times a 31 /// always newly created randomly chosen factor and adds the allele of the second parent times (1 - the randomly chosen factor). 32 /// </summary> 29 33 public class LocalCrossover : RealVectorCrossoverBase { 34 /// <inheritdoc select="summary"/> 30 35 public override string Description { 31 36 get { return "Local crossover for real vectors."; } 32 37 } 33 38 39 /// <summary> 40 /// Performs a local crossover on the two given parent vectors. 41 /// </summary> 42 /// <param name="random">The random number generator.</param> 43 /// <param name="parent1">The first parent for the crossover operation.</param> 44 /// <param name="parent2">The second parent for the crossover operation.</param> 45 /// <returns>The newly created real vector, resulting from the local crossover.</returns> 34 46 public static double[] Apply(IRandom random, double[] parent1, double[] parent2) { 35 47 double factor; … … 44 56 } 45 57 58 /// <summary> 59 /// Performs a local crossover on the two given parent vectors. 60 /// </summary> 61 /// <remarks>Calls <see cref="Apply"/>.</remarks> 62 /// <param name="scope">The current scope.</param> 63 /// <param name="random">The random number generator.</param> 64 /// <param name="parent1">The first parent for the crossover operation.</param> 65 /// <param name="parent2">The second parent for the crossover operation.</param> 66 /// <returns>The newly created real vector, resulting from the local crossover.</returns> 46 67 protected override double[] Cross(IScope scope, IRandom random, double[] parent1, double[] parent2) { 47 68 return Apply(random, parent1, parent2);
Note: See TracChangeset
for help on using the changeset viewer.