Changeset 2936 for trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/SimulatedBinaryCrossover.cs
- Timestamp:
- 03/05/10 13:14:26 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/SimulatedBinaryCrossover.cs
r2928 r2936 94 94 /// Checks number of parents, availability of the parameters and forwards the call to <see cref="Apply(IRandom, DoubleArrayData, DoubleArrayData, DoubleData)"/>. 95 95 /// </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> 97 97 /// <param name="random">The random number generator.</param> 98 98 /// <param name="parents">The collection of parents (must be of size 2).</param> 99 99 /// <returns>The real vector resulting from the crossover.</returns> 100 100 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"); 102 102 if (ContiguityParameter.ActualValue == null) throw new InvalidOperationException("SimulatedBinaryCrossover: Parameter " + ContiguityParameter.ActualName + " could not be found."); 103 103 return Apply(random, parents[0], parents[1], ContiguityParameter.ActualValue);
Note: See TracChangeset
for help on using the changeset viewer.