Changeset 3053 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/OrderCrossover2Test.cs
- Timestamp:
- 03/16/10 00:56:44 (14 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/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;
Note: See TracChangeset
for help on using the changeset viewer.