Changeset 850 for trunk/sources/HeuristicLab.Permutation/CosaCrossover.cs
- Timestamp:
- 11/28/08 10:32:20 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Permutation/CosaCrossover.cs
r2 r850 27 27 28 28 namespace HeuristicLab.Permutation { 29 /// <summary> 30 /// Performs a cross over permutation between two permutation arrays by taking randomly chosen 31 /// reverse and forward intervals from the first permutation array inserting 32 /// it in the child on different positions depending on the second permutation array. 33 /// </summary> 29 34 public class CosaCrossover : PermutationCrossoverBase { 35 /// <inheritdoc select="summary"/> 30 36 public override string Description { 31 37 get { return @"TODO\r\nOperator description still missing ..."; } 32 38 } 33 39 40 /// <summary> 41 /// Performs a cross over permutation of <paramref name="parent1"/> and <paramref name="parent2"/> 42 /// by taking first the reverse elements of a randomly chosen interval of parent1 43 /// and inserting it in the result at a position specified by the permutation of parent2. 44 /// The remaining elements to be inserted are taken again from parent1 in the forward direction. 45 /// </summary> 46 /// <param name="random">The random number generator.</param> 47 /// <param name="parent1">The parent scope 1 to cross over.</param> 48 /// <param name="parent2">The parent scope 2 to cross over.</param> 49 /// <returns>The created cross over permutation as int array.</returns> 34 50 public static int[] Apply(IRandom random, int[] parent1, int[] parent2) { 35 51 int length = parent1.Length; … … 69 85 } 70 86 87 /// <summary> 88 /// Performs a cross over permutation of <paramref name="parent1"/> and <paramref name="parent2"/> 89 /// by taking first the reverse elements of a randomly chosen interval of parent1 90 /// and inserting it in the result at a position specified by the permutation of parent2. 91 /// The remaining elements to be inserted are taken again from parent1 in the forward direction. 92 /// </summary> 93 /// <remarks>Calls <see cref="Apply"/>.</remarks> 94 /// <param name="scope">The current scope.</param> 95 /// <param name="random">The random number generator.</param> 96 /// <param name="parent1">The parent scope 1 to cross over.</param> 97 /// <param name="parent2">The parent scope 2 to cross over.</param> 98 /// <returns>The created cross over permutation as int array.</returns> 71 99 protected override int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2) { 72 100 return Apply(random, parent1, parent2);
Note: See TracChangeset
for help on using the changeset viewer.