Changeset 3060 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/HeuristicCrossover.cs
- Timestamp:
- 03/16/10 10:46:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/HeuristicCrossover.cs
r3053 r3060 68 68 /// <param name="worseParent">The second parent for the crossover operation.</param> 69 69 /// <returns>The newly created real vector, resulting from the heuristic crossover.</returns> 70 public static DoubleArray Apply(IRandom random, DoubleArray betterParent, DoubleArrayworseParent) {70 public static RealVector Apply(IRandom random, RealVector betterParent, RealVector worseParent) { 71 71 if (betterParent.Length != worseParent.Length) 72 72 throw new ArgumentException("HeuristicCrossover: the two parents are not of the same length"); … … 79 79 result[i] = betterParent[i] + factor * (betterParent[i] - worseParent[i]); 80 80 } 81 return new DoubleArray(result);81 return new RealVector(result); 82 82 } 83 83 … … 96 96 /// <param name="parents">An array containing the two real vectors that should be crossed.</param> 97 97 /// <returns>The newly created real vector, resulting from the crossover operation.</returns> 98 protected override DoubleArray Cross(IRandom random, ItemArray<DoubleArray> parents) {98 protected override RealVector Cross(IRandom random, ItemArray<RealVector> parents) { 99 99 if (parents.Length != 2) throw new ArgumentException("HeuristicCrossover: The number of parents is not equal to 2"); 100 100
Note: See TracChangeset
for help on using the changeset viewer.