src/GenFx.Components.Tests/BoltzmannSelectionOperatorTest.cs
/// <summary>
/// Tests that the temperature is adjusted correctly for each generation.
/// </summary>
Tests that the temperature is adjusted correctly for each generation.
Tests that the temperature is adjusted correctly for each generation .
[Fact]
        public void BoltzmannSelectionOperator_Temperature()
        {
            double initialTemp = 10;
            MockGeneticAlgorithm algorithm = GetMockAlgorithm(initialTemp);
            FakeBoltzmannSelectionOperator op = (FakeBoltzmannSelectionOperator)algorithm.SelectionOperator;
            op.Initialize(algorithm);
            double currentTemp = initialTemp;
            for (int i = 0; i < 10; i++)
            {
                algorithm.RaiseGenerationCreatedEvent();
                Assert.Equal(op.GetTemp(), currentTemp + 1);
                currentTemp++;
            }
        }
[ Fact ] public void BoltzmannSelectionOperator_Temperature ( ) { double initialTemp = 10 ; MockGeneticAlgorithm algorithm = GetMockAlgorithm ( initialTemp ) ; FakeBoltzmannSelectionOperator op = ( FakeBoltzmannSelectionOperator ) algorithm . SelectionOperator ; op . Initialize ( algorithm ) ; double currentTemp = initialTemp ; for ( int i = 0 ; i < 10 ; i ++ ) { algorithm . RaiseGenerationCreatedEvent ( ) ; Assert . Equal ( op . GetTemp ( ) , currentTemp + 1 ) ; currentTemp ++ ; } }
Tests that the temperature is adjusted correctly for each generation.
Tests that the temperature is adjusted correctly for each generation .