Exemplo n.º 1
0
        public void GetBestChromosomes_Count_Should_Be_Same_As_Turnament_Count()
        {
            //Arange
            var matrix     = _matrixService.GenerateMatrix(10, 0.5);
            var population = _populationService.Initialize(matrix, 50, 3);
            //Act
            var result = _sut.GetBestChromosomes(ChromosomePart.First, population.Population, numberOfTournamentRounds).Count();

            //Assert
            Assert.That(result, Is.EqualTo(numberOfTournamentRounds));
        }
        public void IsConsistent_Should_Alwasy_Pass()
        {
            //Arange
            var matrix = _matrixService.GenerateMatrix(10, _probability);
            //Act
            var result = _sut.IsConsistent(matrix.Elements);

            //Assert
            Assert.That(result == true);
        }
Exemplo n.º 3
0
        public void Initialize_Should_Pass(int nodeCount)
        {
            //Arange
            //Act
            var result = _sut.GenerateMatrix(nodeCount, _probability);

            Log2dArray(result.Elements);

            //Assert
            Assert.IsNotNull(result);
            Assert.Pass();
        }