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