Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/19/10 09:32:47 (14 years ago)
Author:
abeham
Message:

fixed doc and exception messages in CX, MPX, and PMX
adapted OX to referenced description
#889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Permutation/3.3/MaximalPreservativeCrossover.cs

    r2830 r2835  
    2929  /// Performs a crossover between two permuation arrays by preserving a large number of edges in both parents.
    3030  /// The operator also maintains the position in the arrays to some extent.
    31   /// It is implemented as described in Mühlenbein, H. 1991. Evolution in time and space - the parallel genetic algorithm. FOUNDATIONS OF GENETIC ALGORITHMS, pp. 316-337. Morgan Kaufmann.
    32   ///
    33   /// The length of the segment copied from the first parent to the offspring is uniformly distributed in the interval [3, N/3) with N = length of the permutation.
     31  /// It is implemented as described in Mühlenbein, H. 1991. Evolution in time and space - the parallel genetic algorithm. FOUNDATIONS OF GENETIC ALGORITHMS, pp. 316-337. Morgan Kaufmann.<br /><br />
     32  /// The length of the segment copied from the first parent to the offspring is uniformly distributed in the interval [3;N/3) with N = length of the permutation.
    3433  /// This recommendation is mentioned in Pohlheim, H. 1999. Evolutionäre Algorithmen: Verfahren, Operatoren und Hinweise für die Praxis, p. 44, Springer.
    3534  /// If the length of the permutation is smaller than 15, the size of the segment is always equal to 3.
     
    4443    /// </summary>
    4544    /// <exception cref="ArgumentException">Thrown when <paramref name="parent1"/> and <paramref name="parent2"/> are not of equal length or when the permutations are shorter than 4 elements.</exception>
    46     /// <exception cref="InvalidOperationException">Thrown if the numbers in the permutation elements are not in the range [0,N) with N = length of the permutation.</exception>
     45    /// <exception cref="InvalidOperationException">Thrown if the numbers in the permutation elements are not in the range [0;N) with N = length of the permutation.</exception>
    4746    /// <remarks>
    4847    /// First one segment is copied from the first parent to the offspring in the same position.
     
    5655    /// <returns>The new permutation resulting from the crossover.</returns>
    5756    public static Permutation Apply(IRandom random, Permutation parent1, Permutation parent2) {
    58       if (parent1.Length != parent2.Length) throw new ArgumentException("MaximalPreservativeCrossover: The parent permutations are of unequal length");
    59       if (parent1.Length < 4) throw new ArgumentException("MaximalPreservativeCrossover: The parent permutation must be at least of size 4");
     57      if (parent1.Length != parent2.Length) throw new ArgumentException("MaximalPreservativeCrossover: The parent permutations are of unequal length.");
     58      if (parent1.Length < 4) throw new ArgumentException("MaximalPreservativeCrossover: The parent permutation must be at least of size 4.");
    6059      int length = parent1.Length;
    6160      int[] result = new int[length];
     
    8685        }
    8786      } catch (IndexOutOfRangeException) {
    88         throw new InvalidOperationException("MaximalPreservativeCrossover: The permutation must consist of consecutive numbers from 0 to N-1 with N = length of the permutation");
     87        throw new InvalidOperationException("MaximalPreservativeCrossover: The permutation must consist of numbers in the interval [0;N) with N = length of the permutation.");
    8988      }
    9089
Note: See TracChangeset for help on using the changeset viewer.