async void consistentAsync() { consistent = true; parallel = false; button2.Enabled = false; DrawGraph drawGraph = new DrawGraph(); drawGraph.Text = "Послідовна оптимізація КД"; groupBox4.Visible = true; groupBox4.Text = "Процес послідовної оптимізації КД"; Height = 440; OptimizationKD optimizationKD = new OptimizationKD(classA, classB, classC); await Task.Run(() => { optimizationKD.main("consistent"); }); Height = 335; groupBox4.Visible = false; drawGraph.chart2.Series.Clear(); drawGraph.chart3.Series.Clear(); drawGraph.chart4.Series.Clear(); drawGraph.GetGraph(drawGraph.chart1, optimizationKD.E_consistent_all, "Послідовна оптимізація КД", 4); drawGraph.Show(); }
private void button3_Click(object sender, EventArgs e) { parallel = true; consistent = false; button2.Enabled = true; DrawGraph drawGraph = new DrawGraph(); drawGraph.Text = "Паралельна оптимізація КД"; OptimizationKD optimizationKD = new OptimizationKD(classA, classB, classC); optimizationKD.main("parallel"); drawGraph.chart2.Series.Clear(); drawGraph.chart3.Series.Clear(); drawGraph.chart4.Series.Clear(); drawGraph.GetGraph(drawGraph.chart1, optimizationKD.E, "Паралельна оптимізація КД", 4, optimizationKD.k1, optimizationKD.k2); drawGraph.Show(); }