Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/16 14:40:02 (8 years ago)
Author:
gkronber
Message:

#2434: merged trunk changes r12934:14026 from trunk to branch

Location:
branches/crossvalidation-2434
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/crossvalidation-2434

  • branches/crossvalidation-2434/HeuristicLab.Tests

  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/BlendAlphaBetaCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Data;
    2423using HeuristicLab.Tests;
     
    3231  [TestClass()]
    3332  public class BlendAlphaBetaCrossoverTest {
    34     /// <summary>
    35     ///A test for Cross
    36     ///</summary>
    37     [TestMethod()]
    38     [TestCategory("Encodings.RealVector")]
    39     [TestProperty("Time", "short")]
    40     public void BlendAlphaBetaCrossoverCrossTest() {
    41       BlendAlphaBetaCrossover_Accessor target = new BlendAlphaBetaCrossover_Accessor(new PrivateObject(typeof(BlendAlphaBetaCrossover)));
    42       ItemArray<RealVector> parents;
    43       TestRandom random = new TestRandom();
    44       bool exceptionFired;
    45       // The following test checks if there is an exception when there are more than 2 parents
    46       random.Reset();
    47       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    48       exceptionFired = false;
    49       try {
    50         RealVector actual;
    51         actual = target.Cross(random, parents);
    52       } catch (System.ArgumentException) {
    53         exceptionFired = true;
    54       }
    55       Assert.IsTrue(exceptionFired);
    56       // The following test checks if there is an exception when there are less than 2 parents
    57       random.Reset();
    58       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    59       exceptionFired = false;
    60       try {
    61         RealVector actual;
    62         actual = target.Cross(random, parents);
    63       } catch (System.ArgumentException) {
    64         exceptionFired = true;
    65       }
    66       Assert.IsTrue(exceptionFired);
    67     }
    68 
    6933    /// <summary>
    7034    ///A test for Apply
     
    9862      try {
    9963        actual = BlendAlphaBetaCrossover.Apply(random, parent1, parent2, alpha, beta);
    100       } catch (System.ArgumentException) {
     64      }
     65      catch (System.ArgumentException) {
    10166        exceptionFired = true;
    10267      }
     
    11176      try {
    11277        actual = BlendAlphaBetaCrossover.Apply(random, parent1, parent2, alpha, beta);
    113       } catch (System.ArgumentException) {
     78      }
     79      catch (System.ArgumentException) {
    11480        exceptionFired = true;
    11581      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/BlendAlphaCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Data;
    2423using HeuristicLab.Tests;
     
    3231  [TestClass()]
    3332  public class BlendAlphaCrossoverTest {
    34     /// <summary>
    35     ///A test for Cross
    36     ///</summary>
    37     [TestMethod()]
    38     [TestCategory("Encodings.RealVector")]
    39     [TestProperty("Time", "short")]
    40     public void BlendAlphaCrossoverCrossTest() {
    41       BlendAlphaCrossover_Accessor target = new BlendAlphaCrossover_Accessor(new PrivateObject(typeof(BlendAlphaCrossover)));
    42       ItemArray<RealVector> parents;
    43       TestRandom random = new TestRandom();
    44       bool exceptionFired;
    45       // The following test checks if there is an exception when there are more than 2 parents
    46       random.Reset();
    47       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    48       exceptionFired = false;
    49       try {
    50         RealVector actual;
    51         actual = target.Cross(random, parents);
    52       } catch (System.ArgumentException) {
    53         exceptionFired = true;
    54       }
    55       Assert.IsTrue(exceptionFired);
    56       // The following test checks if there is an exception when there are less than 2 parents
    57       random.Reset();
    58       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    59       exceptionFired = false;
    60       try {
    61         RealVector actual;
    62         actual = target.Cross(random, parents);
    63       } catch (System.ArgumentException) {
    64         exceptionFired = true;
    65       }
    66       Assert.IsTrue(exceptionFired);
    67     }
    68 
    6933    /// <summary>
    7034    ///A test for Apply
     
    10670      try {
    10771        actual = BlendAlphaCrossover.Apply(random, parent1, parent2, alpha);
    108       } catch (System.ArgumentException) {
     72      }
     73      catch (System.ArgumentException) {
    10974        exceptionFired = true;
    11075      }
     
    12085      try {
    12186        actual = BlendAlphaCrossover.Apply(random, parent1, parent2, alpha);
    122       } catch (System.ArgumentException) {
     87      }
     88      catch (System.ArgumentException) {
    12389        exceptionFired = true;
    12490      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/DiscreteCrossoverTest.cs

    r12012 r14029  
    3232  public class DiscreteCrossoverTest {
    3333    /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod()]
    37     [TestCategory("Encodings.RealVector")]
    38     [TestProperty("Time", "short")]
    39     public void DiscreteCrossoverCrossTest() {
    40       DiscreteCrossover_Accessor target = new DiscreteCrossover_Accessor(new PrivateObject(typeof(DiscreteCrossover)));
    41       ItemArray<RealVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are less than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    47       exceptionFired = false;
    48       try {
    49         RealVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55     }
    56 
    57     /// <summary>
    5834    ///A test for Apply
    5935    ///</summary>
     
    8460      try {
    8561        actual = DiscreteCrossover.Apply(random, parents);
    86       } catch (System.ArgumentException) {
     62      }
     63      catch (System.ArgumentException) {
    8764        exceptionFired = true;
    8865      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/HeuristicCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Tests;
    2423using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3130  [TestClass()]
    3231  public class HeuristicCrossoverTest {
    33     /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod()]
    37     [TestCategory("Encodings.RealVector")]
    38     [TestProperty("Time", "short")]
    39     public void HeuristicCrossoverCrossTest() {
    40       HeuristicCrossover_Accessor target = new HeuristicCrossover_Accessor(new PrivateObject(typeof(HeuristicCrossover)));
    41       ItemArray<RealVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are more than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    47       exceptionFired = false;
    48       try {
    49         RealVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55       // The following test checks if there is an exception when there are less than 2 parents
    56       random.Reset();
    57       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    58       exceptionFired = false;
    59       try {
    60         RealVector actual;
    61         actual = target.Cross(random, parents);
    62       } catch (System.ArgumentException) {
    63         exceptionFired = true;
    64       }
    65       Assert.IsTrue(exceptionFired);
    66     }
    67 
    6832    /// <summary>
    6933    ///A test for Apply
     
    9256      try {
    9357        actual = HeuristicCrossover.Apply(random, parent1, parent2);
    94       } catch (System.ArgumentException) {
     58      }
     59      catch (System.ArgumentException) {
    9560        exceptionFired = true;
    9661      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/LocalCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Tests;
    2423using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3130  [TestClass()]
    3231  public class LocalCrossoverTest {
    33     /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod()]
    37     [TestCategory("Encodings.RealVector")]
    38     [TestProperty("Time", "short")]
    39     public void LocalCrossoverCrossTest() {
    40       LocalCrossover_Accessor target = new LocalCrossover_Accessor(new PrivateObject(typeof(LocalCrossover)));
    41       ItemArray<RealVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are more than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    47       exceptionFired = false;
    48       try {
    49         RealVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55       // The following test checks if there is an exception when there are less than 2 parents
    56       random.Reset();
    57       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    58       exceptionFired = false;
    59       try {
    60         RealVector actual;
    61         actual = target.Cross(random, parents);
    62       } catch (System.ArgumentException) {
    63         exceptionFired = true;
    64       }
    65       Assert.IsTrue(exceptionFired);
    66     }
    67 
    6832    /// <summary>
    6933    ///A test for Apply
     
    9256      try {
    9357        actual = LocalCrossover.Apply(random, parent1, parent2);
    94       } catch (System.ArgumentException) {
     58      }
     59      catch (System.ArgumentException) {
    9560        exceptionFired = true;
    9661      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/RandomConvexCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Tests;
    2423using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3130  [TestClass()]
    3231  public class RandomConvexCrossoverTest {
    33     /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod()]
    37     [TestCategory("Encodings.RealVector")]
    38     [TestProperty("Time", "short")]
    39     public void RandomConvexCrossoverCrossTest() {
    40       RandomConvexCrossover_Accessor target = new RandomConvexCrossover_Accessor(new PrivateObject(typeof(RandomConvexCrossover)));
    41       ItemArray<RealVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are more than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    47       exceptionFired = false;
    48       try {
    49         RealVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55       // The following test checks if there is an exception when there are less than 2 parents
    56       random.Reset();
    57       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    58       exceptionFired = false;
    59       try {
    60         RealVector actual;
    61         actual = target.Cross(random, parents);
    62       } catch (System.ArgumentException) {
    63         exceptionFired = true;
    64       }
    65       Assert.IsTrue(exceptionFired);
    66     }
    67 
    6832    /// <summary>
    6933    ///A test for Apply
     
    9256      try {
    9357        actual = RandomConvexCrossover.Apply(random, parent1, parent2);
    94       } catch (System.ArgumentException) {
     58      }
     59      catch (System.ArgumentException) {
    9560        exceptionFired = true;
    9661      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/SimulatedBinaryCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Data;
    2423using HeuristicLab.Tests;
     
    3231  [TestClass()]
    3332  public class SimulatedBinaryCrossoverTest {
    34     /// <summary>
    35     ///A test for Cross
    36     ///</summary>
    37     [TestMethod()]
    38     [TestCategory("Encodings.RealVector")]
    39     [TestProperty("Time", "short")]
    40     public void SimulatedBinaryCrossoverCrossTest() {
    41       SimulatedBinaryCrossover_Accessor target = new SimulatedBinaryCrossover_Accessor(new PrivateObject(typeof(SimulatedBinaryCrossover)));
    42       ItemArray<RealVector> parents;
    43       TestRandom random = new TestRandom();
    44       bool exceptionFired;
    45       // The following test checks if there is an exception when there are more than 2 parents
    46       random.Reset();
    47       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    48       exceptionFired = false;
    49       try {
    50         RealVector actual;
    51         actual = target.Cross(random, parents);
    52       } catch (System.ArgumentException) {
    53         exceptionFired = true;
    54       }
    55       Assert.IsTrue(exceptionFired);
    56       // The following test checks if there is an exception when there are less than 2 parents
    57       random.Reset();
    58       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    59       exceptionFired = false;
    60       try {
    61         RealVector actual;
    62         actual = target.Cross(random, parents);
    63       } catch (System.ArgumentException) {
    64         exceptionFired = true;
    65       }
    66       Assert.IsTrue(exceptionFired);
    67     }
    68 
    6933    /// <summary>
    7034    ///A test for Apply
     
    9660      try {
    9761        actual = SimulatedBinaryCrossover.Apply(random, parent1, parent2, contiguity);
    98       } catch (System.ArgumentException) {
     62      }
     63      catch (System.ArgumentException) {
    9964        exceptionFired = true;
    10065      }
     
    10974      try {
    11075        actual = SimulatedBinaryCrossover.Apply(random, parent1, parent2, contiguity);
    111       } catch (System.ArgumentException) {
     76      }
     77      catch (System.ArgumentException) {
    11278        exceptionFired = true;
    11379      }
  • branches/crossvalidation-2434/HeuristicLab.Tests/HeuristicLab.Encodings.RealVectorEncoding-3.3/SinglePointCrossoverTest.cs

    r12012 r14029  
    2020#endregion
    2121
    22 using HeuristicLab.Core;
    2322using HeuristicLab.Tests;
    2423using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3130  [TestClass()]
    3231  public class SinglePointCrossoverTest {
    33     /// <summary>
    34     ///A test for Cross
    35     ///</summary>
    36     [TestMethod()]
    37     [TestCategory("Encodings.RealVector")]
    38     [TestProperty("Time", "short")]
    39     public void SinglePointCrossoverCrossTest() {
    40       SinglePointCrossover_Accessor target = new SinglePointCrossover_Accessor(new PrivateObject(typeof(SinglePointCrossover)));
    41       ItemArray<RealVector> parents;
    42       TestRandom random = new TestRandom();
    43       bool exceptionFired;
    44       // The following test checks if there is an exception when there are more than 2 parents
    45       random.Reset();
    46       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(5), new RealVector(6), new RealVector(4) });
    47       exceptionFired = false;
    48       try {
    49         RealVector actual;
    50         actual = target.Cross(random, parents);
    51       } catch (System.ArgumentException) {
    52         exceptionFired = true;
    53       }
    54       Assert.IsTrue(exceptionFired);
    55       // The following test checks if there is an exception when there are less than 2 parents
    56       random.Reset();
    57       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(4) });
    58       exceptionFired = false;
    59       try {
    60         RealVector actual;
    61         actual = target.Cross(random, parents);
    62       } catch (System.ArgumentException) {
    63         exceptionFired = true;
    64       }
    65       Assert.IsTrue(exceptionFired);
    66       // The following test checks if there is an exception when the vector has just one dimension
    67       random.Reset();
    68       parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(1) });
    69       exceptionFired = false;
    70       try {
    71         RealVector actual;
    72         actual = target.Cross(random, parents);
    73       } catch (System.ArgumentException) {
    74         exceptionFired = true;
    75       }
    76       Assert.IsTrue(exceptionFired);
    77     }
    78 
    7932    /// <summary>
    8033    ///A test for Apply
     
    10356      try {
    10457        actual = SinglePointCrossover.Apply(random, parent1, parent2);
    105       } catch (System.ArgumentException) {
     58      }
     59      catch (System.ArgumentException) {
    10660        exceptionFired = true;
    10761      }
Note: See TracChangeset for help on using the changeset viewer.