Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/10 13:14:26 (14 years ago)
Author:
svonolfe
Message:

Added heuristic, local, random convex crossover and added some initial unit tests for all RealVector operators (#890)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/SimulatedBinaryCrossover.cs

    r2928 r2936  
    9494    /// Checks number of parents, availability of the parameters and forwards the call to <see cref="Apply(IRandom, DoubleArrayData, DoubleArrayData, DoubleData)"/>.
    9595    /// </summary>
    96     /// <exception cref="InvalidOperationException">Thrown when there are not exactly 2 parents or when the contiguity parameter could not be found.</exception>
     96    /// <exception cref="ArgumentException">Thrown when there are not exactly 2 parents or when the contiguity parameter could not be found.</exception>
    9797    /// <param name="random">The random number generator.</param>
    9898    /// <param name="parents">The collection of parents (must be of size 2).</param>
    9999    /// <returns>The real vector resulting from the crossover.</returns>
    100100    protected override DoubleArrayData Cross(IRandom random, ItemArray<DoubleArrayData> parents) {
    101       if (parents.Length != 2) throw new InvalidOperationException("SimulatedBinaryCrossover: The number of parents is not equal to 2");
     101      if (parents.Length != 2) throw new ArgumentException("SimulatedBinaryCrossover: The number of parents is not equal to 2");
    102102      if (ContiguityParameter.ActualValue == null) throw new InvalidOperationException("SimulatedBinaryCrossover: Parameter " + ContiguityParameter.ActualName + " could not be found.");
    103103      return Apply(random, parents[0], parents[1], ContiguityParameter.ActualValue);
Note: See TracChangeset for help on using the changeset viewer.