Changeset 1218 for trunk/sources/HeuristicLab.RealVector/LocalCrossover.cs
- Timestamp:
- 02/16/09 01:21:53 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.RealVector/LocalCrossover.cs
r1184 r1218 57 57 58 58 /// <summary> 59 /// Performs a local crossover o n the two given parentvectors.59 /// Performs a local crossover operation for two given parent real vectors. 60 60 /// </summary> 61 /// < remarks>Calls <see cref="Apply"/>.</remarks>61 /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception> 62 62 /// <param name="scope">The current scope.</param> 63 /// <param name="random"> Therandom number generator.</param>64 /// <param name="parent 1">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>67 protected override double[] Cross(IScope scope, IRandom random, double[] parent1, double[] parent2) {68 return Apply(random, parent 1, parent2);63 /// <param name="random">A random number generator.</param> 64 /// <param name="parents">An array containing the two real vectors that should be crossed.</param> 65 /// <returns>The newly created real vector, resulting from the crossover operation.</returns> 66 protected override double[] Cross(IScope scope, IRandom random, double[][] parents) { 67 if (parents.Length != 2) throw new InvalidOperationException("ERROR in LocalCrossover: The number of parents is not equal to 2"); 68 return Apply(random, parents[0], parents[1]); 69 69 } 70 70 }
Note: See TracChangeset
for help on using the changeset viewer.