Changeset 2871 for trunk/sources
- Timestamp:
- 02/26/10 13:33:45 (15 years ago)
- 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 26 26 namespace HeuristicLab.Permutation { 27 27 /// <summary> 28 /// Performs a cross over permutation between two permutation arrays by taking28 /// Performs the absolute position topological crossover on two permutation arrays by taking 29 29 /// the entries with the same index (starting at position 0) from both parents 30 30 /// (minding already inserted values). 31 31 /// </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 /> 33 33 /// </remarks> 34 34 /// <example>First take the value at position 0 from parent1 then take the value at position 0 35 35 /// from parent2 if it has not already been inserted, afterwards take the value at position 1 from 36 36 /// 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.")] 40 38 [EmptyStorableClass] 41 39 [Creatable("Test")] 42 40 public class AbsolutePositionTopologicalCrossover : PermutationCrossover { 43 41 /// <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"/> 45 43 /// by taking the values from both parents one by one with the same index starting at position 0. 46 44 /// </summary> … … 77 75 78 76 /// <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)"/>. 80 78 /// </summary> 81 79 /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception> -
trunk/sources/HeuristicLab.Permutation/3.3/CosaCrossover.cs
r2865 r2871 30 30 /// it in the child on different positions depending on the second permutation array. 31 31 /// </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 /> 33 33 /// </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.")] 35 35 [EmptyStorableClass] 36 36 [Creatable("Test")] … … 86 86 87 87 /// <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)"/>. 89 89 /// </summary> 90 90 /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception> … … 93 93 /// <returns>The newly created permutation, resulting from the crossover operation.</returns> 94 94 protected override Permutation Cross(IRandom random, ItemArray<Permutation> parents) { 95 if (parents.Length != 2) throw new InvalidOperationException(" ERROR inCosaCrossover: 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"); 96 96 return Apply(random, parents[0], parents[1]); 97 97 } -
trunk/sources/HeuristicLab.Permutation/3.3/CyclicCrossover.cs
r2854 r2871 31 31 /// The operator first determines all cycles in the permutation and then composes the offspring by alternating between the cycles of the two parents. 32 32 /// </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.")] 34 34 [EmptyStorableClass] 35 35 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/EdgeRecombinationCrossover.cs
r2865 r2871 30 30 /// number of neighbours, the next again a neighbour and so on. 31 31 /// </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 /> 33 34 /// The operator first determines all cycles in the permutation and then composes the offspring by alternating between the cycles of the two parents. 34 35 /// </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.")] 36 37 [EmptyStorableClass] 37 38 [Creatable("Test")] … … 140 141 141 142 /// <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)"/>. 143 144 /// </summary> 144 145 /// <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 83 83 <None Include="HeuristicLabPermutationPlugin.cs.frame" /> 84 84 <Compile Include="AbsolutePositionTopologicalCrossover.cs" /> 85 <Compile Include="CyclicCrossover2.cs" /> 85 86 <Compile Include="IPermutationCreator.cs" /> 86 87 <Compile Include="IPermutationOperator.cs" /> … … 96 97 <Compile Include="MaximalPreservativeCrossover.cs" /> 97 98 <Compile Include="OrderBasedCrossover.cs" /> 99 <Compile Include="OrderCrossover2.cs" /> 98 100 <Compile Include="PartiallyMatchedCrossover.cs" /> 99 101 <Compile Include="PermutationManipulator.cs" /> -
trunk/sources/HeuristicLab.Permutation/3.3/InsertionManipulator.cs
r2865 r2871 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 28 29 /// </summary> 29 30 /// <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. 31 32 /// </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.")] 33 34 [EmptyStorableClass] 34 35 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/InversionManipulator.cs
r2854 r2871 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 30 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.<br /> 31 32 /// </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.")] 33 34 [EmptyStorableClass] 34 35 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/MaximalPreservativeCrossover.cs
r2854 r2871 34 34 /// If the length of the permutation is smaller than 15, the size of the segment is always equal to 3. 35 35 /// </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.")] 37 37 [EmptyStorableClass] 38 38 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/OrderBasedCrossover.cs
r2865 r2871 31 31 /// </summary> 32 32 /// <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, pp332-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. 35 35 /// </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.")] 37 37 [EmptyStorableClass] 38 38 [Creatable("Test")] … … 94 94 95 95 /// <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)"/>. 97 97 /// </summary> 98 98 /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception> -
trunk/sources/HeuristicLab.Permutation/3.3/OrderCrossover.cs
r2854 r2871 34 34 /// in the order they occur. 35 35 /// </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.")] 37 37 [EmptyStorableClass] 38 38 [Creatable("Test")] 39 39 public class OrderCrossover : PermutationCrossover { 40 40 /// <summary> 41 /// Performs anorder crossover of two permutations.41 /// Performs the order crossover of two permutations. 42 42 /// </summary> 43 43 /// <exception cref="ArgumentException">Thrown when <paramref name="parent1"/> and <paramref name="parent2"/> are not of equal length.</exception> … … 85 85 86 86 /// <summary> 87 /// Performs an order crossover of two permutations.87 /// Checks number of parents and calls <see cref="Apply(IRandom, Permutation, Permutation)"/>. 88 88 /// </summary> 89 89 /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception> -
trunk/sources/HeuristicLab.Permutation/3.3/PartiallyMatchedCrossover.cs
r2854 r2871 29 29 /// </summar> 30 30 /// <remarks> 31 /// I mplemented 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. 32 32 /// 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. 33 33 /// as the original source of the operator. 34 34 /// </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.")] 36 36 [EmptyStorableClass] 37 37 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/PositionBasedCrossover.cs
r2854 r2871 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Core; 26 using HeuristicLab.Data;27 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 25 … … 32 29 /// </summary> 33 30 /// <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. 36 32 /// </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.")] 38 34 [EmptyStorableClass] 39 35 [Creatable("Test")] … … 84 80 85 81 /// <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)"/>. 87 83 /// </summary> 88 84 /// <exception cref="InvalidOperationException">Thrown if there are not exactly two parents.</exception> -
trunk/sources/HeuristicLab.Permutation/3.3/ScrambleManipulator.cs
r2854 r2871 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 29 /// </summary> 32 30 /// <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. 35 32 /// </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.")] 37 34 [EmptyStorableClass] 38 35 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/Swap2Manipulator.cs
r2854 r2871 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 29 /// </summary> 32 30 /// /// <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. 34 32 /// </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.")] 36 34 [EmptyStorableClass] 37 35 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/Swap3Manipulator.cs
r2854 r2871 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 30 28 /// Manipulates a permutation array by swaping three randomly chosen elements. 31 29 /// </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.")] 33 35 [EmptyStorableClass] 34 36 [Creatable("Test")] … … 37 39 /// Swaps three randomly chosen elements of the given <paramref name="permutation"/> array. 38 40 /// </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> 39 46 /// <param name="random">The random number generator.</param> 40 47 /// <param name="permutation">The permutation to manipulate.</param> 41 48 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"); 42 50 int index1, index2, index3, temp; 43 51 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); 47 57 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; 67 66 } 68 67 -
trunk/sources/HeuristicLab.Permutation/3.3/Tests/CyclicCrossoverTest.cs
r2867 r2871 122 122 Assert.IsTrue(actual.Validate()); 123 123 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));136 124 137 125 // 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 31 31 <WarningLevel>4</WarningLevel> 32 32 </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> 33 49 <ItemGroup> 34 50 <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> … … 45 61 <Compile Include="Auxiliary.cs" /> 46 62 <Compile Include="CosaCrossoverTest.cs" /> 63 <Compile Include="CyclicCrossover2Test.cs" /> 47 64 <Compile Include="CyclicCrossoverTest.cs" /> 48 65 <Compile Include="EdgeRecombinationCrossoverTest.cs" /> … … 51 68 <Compile Include="MaximalPreservativeCrossoverTest.cs" /> 52 69 <Compile Include="OrderBasedCrossoverTest.cs" /> 70 <Compile Include="OrderCrossover2Test.cs" /> 53 71 <Compile Include="OrderCrossoverTest.cs" /> 54 72 <Compile Include="PartiallyMatchedCrossoverTest.cs" /> -
trunk/sources/HeuristicLab.Permutation/3.3/Tests/OrderCrossoverTest.cs
r2867 r2871 173 173 Assert.IsTrue(actual.Validate()); 174 174 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));187 175 188 176 // perform a test when the two permutations are of unequal length -
trunk/sources/HeuristicLab.Permutation/3.3/TranslocationInversionManipulator.cs
r2854 r2871 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Core; 26 using HeuristicLab.Operators;27 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 25 … … 33 30 /// </summary> 34 31 /// <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. 37 33 /// </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.")] 39 35 [EmptyStorableClass] 40 36 [Creatable("Test")] -
trunk/sources/HeuristicLab.Permutation/3.3/TranslocationManipulator.cs
r2854 r2871 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 32 30 /// </summary> 33 31 /// <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. 35 33 /// </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.")] 37 35 [EmptyStorableClass] 38 36 [Creatable("Test")]
Note: See TracChangeset
for help on using the changeset viewer.