using HeuristicLab.Analysis.FitnessLandscape; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace UnitTests { [TestClass] public class InformationAnalysisTest { [TestMethod] public void TestFeatures() { var qualities = new double[] { 1, 2, 1, 3, 2, 4, 2, 1, 1, 2, 4, 4, 3, 1 }; var ia = new InformationAnalysis(qualities); Assert.AreEqual(0.8224, ia.InformationContent[0], 1e-04); Assert.AreEqual(0.4603, ia.DensityBasinInformation[0], 1e-04); Assert.AreEqual(0.6154, ia.PartialInformationContent[0], 1e-04); Assert.AreEqual(0.9008, ia.TotalEntropy[0], 1e-04); Assert.AreEqual(2, ia.InformationStability); Assert.AreEqual(4, ia.Diversity); Assert.AreEqual(5, ia.Regularity); Assert.AreEqual(0.4603, ia.PeakDensityBasinInformation.Value, 1e-04); Assert.AreEqual(0.8224, ia.PeakInformationContent.Value, 1e-04); Assert.AreEqual(0.9008, ia.PeakTotalEntropy.Value, 1e-04); Assert.AreEqual(0.7642, ia.SymmetricInformationContent[0], 1e-04); Assert.AreEqual(0.2987, ia.SymmetricDensityBasinInformation[0], 1e-04); Assert.AreEqual(0.7068, ia.SymmetricTotalEntropy[0], 1e-04); } } }