Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/23/16 19:31:18 (8 years ago)
Author:
bburlacu
Message:

#2685: Add correction step for values miscalculated due to cyclical symbol dependencies in the grammar. Updated unit test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.PermutationEncoding-3.3/UniformLikeCrossoverTest.cs

    r14185 r14353  
    5454      Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual));
    5555    }
     56
     57    /// <summary>
     58    ///A test for Cross
     59    ///</summary>
     60    [TestMethod]
     61    [TestCategory("Encodings.Permutation")]
     62    [TestProperty("Time", "short")]
     63    public void UniformLikeCrossoverCrossTest() {
     64      var privateObject = new PrivateObject(typeof(UniformLikeCrossover));
     65      IRandom random = new TestRandom(new int[] { }, new double[] { 0.1, 0.2, 0.3, 0.4 });
     66      random.Reset();
     67      bool exceptionFired = false;
     68      try {
     69        privateObject.Invoke("Cross", random, new ItemArray<Permutation>(new Permutation[] {
     70
     71          new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)}));
     72      }
     73      catch (System.InvalidOperationException) {
     74        exceptionFired = true;
     75      }
     76      Assert.IsTrue(exceptionFired);
     77    }
    5678  }
    5779}
Note: See TracChangeset for help on using the changeset viewer.