Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2871


Ignore:
Timestamp:
02/26/10 13:33:45 (14 years ago)
Author:
abeham
Message:

readded references to operator descriptions and updated documentation
added OrderCrossover2 to implement the behavior described in our book (this was the behavior of the former OrderCrossover)
added CyclicCrossover2 to implement the behavior described in our book (this was the behavior of the former CyclicCrossover)
implemented unit tests for the new variants
#889

Location:
trunk/sources/HeuristicLab.Permutation/3.3
Files:
4 added
20 edited

Legend:

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

    r2865 r2871  
    2626namespace HeuristicLab.Permutation {
    2727  /// <summary>
    28   /// Performs a cross over permutation between two permutation arrays by taking
     28  /// Performs the absolute position topological crossover on two permutation arrays by taking
    2929  /// the entries with the same index (starting at position 0) from both parents
    3030  /// (minding already inserted values).
    3131  /// </summary>
    32   /// <remarks>It is implemented as described in Moraglio, A. and Poli, R. 2005. Topological crossover for the permutation representation. In Proceedings of the 2005 Workshops on Genetic and Evolutionary Computation.<br />
     32  /// <remarks>It is implemented as described in Moraglio, A. and Poli, R. 2005. Topological crossover for the permutation representation. In Proceedings of the 2005 Workshops on Genetic and Evolutionary Computation. pp. 332-338.<br />
    3333  /// </remarks>
    3434  /// <example>First take the value at position 0 from parent1 then take the value at position 0
    3535  /// from parent2 if it has not already been inserted, afterwards take the value at position 1 from
    3636  /// parent1 if it has not already been inserted, then from parent2 and so on.</example>
    37   [Item("AbsolutePositionTopologicalCrossover", @"An operator which performs a cross over permutation between two permutation arrays by taking the
    38 entries with the same index (starting at position 0) from both parents
    39 (minding already inserted values).")]
     37  [Item("AbsolutePositionTopologicalCrossover", "An operator which performs a cross over permutation between two permutation arrays by taking the entries with the same index (starting at position 0) from both parents (minding already inserted values). It is implemented as described in Moraglio, A. and Poli, R. 2005. Topological crossover for the permutation representation. In Proceedings of the 2005 Workshops on Genetic and Evolutionary Computation. pp. 332-338.")]
    4038  [EmptyStorableClass]
    4139  [Creatable("Test")]
    4240  public class AbsolutePositionTopologicalCrossover : PermutationCrossover {
    4341    /// <summary>
    44     /// Performs a cross over permutation of <paramref name="parent1"/> and <paramref name="parent2"/>
     42    /// Performs the absolute position topological crossover on <paramref name="parent1"/> and <paramref name="parent2"/>
    4543    /// by taking the values from both parents one by one with the same index starting at position 0.
    4644    /// </summary>
     
    7775
    7876    /// <summary>
    79     /// Performs an absolute position topological crossover operation for two given parent permutations.
     77    /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>.
    8078    /// </summary>
    8179    /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception>
  • trunk/sources/HeuristicLab.Permutation/3.3/CosaCrossover.cs

    r2865 r2871  
    3030  /// it in the child on different positions depending on the second permutation array.
    3131  /// </summary>
    32   /// <remarks>It is implemented as described in Wendt, O. 1994. COSA: COoperative Simulated Annealing - Integration von Genetischen Algorithmen und Simulated Annealing am Beispiel der Tourenplanung. Dissertation Thesis.<br />
     32  /// <remarks>It is implemented as described in Wendt, O. 1994. COSA: COoperative Simulated Annealing - Integration von Genetischen Algorithmen und Simulated Annealing am Beispiel der Tourenplanung. Dissertation Thesis. IWI Frankfurt.<br />
    3333  /// </remarks>
    34   [Item("CosaCrossover", "An operator which performs a crossover operation between two permutation arrays by taking randomly chosen reverse and forward intervals from the first permutation array inserting it in the child on different positions depending on the second permutation array.")]
     34  [Item("CosaCrossover", "An operator which performs a crossover operation between two permutation arrays by taking randomly chosen reverse and forward intervals from the first permutation array inserting it in the child on different positions depending on the second permutation array. It is implemented as described in Wendt, O. 1994. COSA: COoperative Simulated Annealing - Integration von Genetischen Algorithmen und Simulated Annealing am Beispiel der Tourenplanung. Dissertation Thesis. IWI Frankfurt.")]
    3535  [EmptyStorableClass]
    3636  [Creatable("Test")]
     
    8686
    8787    /// <summary>
    88     /// Performs a COSA crossover operation for two given parent permutations.
     88    /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>.
    8989    /// </summary>
    9090    /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception>
     
    9393    /// <returns>The newly created permutation, resulting from the crossover operation.</returns>
    9494    protected override Permutation Cross(IRandom random, ItemArray<Permutation> parents) {
    95       if (parents.Length != 2) throw new InvalidOperationException("ERROR in CosaCrossover: The number of parents is not equal to 2");
     95      if (parents.Length != 2) throw new InvalidOperationException("CosaCrossover: The number of parents is not equal to 2");
    9696      return Apply(random, parents[0], parents[1]);
    9797    }
  • trunk/sources/HeuristicLab.Permutation/3.3/CyclicCrossover.cs

    r2854 r2871  
    3131  /// The operator first determines all cycles in the permutation and then composes the offspring by alternating between the cycles of the two parents.
    3232  /// </remarks>
    33   [Item("CyclicCrossover", "An operator which performs the cyclic crossover on two permutations.")]
     33  [Item("CyclicCrossover", "An operator which performs the cyclic crossover on two permutations. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
    3434  [EmptyStorableClass]
    3535  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/EdgeRecombinationCrossover.cs

    r2865 r2871  
    3030  /// number of neighbours, the next again a neighbour and so on.
    3131  /// </summary>
    32   ///   /// <remarks>It is implemented as described in Whitley et.al. 1991, The Traveling Salesman and Sequence Scheduling, in Davis, L. (Ed.), Handbook ov Genetic Algorithms, New York, pp. 350-372<br />
     32  /// <remarks>
     33  /// It is implemented as described in Whitley et.al. 1991, The Traveling Salesman and Sequence Scheduling, in Davis, L. (Ed.), Handbook ov Genetic Algorithms, New York, pp. 350-372.<br />
    3334  /// The operator first determines all cycles in the permutation and then composes the offspring by alternating between the cycles of the two parents.
    3435  /// </remarks>
    35   [Item("EdgeRecombinationCrossover", "An operator which performs the edge recombination crossover on two permutations.")]
     36  [Item("EdgeRecombinationCrossover", "An operator which performs the edge recombination crossover on two permutations. It is implemented as described in Whitley et.al. 1991, The Traveling Salesman and Sequence Scheduling, in Davis, L. (Ed.), Handbook ov Genetic Algorithms, New York, pp. 350-372.")]
    3637  [EmptyStorableClass]
    3738  [Creatable("Test")]
     
    140141
    141142    /// <summary>
    142     /// Performs an edge recombination crossover operation for two given parent permutations.
     143    /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>.
    143144    /// </summary>
    144145    /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception>
  • trunk/sources/HeuristicLab.Permutation/3.3/HeuristicLab.Permutation-3.3.csproj

    r2865 r2871  
    8383    <None Include="HeuristicLabPermutationPlugin.cs.frame" />
    8484    <Compile Include="AbsolutePositionTopologicalCrossover.cs" />
     85    <Compile Include="CyclicCrossover2.cs" />
    8586    <Compile Include="IPermutationCreator.cs" />
    8687    <Compile Include="IPermutationOperator.cs" />
     
    9697    <Compile Include="MaximalPreservativeCrossover.cs" />
    9798    <Compile Include="OrderBasedCrossover.cs" />
     99    <Compile Include="OrderCrossover2.cs" />
    98100    <Compile Include="PartiallyMatchedCrossover.cs" />
    99101    <Compile Include="PermutationManipulator.cs" />
  • trunk/sources/HeuristicLab.Permutation/3.3/InsertionManipulator.cs

    r2865 r2871  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    2829  /// </summary>
    2930  /// <remarks>
    30   /// It is implemented as described in Fogel, D.B. (1988). An Evolutionary Approach to the Traveling Salesman Problem, Biological Cybernetics, 60, pp. 139-144
     31  /// It is implemented as described in Fogel, D.B. (1988). An Evolutionary Approach to the Traveling Salesman Problem, Biological Cybernetics, 60, pp. 139-144.
    3132  /// </remarks>
    32   [Item("InsertionManipulator", "An operator which moves randomly one element to another position in the permutation.")]
     33  [Item("InsertionManipulator", "An operator which moves randomly one element to another position in the permutation. It is implemented as described in Fogel, D.B. (1988). An Evolutionary Approach to the Traveling Salesman Problem, Biological Cybernetics, 60, pp. 139-144.")]
    3334  [EmptyStorableClass]
    3435  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/InversionManipulator.cs

    r2854 r2871  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3031  /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.<br />
    3132  /// </remarks>
    32   [Item("InversionManipulator", "An operator which inverts a randomly chosen part of a permutation.")]
     33  [Item("InversionManipulator", "An operator which inverts a randomly chosen part of a permutation. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
    3334  [EmptyStorableClass]
    3435  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/MaximalPreservativeCrossover.cs

    r2854 r2871  
    3434  /// If the length of the permutation is smaller than 15, the size of the segment is always equal to 3.
    3535  /// </remarks>
    36   [Item("MaximalPreservativeCrossover", "An operator which performs the maximal preservative crossover on two permutations.")]
     36  [Item("MaximalPreservativeCrossover", "An operator which performs the maximal preservative crossover on two permutations. 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.")]
    3737  [EmptyStorableClass]
    3838  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/OrderBasedCrossover.cs

    r2865 r2871  
    3131  /// </summary>
    3232  /// <remarks>
    33   /// Implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms,
    34   /// in Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.
     33  /// This is in some papers also called Order Crossover #2.<br />
     34  /// It is implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms. In Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp. 332-349.
    3535  /// </remarks>
    36   [Item("OrderBasedCrossover", "An operator which performs an order based crossover of two permutations.")]
     36  [Item("OrderBasedCrossover", "An operator which performs an order based crossover of two permutations. It is implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms. In Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp. 332-349.")]
    3737  [EmptyStorableClass]
    3838  [Creatable("Test")]
     
    9494
    9595    /// <summary>
    96     /// Performs an order-based crossover operation for two given parent permutations.
     96    /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>.
    9797    /// </summary>
    9898    /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception>
  • trunk/sources/HeuristicLab.Permutation/3.3/OrderCrossover.cs

    r2854 r2871  
    3434  /// in the order they occur.
    3535  /// </remarks>
    36   [Item("OrderCrossover", "An operator which performs an order crossover of two permutations.")]
     36  [Item("OrderCrossover", "An operator which performs an order crossover of two permutations. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
    3737  [EmptyStorableClass]
    3838  [Creatable("Test")]
    3939  public class OrderCrossover : PermutationCrossover {
    4040    /// <summary>
    41     /// Performs an order crossover of two permutations.
     41    /// Performs the order crossover of two permutations.
    4242    /// </summary>
    4343    /// <exception cref="ArgumentException">Thrown when <paramref name="parent1"/> and <paramref name="parent2"/> are not of equal length.</exception>
     
    8585
    8686    /// <summary>
    87     /// Performs an order crossover of two permutations.
     87    /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>.
    8888    /// </summary>
    8989    /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception>
  • trunk/sources/HeuristicLab.Permutation/3.3/PartiallyMatchedCrossover.cs

    r2854 r2871  
    2929  /// </summar>
    3030  /// <remarks>
    31   /// Implemented as described in Fogel, D.B. 1988. An Evolutionary Approach to the Traveling Salesman Problem. Biological Cybernetics, 60, pp. 139-144, Springer-Verlag.
     31  /// It is implemented as described in Fogel, D.B. 1988. An Evolutionary Approach to the Traveling Salesman Problem. Biological Cybernetics, 60, pp. 139-144, Springer-Verlag.
    3232  /// which references Goldberg, D.E., and Lingle, R. 1985. Alleles, loci, and the traveling salesman problem. Proceedings of an International Conference on Genetic Algorithms and their Applications. Carnegie-Mellon University, pp. 154-159.
    3333  /// as the original source of the operator.
    3434  /// </remarks>
    35   [Item("PartiallyMatchedCrossover", "An operator which performs the partially matched crossover on two permutations.")]
     35  [Item("PartiallyMatchedCrossover", "An operator which performs the partially matched crossover on two permutations. It is implemented as described in Fogel, D.B. 1988. An Evolutionary Approach to the Traveling Salesman Problem. Biological Cybernetics, 60, pp. 139-144, Springer-Verlag.")]
    3636  [EmptyStorableClass]
    3737  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/PositionBasedCrossover.cs

    r2854 r2871  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Core;
    26 using HeuristicLab.Data;
    2724using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2825
     
    3229  /// </summary>
    3330  /// <remarks>
    34   /// Implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms,
    35   /// in Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.
     31  /// It is implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms. In Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.
    3632  /// </remarks>
    37   [Item("PositionBasedCrossover", "An operator which performs the position based crossover on two permutations.")]
     33  [Item("PositionBasedCrossover", "An operator which performs the position based crossover on two permutations. It is implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms. In Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.")]
    3834  [EmptyStorableClass]
    3935  [Creatable("Test")]
     
    8480
    8581    /// <summary>
    86     /// Performs a position-based crossover operation for two given parent permutations.
     82    /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>.
    8783    /// </summary>
    8884    /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception>
  • trunk/sources/HeuristicLab.Permutation/3.3/ScrambleManipulator.cs

    r2854 r2871  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3129  /// </summary>
    3230  /// <remarks>
    33   /// Implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms,
    34   /// in Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.
     31  /// It is implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms. In Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.
    3532  /// </remarks>
    36   [Item("ScrambleManipulator", "An operator which manipulates a permutation array by randomly scrambling the elements in a randomly chosen interval.")]
     33  [Item("ScrambleManipulator", "An operator which manipulates a permutation array by randomly scrambling the elements in a randomly chosen interval. It is implemented as described in Syswerda, G. (1991). Schedule Optimization Using Genetic Algorithms. In Davis, L. (Ed.) Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York, pp 332-349.")]
    3734  [EmptyStorableClass]
    3835  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/Swap2Manipulator.cs

    r2854 r2871  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3129  /// </summary>
    3230  ///   /// <remarks>
    33   /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.<br />
     31  /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.
    3432  /// </remarks>
    35   [Item("Swap2Manipulator", "An operator which manipulates a permutation array by swapping to randomly chosen elements.")]
     33  [Item("Swap2Manipulator", "An operator which manipulates a permutation array by swapping to randomly chosen elements. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
    3634  [EmptyStorableClass]
    3735  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/Swap3Manipulator.cs

    r2854 r2871  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3028  /// Manipulates a permutation array by swaping three randomly chosen elements.
    3129  /// </summary>
    32   [Item("Swap3Manipulator", "An operator which manipulates a permutation array by swaping three randomly chosen elements.")]
     30  /// <remarks>
     31  /// It is implemented such that first 3 positions are randomly chosen in the interval [0;N) with N = length of the permutation with all positions being distinct from each other.
     32  /// Then position 1 is put in place of position 3, position 2 is put in place of position 1 and position 3 is put in place of position 2.
     33  /// </remarks>
     34  [Item("Swap3Manipulator", "An operator which manipulates a permutation array by swaping three randomly chosen elements. It is implemented such that first 3 positions are randomly chosen in the interval [0;N) with N = length of the permutation with all positions being distinct from each other. Then position 1 is put in place of position 3, position 2 is put in place of position 1 and position 3 is put in place of position 2.")]
    3335  [EmptyStorableClass]
    3436  [Creatable("Test")]
     
    3739    /// Swaps three randomly chosen elements of the given <paramref name="permutation"/> array.
    3840    /// </summary>
     41    /// <exception cref="ArgumentException">Thrown when the <paramref name="permutation"/> contains less than 3 elements.</exception>
     42    /// <remarks>
     43    /// It is implemented such that first 3 positions are randomly chosen in the interval [0;N) with N = length of the permutation with all positions being distinct from each other.
     44    /// Then position 1 is put in place of position 3, position 2 is put in place of position 1 and position 3 is put in place of position 2.
     45    /// </remarks>
    3946    /// <param name="random">The random number generator.</param>
    4047    /// <param name="permutation">The permutation to manipulate.</param>
    4148    public static void Apply(IRandom random, Permutation permutation) {
     49      if (permutation.Length < 3) throw new ArgumentException("Swap3Manipulator: The permutation must be at least of size 3.", "permutation");
    4250      int index1, index2, index3, temp;
    4351
    44       index1 = random.Next(permutation.Length);
    45       index2 = random.Next(permutation.Length);
    46       index3 = random.Next(permutation.Length);
     52      do {
     53        index1 = random.Next(permutation.Length);
     54        index2 = random.Next(permutation.Length);
     55        index3 = random.Next(permutation.Length);
     56      } while (index1 == index2 || index2 == index3 || index1 == index3);
    4757
    48       if (random.NextDouble() < 0.5) {
    49         // swap edges 1 and 2
    50         temp = permutation[index1];
    51         permutation[index1] = permutation[index2];
    52         permutation[index2] = temp;
    53         // swap edges 2 and 3
    54         temp = permutation[index2];
    55         permutation[index2] = permutation[index3];
    56         permutation[index3] = temp;
    57       } else {
    58         // swap edges 1 and 3
    59         temp = permutation[index1];
    60         permutation[index1] = permutation[index3];
    61         permutation[index3] = temp;
    62         // swap edges 2 and 3
    63         temp = permutation[index2];
    64         permutation[index2] = permutation[index3];
    65         permutation[index3] = temp;
    66       }
     58      // swap positions 1 and 2
     59      temp = permutation[index1];
     60      permutation[index1] = permutation[index2];
     61      permutation[index2] = temp;
     62      // swap positions 2 and 3
     63      temp = permutation[index2];
     64      permutation[index2] = permutation[index3];
     65      permutation[index3] = temp;
    6766    }
    6867
  • trunk/sources/HeuristicLab.Permutation/3.3/Tests/CyclicCrossoverTest.cs

    r2867 r2871  
    122122      Assert.IsTrue(actual.Validate());
    123123      Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual));
    124       // The following test is based on an example from Affenzeller, M. et al. 2009. Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications. CRC Press. pp. 134.
    125       random.Reset();
    126       random.DoubleNumbers = new double[] { 0.9 };
    127       parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
    128       Assert.IsTrue(parent1.Validate());
    129       parent2 = new Permutation(new int[] { 2, 5, 6, 0, 7, 1, 3, 8, 4, 9 });
    130       Assert.IsTrue(parent2.Validate());
    131       expected = new Permutation(new int[] { 0, 5, 2, 3, 7, 1, 6, 8, 4, 9 });
    132       Assert.IsTrue(expected.Validate());
    133       actual = CyclicCrossover.Apply(random, parent1, parent2);
    134       Assert.IsTrue(actual.Validate());
    135       Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual));
    136124
    137125      // perform a test when the two permutations are of unequal length
  • trunk/sources/HeuristicLab.Permutation/3.3/Tests/HeuristicLab.Permutation-3.3.Tests.csproj

    r2857 r2871  
    3131    <WarningLevel>4</WarningLevel>
    3232  </PropertyGroup>
     33  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     34    <DebugSymbols>true</DebugSymbols>
     35    <OutputPath>bin\x86\Debug\</OutputPath>
     36    <DefineConstants>DEBUG;TRACE</DefineConstants>
     37    <DebugType>full</DebugType>
     38    <PlatformTarget>x86</PlatformTarget>
     39    <ErrorReport>prompt</ErrorReport>
     40  </PropertyGroup>
     41  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     42    <OutputPath>bin\x86\Release\</OutputPath>
     43    <DefineConstants>TRACE</DefineConstants>
     44    <Optimize>true</Optimize>
     45    <DebugType>pdbonly</DebugType>
     46    <PlatformTarget>x86</PlatformTarget>
     47    <ErrorReport>prompt</ErrorReport>
     48  </PropertyGroup>
    3349  <ItemGroup>
    3450    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
     
    4561    <Compile Include="Auxiliary.cs" />
    4662    <Compile Include="CosaCrossoverTest.cs" />
     63    <Compile Include="CyclicCrossover2Test.cs" />
    4764    <Compile Include="CyclicCrossoverTest.cs" />
    4865    <Compile Include="EdgeRecombinationCrossoverTest.cs" />
     
    5168    <Compile Include="MaximalPreservativeCrossoverTest.cs" />
    5269    <Compile Include="OrderBasedCrossoverTest.cs" />
     70    <Compile Include="OrderCrossover2Test.cs" />
    5371    <Compile Include="OrderCrossoverTest.cs" />
    5472    <Compile Include="PartiallyMatchedCrossoverTest.cs" />
  • trunk/sources/HeuristicLab.Permutation/3.3/Tests/OrderCrossoverTest.cs

    r2867 r2871  
    173173      Assert.IsTrue(actual.Validate());
    174174      Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual));
    175       // The following test is based on an example from Affenzeller, M. et al. 2009. Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications. CRC Press. p. 135.
    176       random.Reset();
    177       random.IntNumbers = new int[] { 2, 5 };
    178       parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
    179       Assert.IsTrue(parent1.Validate());
    180       parent2 = new Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 });
    181       Assert.IsTrue(parent2.Validate());
    182       expected = new Permutation(new int[] { 2, 0, 9, 1, 3, 5, 6, 7, 8, 4 });
    183       Assert.IsTrue(expected.Validate());
    184       actual = OrderCrossover.Apply(random, parent1, parent2);
    185       Assert.IsTrue(actual.Validate());
    186       Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual));
    187175
    188176      // perform a test when the two permutations are of unequal length
  • trunk/sources/HeuristicLab.Permutation/3.3/TranslocationInversionManipulator.cs

    r2854 r2871  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Core;
    26 using HeuristicLab.Operators;
    2724using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2825
     
    3330  /// </summary>
    3431  /// <remarks>
    35   /// It is implemented as described in Fogel, D.B. (1993). Applying Evolutionary Programming to Selected TSP Problems,
    36   /// Cybernetics and Systems, 22, pp 27-36.<br />
     32  /// It is implemented as described in Fogel, D.B. 1993. Applying Evolutionary Programming to Selected TSP Problems, Cybernetics and Systems, 22, pp 27-36.
    3733  /// </remarks>
    38   [Item("TranslocationInversionManipulator", "An operator which inverts a randomly chosen part of a permutation and inserts it at a random position.")]
     34  [Item("TranslocationInversionManipulator", "An operator which inverts a randomly chosen part of a permutation and inserts it at a random position. It is implemented as described in Fogel, D.B. 1993. Applying Evolutionary Programming to Selected TSP Problems, Cybernetics and Systems, 22, pp. 27-36.")]
    3935  [EmptyStorableClass]
    4036  [Creatable("Test")]
  • trunk/sources/HeuristicLab.Permutation/3.3/TranslocationManipulator.cs

    r2854 r2871  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3230  /// </summary>
    3331  /// <remarks>
    34   /// It is implemented as described in Michalewicz, Z. (1992), Genetic Algorithms ü Data Structures = Evolution Programs, Springer Verlag, Berlin Heidelberg.<br />
     32  /// It is implemented as described in Michalewicz, Z. 1992. Genetic Algorithms + Data Structures = Evolution Programs, Springer Verlag, Berlin Heidelberg.
    3533  /// </remarks>
    36   [Item("TranslocationManipulator", "An operator which Manipulates a permutation array by moving a randomly chosen interval of elements to another (randomly chosen) position in the array.")]
     34  [Item("TranslocationManipulator", "An operator which Manipulates a permutation array by moving a randomly chosen interval of elements to another (randomly chosen) position in the array. It is implemented as described in Michalewicz, Z. 1992. Genetic Algorithms + Data Structures = Evolution Programs, Springer Verlag, Berlin Heidelberg.")]
    3735  [EmptyStorableClass]
    3836  [Creatable("Test")]
Note: See TracChangeset for help on using the changeset viewer.