Changeset 3048 for trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Crossovers/SinglePointCrossover.cs
- Timestamp:
- 03/15/10 23:49:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Crossovers/SinglePointCrossover.cs
r3032 r3048 45 45 /// <param name="parent2">The second parent for crossover.</param> 46 46 /// <returns>The newly created integer vector, resulting from the single point crossover.</returns> 47 public static IntArray Data Apply(IRandom random, IntArrayData parent1, IntArrayDataparent2) {47 public static IntArray Apply(IRandom random, IntArray parent1, IntArray parent2) { 48 48 if (parent1.Length != parent2.Length) 49 49 throw new ArgumentException("DiscreteCrossover: The parents are of different length."); … … 58 58 result[i] = parent2[i]; 59 59 60 return new IntArray Data(result);60 return new IntArray(result); 61 61 } 62 62 … … 69 69 /// <param name="parents">An array containing the two integer vectors that should be crossed.</param> 70 70 /// <returns>The newly created integer vector, resulting from the single point crossover.</returns> 71 protected override IntArray Data Cross(IRandom random, ItemArray<IntArrayData> parents) {71 protected override IntArray Cross(IRandom random, ItemArray<IntArray> parents) { 72 72 if (parents.Length != 2) throw new ArgumentException("ERROR in SinglePointCrossover: The number of parents is not equal to 2"); 73 73 return Apply(random, parents[0], parents[1]);
Note: See TracChangeset
for help on using the changeset viewer.