- Timestamp:
- 03/16/10 00:56:44 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3
- Files:
-
- 22 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 HeuristicLabEncodingsPermutation Plugin.cs4 HeuristicLabEncodingsPermutationEncodingPlugin.cs
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Auxiliary.cs
r2930 r3053 20 20 #endregion 21 21 22 using HeuristicLab.Encodings.Permutation ;22 using HeuristicLab.Encodings.PermutationEncoding; 23 23 24 namespace HeuristicLab.Encodings.Permutation _33.Tests {24 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 25 25 public static class Auxiliary { 26 public static bool PermutationIsEqualByPosition(Permutation .Permutation p1, Permutation.Permutation p2) {26 public static bool PermutationIsEqualByPosition(Permutation p1, Permutation p2) { 27 27 bool equal = (p1.Length == p2.Length); 28 28 if (equal) { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CosaCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for CosaCrossoverTest and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } catch (System.InvalidOperationException) { 97 97 exceptionFired = true; … … 106 106 public void CosaCrossoverApplyTest() { 107 107 TestRandom random = new TestRandom(); 108 Permutation .Permutationparent1, parent2, expected, actual;108 Permutation parent1, parent2, expected, actual; 109 109 // The following test is based on an example from Wendt, O. 1994. COSA: COoperative Simulated Annealing - Integration von Genetischen Algorithmen und Simulated Annealing am Beispiel der Tourenplanung. Dissertation Thesis. IWI Frankfurt. 110 110 random.Reset(); 111 111 random.IntNumbers = new int[] { 1 }; 112 parent1 = new Permutation .Permutation(new int[] { 0, 1, 5, 2, 4, 3 });112 parent1 = new Permutation(new int[] { 0, 1, 5, 2, 4, 3 }); 113 113 Assert.IsTrue(parent1.Validate()); 114 parent2 = new Permutation .Permutation(new int[] { 3, 0, 2, 1, 4, 5 });114 parent2 = new Permutation(new int[] { 3, 0, 2, 1, 4, 5 }); 115 115 Assert.IsTrue(parent2.Validate()); 116 expected = new Permutation .Permutation(new int[] { 0, 1, 4, 2, 5, 3 });116 expected = new Permutation(new int[] { 0, 1, 4, 2, 5, 3 }); 117 117 Assert.IsTrue(expected.Validate()); 118 118 actual = CosaCrossover.Apply(random, parent1, parent2); … … 122 122 random.Reset(); 123 123 random.IntNumbers = new int[] { 4 }; 124 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });124 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 125 125 Assert.IsTrue(parent1.Validate()); 126 parent2 = new Permutation .Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });126 parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 127 127 Assert.IsTrue(parent2.Validate()); 128 expected = new Permutation .Permutation(new int[] { 7, 6, 5, 3, 4, 2, 1, 0 });128 expected = new Permutation(new int[] { 7, 6, 5, 3, 4, 2, 1, 0 }); 129 129 Assert.IsTrue(expected.Validate()); 130 130 actual = CosaCrossover.Apply(random, parent1, parent2); … … 134 134 random.Reset(); 135 135 random.IntNumbers = new int[] { 5 }; 136 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });136 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); 137 137 Assert.IsTrue(parent1.Validate()); 138 parent2 = new Permutation .Permutation(new int[] { 4, 3, 5, 1, 0, 9, 7, 2, 8, 6 });138 parent2 = new Permutation(new int[] { 4, 3, 5, 1, 0, 9, 7, 2, 8, 6 }); 139 139 Assert.IsTrue(parent2.Validate()); 140 expected = new Permutation .Permutation(new int[] { 7, 6, 2, 3, 4, 5, 1, 0, 9, 8 });140 expected = new Permutation(new int[] { 7, 6, 2, 3, 4, 5, 1, 0, 9, 8 }); 141 141 Assert.IsTrue(expected.Validate()); 142 142 actual = CosaCrossover.Apply(random, parent1, parent2); … … 148 148 bool exceptionFired = false; 149 149 try { 150 CosaCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));150 CosaCrossover.Apply(random, new Permutation(8), new Permutation(6)); 151 151 } catch (System.ArgumentException) { 152 152 exceptionFired = true; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CyclicCrossover2Test.cs
r2930 r3053 1 1 using HeuristicLab.Core; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 using HeuristicLab.Encodings.Permutation ;3 using HeuristicLab.Encodings.PermutationEncoding; 4 4 5 namespace HeuristicLab.Encodings.Permutation _33.Tests {5 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 6 6 /// <summary> 7 7 ///This is a test class for CyclicCrossover2Test and is intended … … 70 70 bool exceptionFired = false; 71 71 try { 72 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {73 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));72 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 73 new Permutation(4), new Permutation(4), new Permutation(4)})); 74 74 } catch (System.InvalidOperationException) { 75 75 exceptionFired = true; … … 84 84 public void CyclicCrossover2ApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent1, parent2, expected, actual;86 Permutation parent1, parent2, expected, actual; 87 87 // 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. 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 0 }; 90 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });90 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); 91 91 Assert.IsTrue(parent1.Validate()); 92 parent2 = new Permutation .Permutation(new int[] { 2, 5, 6, 0, 7, 1, 3, 8, 4, 9 });92 parent2 = new Permutation(new int[] { 2, 5, 6, 0, 7, 1, 3, 8, 4, 9 }); 93 93 Assert.IsTrue(parent2.Validate()); 94 expected = new Permutation .Permutation(new int[] { 0, 5, 2, 3, 7, 1, 6, 8, 4, 9 });94 expected = new Permutation(new int[] { 0, 5, 2, 3, 7, 1, 6, 8, 4, 9 }); 95 95 Assert.IsTrue(expected.Validate()); 96 96 actual = CyclicCrossover2.Apply(random, parent1, parent2); … … 102 102 bool exceptionFired = false; 103 103 try { 104 CyclicCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));104 CyclicCrossover.Apply(random, new Permutation(8), new Permutation(6)); 105 105 } catch (System.ArgumentException) { 106 106 exceptionFired = true; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CyclicCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for CyclicCrossover and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } 97 97 catch (System.InvalidOperationException) { … … 107 107 public void CyclicCrossoverApplyTest() { 108 108 TestRandom random = new TestRandom(); 109 Permutation .Permutationparent1, parent2, expected, actual;109 Permutation parent1, parent2, expected, actual; 110 110 // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13 111 111 random.Reset(); 112 112 random.DoubleNumbers = new double[] { 0.9 }; 113 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });113 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 114 114 Assert.IsTrue(parent1.Validate()); 115 parent2 = new Permutation .Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });115 parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 116 116 Assert.IsTrue(parent2.Validate()); 117 expected = new Permutation .Permutation(new int[] { 0, 1, 5, 3, 6, 4, 2, 7 });117 expected = new Permutation(new int[] { 0, 1, 5, 3, 6, 4, 2, 7 }); 118 118 Assert.IsTrue(expected.Validate()); 119 119 actual = CyclicCrossover.Apply(random, parent1, parent2); … … 125 125 bool exceptionFired = false; 126 126 try { 127 CyclicCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));127 CyclicCrossover.Apply(random, new Permutation(8), new Permutation(6)); 128 128 } 129 129 catch (System.ArgumentException) { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/EdgeRecombinationCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for EdgeRecombinationCrossover and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } 97 97 catch (System.InvalidOperationException) { … … 107 107 public void EdgeRecombinationCrossoverApplyTest() { 108 108 TestRandom random = new TestRandom(); 109 Permutation .Permutationparent1, parent2, expected, actual;109 Permutation parent1, parent2, expected, actual; 110 110 // The following test is based on an example from Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, pp. 54-55 111 111 random.Reset(); 112 112 random.IntNumbers = new int[] { 0 }; 113 113 random.DoubleNumbers = new double[] { 0.5, 0, 0, 0 }; 114 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });114 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 115 115 Assert.IsTrue(parent1.Validate()); 116 parent2 = new Permutation .Permutation(new int[] { 8, 2, 6, 7, 1, 5, 4, 0, 3 });116 parent2 = new Permutation(new int[] { 8, 2, 6, 7, 1, 5, 4, 0, 3 }); 117 117 Assert.IsTrue(parent2.Validate()); 118 expected = new Permutation .Permutation(new int[] { 0, 4, 5, 1, 7, 6, 2, 8, 3 });118 expected = new Permutation(new int[] { 0, 4, 5, 1, 7, 6, 2, 8, 3 }); 119 119 Assert.IsTrue(expected.Validate()); 120 120 actual = EdgeRecombinationCrossover.Apply(random, parent1, parent2); … … 126 126 bool exceptionFired = false; 127 127 try { 128 EdgeRecombinationCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));128 EdgeRecombinationCrossover.Apply(random, new Permutation(8), new Permutation(6)); 129 129 } 130 130 catch (System.ArgumentException) { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/HeuristicLab.Encodings.PermutationEncoding-3.3.Tests.csproj
r3052 r3053 5 5 <ProductVersion>9.0.30729</ProductVersion> 6 6 <SchemaVersion>2.0</SchemaVersion> 7 <ProjectGuid>{ 4D59BEC9-A69E-4686-B8C9-0E6C073B093E}</ProjectGuid>7 <ProjectGuid>{13CA37D6-4111-4E7B-BE2E-AF3DE462D384}</ProjectGuid> 8 8 <OutputType>Library</OutputType> 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 <RootNamespace>HeuristicLab.Encodings.Permutation _33.Tests</RootNamespace>11 <AssemblyName>HeuristicLab.Encodings.Permutation -3.3.Tests</AssemblyName>10 <RootNamespace>HeuristicLab.Encodings.PermutationEncoding_33.Tests</RootNamespace> 11 <AssemblyName>HeuristicLab.Encodings.PermutationEncoding-3.3.Tests</AssemblyName> 12 12 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> … … 135 135 <Name>HeuristicLab.PluginInfrastructure</Name> 136 136 </ProjectReference> 137 <ProjectReference Include="..\HeuristicLab.Encodings.Permutation -3.3.csproj">138 <Project>{ 00282156-589D-424F-9CE4-A8038636C926}</Project>139 <Name>HeuristicLab.Encodings.Permutation -3.3</Name>137 <ProjectReference Include="..\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj"> 138 <Project>{DBECB8B0-B166-4133-BAF1-ED67C3FD7FCA}</Project> 139 <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name> 140 140 </ProjectReference> 141 141 </ItemGroup> -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/InsertionManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for InsertionManipulator and is intended … … 84 84 public void InsertionManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 3, 6 }; 90 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });90 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 expected = new Permutation .Permutation(new int[] { 0, 1, 2, 4, 5, 6, 3, 7 });93 expected = new Permutation(new int[] { 0, 1, 2, 4, 5, 6, 3, 7 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 InsertionManipulator.Apply(random, parent); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/InversionManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for InversionManipulator and is intended … … 84 84 public void InversionManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // The following test is based on an example from Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, pp. 46-47 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 1, 4 }; 90 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });90 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 expected = new Permutation .Permutation(new int[] { 0, 4, 3, 2, 1, 5, 6, 7, 8 });93 expected = new Permutation(new int[] { 0, 4, 3, 2, 1, 5, 6, 7, 8 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 InversionManipulator.Apply(random, parent); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/MaximalPreservativeCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for MaximalPreservativeCrossover and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } 97 97 catch (System.InvalidOperationException) { … … 107 107 public void MaximalPreservativeCrossoverApplyTest() { 108 108 TestRandom random = new TestRandom(); 109 Permutation .Permutationparent1, parent2, expected, actual;109 Permutation parent1, parent2, expected, actual; 110 110 // The following test is based on an example from Larranaga, 1999. Genetic Algorithms for the Traveling Salesman Problem. 111 111 random.Reset(); 112 112 random.IntNumbers = new int[] { 3, 2 }; 113 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });113 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 114 114 Assert.IsTrue(parent1.Validate()); 115 parent2 = new Permutation .Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });115 parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 116 116 Assert.IsTrue(parent2.Validate()); 117 expected = new Permutation .Permutation(new int[] { 1, 0, 2, 3, 4, 5, 7, 6 });117 expected = new Permutation(new int[] { 1, 0, 2, 3, 4, 5, 7, 6 }); 118 118 Assert.IsTrue(expected.Validate()); 119 119 actual = MaximalPreservativeCrossover.Apply(random, parent1, parent2); … … 125 125 bool exceptionFired = false; 126 126 try { 127 MaximalPreservativeCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));127 MaximalPreservativeCrossover.Apply(random, new Permutation(8), new Permutation(6)); 128 128 } 129 129 catch (System.ArgumentException) { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderBasedCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for OrderBasedCrossoverTest and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } catch (System.InvalidOperationException) { 97 97 exceptionFired = true; … … 106 106 public void OrderBasedCrossoverApplyTest() { 107 107 TestRandom random = new TestRandom(); 108 Permutation .Permutationparent1, parent2, expected, actual;108 Permutation parent1, parent2, expected, actual; 109 109 // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13 110 110 random.Reset(); 111 111 random.IntNumbers = new int[] { 3, 5, 2, 1 }; 112 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });112 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 113 113 Assert.IsTrue(parent1.Validate()); 114 parent2 = new Permutation .Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });114 parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 115 115 Assert.IsTrue(parent2.Validate()); 116 expected = new Permutation .Permutation(new int[] { 1, 3, 2, 7, 6, 4, 5, 0 });116 expected = new Permutation(new int[] { 1, 3, 2, 7, 6, 4, 5, 0 }); 117 117 actual = OrderBasedCrossover.Apply(random, parent1, parent2); 118 118 Assert.IsTrue(actual.Validate()); … … 122 122 bool exceptionFired = false; 123 123 try { 124 OrderBasedCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));124 OrderBasedCrossover.Apply(random, new Permutation(8), new Permutation(6)); 125 125 } catch (System.ArgumentException) { 126 126 exceptionFired = true; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderCrossover2Test.cs
r2930 r3053 1 1 using HeuristicLab.Core; 2 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 using HeuristicLab.Encodings.Permutation ;3 using HeuristicLab.Encodings.PermutationEncoding; 4 4 5 namespace HeuristicLab.Encodings.Permutation _33.Tests {5 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 6 6 /// <summary> 7 7 ///This is a test class for OrderCrossover2Test and is intended … … 69 69 bool exceptionFired = false; 70 70 try { 71 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {72 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));71 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 72 new Permutation(4), new Permutation(4), new Permutation(4)})); 73 73 } catch (System.InvalidOperationException) { 74 74 exceptionFired = true; … … 83 83 public void OrderCrossover2ApplyTest() { 84 84 TestRandom random = new TestRandom(); 85 Permutation .Permutationparent1, parent2, expected, actual;85 Permutation parent1, parent2, expected, actual; 86 86 // 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. 87 87 random.Reset(); 88 88 random.IntNumbers = new int[] { 5, 7 }; 89 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });89 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); 90 90 Assert.IsTrue(parent1.Validate()); 91 parent2 = new Permutation .Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 });91 parent2 = new Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 }); 92 92 Assert.IsTrue(parent2.Validate()); 93 expected = new Permutation .Permutation(new int[] { 2, 0, 9, 1, 3, 5, 6, 7, 8, 4 });93 expected = new Permutation(new int[] { 2, 0, 9, 1, 3, 5, 6, 7, 8, 4 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 actual = OrderCrossover2.Apply(random, parent1, parent2); … … 101 101 bool exceptionFired = false; 102 102 try { 103 OrderCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));103 OrderCrossover.Apply(random, new Permutation(8), new Permutation(6)); 104 104 } catch (System.ArgumentException) { 105 105 exceptionFired = true; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for OrderCrossoverTest and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } catch (System.InvalidOperationException) { 97 97 exceptionFired = true; … … 106 106 public void OrderCrossoverApplyTest() { 107 107 TestRandom random = new TestRandom(); 108 Permutation .Permutationparent1, parent2, expected, actual;108 Permutation parent1, parent2, expected, actual; 109 109 // The following test is based on an example from Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, pp. 55-56 110 110 random.Reset(); 111 111 random.IntNumbers = new int[] { 3, 6 }; 112 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });112 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 113 113 Assert.IsTrue(parent1.Validate()); 114 parent2 = new Permutation .Permutation(new int[] { 8, 2, 6, 7, 1, 5, 4, 0, 3 });114 parent2 = new Permutation(new int[] { 8, 2, 6, 7, 1, 5, 4, 0, 3 }); 115 115 Assert.IsTrue(parent2.Validate()); 116 expected = new Permutation .Permutation(new int[] { 2, 7, 1, 3, 4, 5, 6, 0, 8 });116 expected = new Permutation(new int[] { 2, 7, 1, 3, 4, 5, 6, 0, 8 }); 117 117 Assert.IsTrue(expected.Validate()); 118 118 actual = OrderCrossover.Apply(random, parent1, parent2); … … 122 122 random.Reset(); 123 123 random.IntNumbers = new int[] { 2, 4 }; 124 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });124 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 125 125 Assert.IsTrue(parent1.Validate()); 126 parent2 = new Permutation .Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });126 parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 127 127 Assert.IsTrue(parent2.Validate()); 128 expected = new Permutation .Permutation(new int[] { 7, 6, 2, 3, 4, 0, 1, 5 });128 expected = new Permutation(new int[] { 7, 6, 2, 3, 4, 0, 1, 5 }); 129 129 actual = OrderCrossover.Apply(random, parent1, parent2); 130 130 Assert.IsTrue(actual.Validate()); … … 133 133 random.Reset(); 134 134 random.IntNumbers = new int[] { 2, 5 }; 135 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });135 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 136 136 Assert.IsTrue(parent1.Validate()); 137 parent2 = new Permutation .Permutation(new int[] { 7, 3, 0, 4, 8, 2, 5, 1, 6 });137 parent2 = new Permutation(new int[] { 7, 3, 0, 4, 8, 2, 5, 1, 6 }); 138 138 Assert.IsTrue(parent2.Validate()); 139 expected = new Permutation .Permutation(new int[] { 0, 8, 2, 3, 4, 5, 1, 6, 7 });139 expected = new Permutation(new int[] { 0, 8, 2, 3, 4, 5, 1, 6, 7 }); 140 140 Assert.IsTrue(expected.Validate()); 141 141 actual = OrderCrossover.Apply(random, parent1, parent2); … … 145 145 random.Reset(); 146 146 random.IntNumbers = new int[] { 0, 5 }; 147 parent1 = new Permutation .Permutation(new int[] { 2, 1, 4, 3, 7, 8, 6, 0, 5, 9 });147 parent1 = new Permutation(new int[] { 2, 1, 4, 3, 7, 8, 6, 0, 5, 9 }); 148 148 Assert.IsTrue(parent1.Validate()); 149 parent2 = new Permutation .Permutation(new int[] { 5, 3, 4, 0, 9, 8, 2, 7, 1, 6 });149 parent2 = new Permutation(new int[] { 5, 3, 4, 0, 9, 8, 2, 7, 1, 6 }); 150 150 Assert.IsTrue(parent2.Validate()); 151 expected = new Permutation .Permutation(new int[] { 2, 1, 4, 3, 7, 8, 6, 5, 0, 9 });151 expected = new Permutation(new int[] { 2, 1, 4, 3, 7, 8, 6, 5, 0, 9 }); 152 152 Assert.IsTrue(expected.Validate()); 153 153 actual = OrderCrossover.Apply(random, parent1, parent2); … … 157 157 random.Reset(); 158 158 random.IntNumbers = new int[] { 6, 9 }; 159 expected = new Permutation .Permutation(new int[] { 3, 4, 8, 2, 7, 1, 6, 0, 5, 9 });159 expected = new Permutation(new int[] { 3, 4, 8, 2, 7, 1, 6, 0, 5, 9 }); 160 160 Assert.IsTrue(expected.Validate()); 161 161 actual = OrderCrossover.Apply(random, parent1, parent2); … … 165 165 random.Reset(); 166 166 random.IntNumbers = new int[] { 0, 9 }; 167 expected = new Permutation .Permutation(new int[] { 2, 1, 4, 3, 7, 8, 6, 0, 5, 9 });167 expected = new Permutation(new int[] { 2, 1, 4, 3, 7, 8, 6, 0, 5, 9 }); 168 168 Assert.IsTrue(expected.Validate()); 169 169 actual = OrderCrossover.Apply(random, parent1, parent2); … … 175 175 bool exceptionFired = false; 176 176 try { 177 OrderCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));177 OrderCrossover.Apply(random, new Permutation(8), new Permutation(6)); 178 178 } catch (System.ArgumentException) { 179 179 exceptionFired = true; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/PartiallyMatchedCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for PartiallyMatchedCrossover and is intended … … 92 92 bool exceptionFired = false; 93 93 try { 94 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {95 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)}));94 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 95 new Permutation(4), new Permutation(4), new Permutation(4)})); 96 96 } 97 97 catch (System.InvalidOperationException) { … … 107 107 public void PartiallyMatchedCrossoverApplyTest() { 108 108 TestRandom random = new TestRandom(); 109 Permutation .Permutationparent1, parent2, expected, actual;109 Permutation parent1, parent2, expected, actual; 110 110 // The following test is based on an example from Larranaga, 1999. Genetic Algorithms for the Traveling Salesman Problem. 111 111 random.Reset(); 112 112 random.IntNumbers = new int[] { 3, 5 }; 113 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });113 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 114 114 Assert.IsTrue(parent1.Validate()); 115 parent2 = new Permutation .Permutation(new int[] { 2, 6, 4, 0, 5, 7, 1, 3 });115 parent2 = new Permutation(new int[] { 2, 6, 4, 0, 5, 7, 1, 3 }); 116 116 Assert.IsTrue(parent2.Validate()); 117 expected = new Permutation .Permutation(new int[] { 2, 6, 7, 3, 4, 5, 1, 0 });117 expected = new Permutation(new int[] { 2, 6, 7, 3, 4, 5, 1, 0 }); 118 118 Assert.IsTrue(expected.Validate()); 119 119 actual = PartiallyMatchedCrossover.Apply(random, parent1, parent2); … … 123 123 random.Reset(); 124 124 random.IntNumbers = new int[] { 5, 7 }; 125 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });125 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); 126 126 Assert.IsTrue(parent1.Validate()); 127 parent2 = new Permutation .Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 });127 parent2 = new Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 }); 128 128 Assert.IsTrue(parent2.Validate()); 129 expected = new Permutation .Permutation(new int[] { 2, 1, 3, 0, 9, 5, 6, 7, 4, 8 });129 expected = new Permutation(new int[] { 2, 1, 3, 0, 9, 5, 6, 7, 4, 8 }); 130 130 Assert.IsTrue(expected.Validate()); 131 131 actual = PartiallyMatchedCrossover.Apply(random, parent1, parent2); … … 137 137 bool exceptionFired = false; 138 138 try { 139 PartiallyMatchedCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));139 PartiallyMatchedCrossover.Apply(random, new Permutation(8), new Permutation(6)); 140 140 } 141 141 catch (System.ArgumentException) { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/PositionBasedCrossoverTest.cs
r2930 r3053 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation ;24 using HeuristicLab.Encodings.PermutationEncoding; 25 25 26 namespace HeuristicLab.Encodings.Permutation _33.Tests {26 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 27 27 /// <summary> 28 28 ///This is a test class for PositionBasedCrossover and is intended … … 93 93 bool exceptionFired = false; 94 94 try { 95 target.Cross(random, new ItemArray<Permutation .Permutation>(new Permutation.Permutation[] {96 new Permutation .Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4) }));95 target.Cross(random, new ItemArray<Permutation>(new Permutation[] { 96 new Permutation(4), new Permutation(4), new Permutation(4) })); 97 97 } 98 98 catch (System.InvalidOperationException) { … … 109 109 public void PositionBasedCrossoverApplyTest() { 110 110 TestRandom random = new TestRandom(); 111 Permutation .Permutationparent1, parent2, expected, actual;111 Permutation parent1, parent2, expected, actual; 112 112 113 113 // The following test is based on an example from Larranaga, 1999. Genetic Algorithms for the Traveling Salesman Problem. 114 114 random.Reset(); 115 115 random.IntNumbers = new int[] { 3, 1, 2, 5 }; 116 parent1 = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });116 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 117 117 Assert.IsTrue(parent1.Validate()); 118 parent2 = new Permutation .Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });118 parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 119 119 Assert.IsTrue(parent2.Validate()); 120 120 121 expected = new Permutation .Permutation(new int[] { 0, 3, 5, 1, 2, 4, 6, 7 });121 expected = new Permutation(new int[] { 0, 3, 5, 1, 2, 4, 6, 7 }); 122 122 Assert.IsTrue(expected.Validate()); 123 123 actual = PositionBasedCrossover.Apply(random, parent1, parent2); … … 129 129 bool exceptionFired = false; 130 130 try { 131 PositionBasedCrossover.Apply(random, new Permutation .Permutation(8), new Permutation.Permutation(6));131 PositionBasedCrossover.Apply(random, new Permutation(8), new Permutation(6)); 132 132 } catch (System.ArgumentException) { 133 133 exceptionFired = true; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Properties/AssemblyInfo.cs
r2906 r3053 5 5 // set of attributes. Change these attribute values to modify the information 6 6 // associated with an assembly. 7 [assembly: AssemblyTitle("HeuristicLab.Encodings.Permutation -3.3.Tests")]7 [assembly: AssemblyTitle("HeuristicLab.Encodings.PermutationEncoding-3.3.Tests")] 8 8 [assembly: AssemblyDescription("Unit tests for the HeuristicLab permutation encoding and related operators.")] 9 9 [assembly: AssemblyConfiguration("")] -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Random.cs
r2932 r3053 23 23 using HeuristicLab.Core; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 public class TestRandom : IRandom { 27 27 #region Variables and Properties -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/ScrambleManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for ScrambleManipulator and is intended … … 84 84 public void ScrambleManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 3, 6, 1, 1, 1, 0 }; 90 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });90 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 expected = new Permutation .Permutation(new int[] { 0, 1, 2, 4, 5, 6, 3, 7 });93 expected = new Permutation(new int[] { 0, 1, 2, 4, 5, 6, 3, 7 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 ScrambleManipulator.Apply(random, parent); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Swap2ManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for Swap2Manipulator and is intended … … 84 84 public void Swap2ManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // The following test is based on an example from Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 45 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 1, 4 }; 90 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });90 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 expected = new Permutation .Permutation(new int[] { 0, 4, 2, 3, 1, 5, 6, 7, 8 });93 expected = new Permutation(new int[] { 0, 4, 2, 3, 1, 5, 6, 7, 8 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 Swap2Manipulator.Apply(random, parent); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Swap3ManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for Swap3Manipulator and is intended … … 84 84 public void Swap3ManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // Test manipulator 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 1, 3, 6 }; 90 90 random.DoubleNumbers = new double[] { 0 }; 91 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });91 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }); 92 92 Assert.IsTrue(parent.Validate()); 93 93 94 expected = new Permutation .Permutation(new int[] { 0, 3, 2, 6, 4, 5, 1, 7, 8 });94 expected = new Permutation(new int[] { 0, 3, 2, 6, 4, 5, 1, 7, 8 }); 95 95 Assert.IsTrue(expected.Validate()); 96 96 Swap3Manipulator.Apply(random, parent); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/Test References/HeuristicLab.Encodings.Permutation-3.3.accessor
r2930 r3053 1 HeuristicLab.Encodings.Permutation -3.3.dll1 HeuristicLab.Encodings.PermutationEncoding-3.3.dll 2 2 Desktop -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/TranslocationInversionManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for TranslocationInversionManipulator and is intended … … 84 84 public void TranslocationInversionManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 2, 4, 4 }; 90 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });90 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 expected = new Permutation .Permutation(new int[] { 0, 1, 5, 6, 4, 3, 2, 7 });93 expected = new Permutation(new int[] { 0, 1, 5, 6, 4, 3, 2, 7 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 TranslocationInversionManipulator.Apply(random, parent); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/TranslocationManipulatorTest.cs
r2930 r3053 21 21 22 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.Permutation ;23 using HeuristicLab.Encodings.PermutationEncoding; 24 24 25 namespace HeuristicLab.Encodings.Permutation _33.Tests {25 namespace HeuristicLab.Encodings.PermutationEncoding_33.Tests { 26 26 /// <summary> 27 27 ///This is a test class for TranslocationManipulator and is intended … … 84 84 public void TranslocationManipulatorApplyTest() { 85 85 TestRandom random = new TestRandom(); 86 Permutation .Permutationparent, expected;86 Permutation parent, expected; 87 87 // The following test is based on an example from Larranaga, P. et al. 1999. Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators. Artificial Intelligence Review, 13, p. 24 88 88 random.Reset(); 89 89 random.IntNumbers = new int[] { 2, 4, 4 }; 90 parent = new Permutation .Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });90 parent = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 91 91 Assert.IsTrue(parent.Validate()); 92 92 93 expected = new Permutation .Permutation(new int[] { 0, 1, 5, 6, 2, 3, 4, 7 });93 expected = new Permutation(new int[] { 0, 1, 5, 6, 2, 3, 4, 7 }); 94 94 Assert.IsTrue(expected.Validate()); 95 95 TranslocationManipulator.Apply(random, parent);
Note: See TracChangeset
for help on using the changeset viewer.