public void TestSelection() { m_rPopulation = new CGroup(m_rGraph, m_rLaw); m_rPopulation.GenerateChromosomes(m_rLaw.PopulationSize); Console.WriteLine(m_rPopulation.ToString()); CGroup rSelection = m_rPopulation.Selection(); Console.WriteLine(m_rPopulation.m_sSelectionLog); Console.WriteLine(rSelection.ToString()); Console.WriteLine(rSelection.Crossbreeding().ToString()); double fLastBestGrade = m_rPopulation.GetBestGrade(); Console.WriteLine(fLastBestGrade.ToString()); fLastBestGrade = rSelection.GetBestGrade(); Console.WriteLine(fLastBestGrade.ToString()); }
public bool IsNotEndOfEvolution() { bool bEvolutionNotEnded = true; double fCurrentBestGrade = m_rPopulation.GetBestGrade(); if (m_rLaw.WaitCounter > 0) { if (fCurrentBestGrade < m_fLastBestGrade) { m_fLastBestGrade = fCurrentBestGrade; } else { m_rLaw.DecWaitCounter(); } } else { bEvolutionNotEnded = false; } return(bEvolutionNotEnded); }
public void InitializeGroup() { m_rPopulation = new CGroup(m_rUpdater, m_rLaw); m_rPopulation.GenerateChromosomes(m_rLaw.PopulationSize); m_fLastBestGrade = m_rPopulation.GetBestGrade(); }