Changeset 3053 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/EdgeRecombinationCrossoverTest.cs
- Timestamp:
- 03/16/10 00:56:44 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3
- Files:
-
- 2 edited
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/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) {
Note: See TracChangeset
for help on using the changeset viewer.