- Timestamp:
- 03/15/10 23:49:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/LocalCrossover.cs
r3017 r3048 43 43 /// <param name="parent2">The second parent for the crossover operation.</param> 44 44 /// <returns>The newly created real vector, resulting from the local crossover.</returns> 45 public static DoubleArray Data Apply(IRandom random, DoubleArrayData parent1, DoubleArrayDataparent2) {45 public static DoubleArray Apply(IRandom random, DoubleArray parent1, DoubleArray parent2) { 46 46 if (parent1.Length != parent2.Length) 47 47 throw new ArgumentException("LocalCrossover: the two parents are not of the same length"); … … 55 55 result[i] = (factor * parent1[i]) + ((1 - factor) * parent2[i]); 56 56 } 57 return new DoubleArray Data(result);57 return new DoubleArray(result); 58 58 } 59 59 … … 65 65 /// <param name="parents">An array containing the two real vectors that should be crossed.</param> 66 66 /// <returns>The newly created real vector, resulting from the crossover operation.</returns> 67 protected override DoubleArray Data Cross(IRandom random, ItemArray<DoubleArrayData> parents) {67 protected override DoubleArray Cross(IRandom random, ItemArray<DoubleArray> parents) { 68 68 if (parents.Length != 2) throw new ArgumentException("LocalCrossover: The number of parents is not equal to 2"); 69 69 return Apply(random, parents[0], parents[1]);
Note: See TracChangeset
for help on using the changeset viewer.