Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/10 10:46:59 (15 years ago)
Author:
svonolfe
Message:

Updated the RealVector project to use the new solution encodings (#909)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/HeuristicCrossover.cs

    r3053 r3060  
    6868    /// <param name="worseParent">The second parent for the crossover operation.</param>
    6969    /// <returns>The newly created real vector, resulting from the heuristic crossover.</returns>
    70     public static DoubleArray Apply(IRandom random, DoubleArray betterParent, DoubleArray worseParent) {
     70    public static RealVector Apply(IRandom random, RealVector betterParent, RealVector worseParent) {
    7171      if (betterParent.Length != worseParent.Length)
    7272        throw new ArgumentException("HeuristicCrossover: the two parents are not of the same length");
     
    7979        result[i] = betterParent[i] + factor * (betterParent[i] - worseParent[i]);
    8080      }
    81       return new DoubleArray(result);
     81      return new RealVector(result);
    8282    }
    8383
     
    9696    /// <param name="parents">An array containing the two real vectors that should be crossed.</param>
    9797    /// <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) {
    9999      if (parents.Length != 2) throw new ArgumentException("HeuristicCrossover: The number of parents is not equal to 2");
    100100
Note: See TracChangeset for help on using the changeset viewer.