コード例 #1
0
ファイル: FormTeste.cs プロジェクト: gizmotic/Estudos
        public void Run()
        {
            GaTSP objGA = new GaTSP(Param);

            objGA.DrawMap += objGA_DrawMap;
            generation     = 1;
            while (true)
            {
                objGA.Epoch();
                BestSolution = objGA.BestSolution;
                generation++;
                Thread.Sleep(100);
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            GaTSP objGA = new GaTSP(0.2, 0.6, 50, 20);

            objGA.DrawMap += objGA_DrawMap;
            int generation = 1;

            while (true)
            {
                objGA.Epoch();
                label1.Text = objGA.BestSolution.ToString();
                label1.Update();
                txtFitness.Text = objGA.BestSolution.ToString();
                txtFitness.Update();
                txtGeneration.Text = generation.ToString();
                txtGeneration.Update();
                generation++;
                Thread.Sleep(100);
            }
        }