Example #1
0
        public void ExpandCurrentPopulation_OneNodeAndPopulationLengthOfTen_LengthTenPopulationWithExactValues()
        {
            var crf = new ChangeRatioFinder();

            var result = crf.GetMaximumChangeRatios(_trainingSet);

            var search     = new BeamLikeSearch();
            var population = new double[1][]
            {
                _node
            };

            var current = search.ExpandCurrentPopulation(population, 10, result.Down, result.Up);

            Assert.AreEqual(1406.22, Math.Round(current[0][3], 2));
            Assert.AreEqual(1410.76, Math.Round(current[1][3], 2));
            Assert.AreEqual(1415.31, Math.Round(current[2][3], 2));
            Assert.AreEqual(1419.85, Math.Round(current[3][3], 2));
            Assert.AreEqual(1424.40, Math.Round(current[4][3], 2));
            Assert.AreEqual(1428.94, Math.Round(current[5][3], 2));
            Assert.AreEqual(1433.49, Math.Round(current[6][3], 2));
            Assert.AreEqual(1438.04, Math.Round(current[7][3], 2));
            Assert.AreEqual(1442.58, Math.Round(current[8][3], 2));
            Assert.AreEqual(1447.13, Math.Round(current[9][3], 2));
        }
Example #2
0
        public void ExpandCurrentPopulation_OneNodeAndPopulationLengthOfTen_LengthTenPopulation()
        {
            var crf = new ChangeRatioFinder();

            var result = crf.GetMaximumChangeRatios(_trainingSet);

            var search     = new BeamLikeSearch();
            var population = new double[1][]
            {
                _node
            };

            var current = search.ExpandCurrentPopulation(population, 10, result.Down, result.Up);

            Assert.AreEqual(10, current.Length);
        }