Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 public void InitializeGroup()
 {
     m_rPopulation = new CGroup(m_rUpdater, m_rLaw);
     m_rPopulation.GenerateChromosomes(m_rLaw.PopulationSize);
     m_fLastBestGrade = m_rPopulation.GetBestGrade();
 }