コード例 #1
0
 public Form1(Genetic GA, string TimeStr)
 {
     ChessSize = GA.Population[0].Length;
     InitializeComponent();
     label4.Text = TimeStr;
     ColorCreate();
     this.GA = GA;
     HomeCreate();
     GAstyle();
 }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int   ChessSize  = (int)numericUpDown1.Value;
            int   Iteration  = (int)numericUpDown2.Value;
            int   Npop       = (int)numericUpDown3.Value;
            float Pcrossover = (float)numericUpDown4.Value / 100;
            float Pmutation  = (float)numericUpDown5.Value / 100;

            stopWatch.Reset();
            stopWatch.Start();
            Genetic GA = new Genetic(ChessSize, Iteration, Npop, Pcrossover, Pmutation);

            GA.Start();
            stopWatch.Stop();
            Form1 form = new Form1(GA, GetTime());

            form.ShowDialog();
        }