Beispiel #1
0
        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();
        }
Beispiel #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            button2.Enabled = false;
            if (parallel == false && consistent == false)
            {
                DrawGraph drawGraph = new DrawGraph();
                drawGraph.Text = "Графіки залежності критерію Кульбака від радіусів контейнерів класів розпізнавання";

                AlgMachine algMachine = new AlgMachine(classA, classB, classC);
                algMachine.alg(20d);
                algMachine.algFind_K_KFE();

                drawGraph.GetGraph(drawGraph.chart1, algMachine.E_A, "Кульбак", 1, algMachine.k1_A, algMachine.k2_A);
                drawGraph.GetGraph(drawGraph.chart2, algMachine.E_B, "Кульбак", 2, algMachine.k1_B, algMachine.k2_B);
                drawGraph.GetGraph(drawGraph.chart3, algMachine.E_C, "Кульбак", 3, algMachine.k1_C, algMachine.k2_C);
                drawGraph.Show();
            }
            else if (parallel == true)
            {
                DrawGraph drawGraph = new DrawGraph();
                drawGraph.Text = "Графіки одержані при оптимальному значенні дельтая";

                AlgMachine algMachine = new AlgMachine(classA, classB, classC);
                algMachine.alg(DrawGraph.op_delta);
                algMachine.algFind_K_KFE();

                drawGraph.GetGraph(drawGraph.chart1, algMachine.E_A, "Кульбак", 1, algMachine.k1_A, algMachine.k2_A);
                drawGraph.GetGraph(drawGraph.chart2, algMachine.E_B, "Кульбак", 2, algMachine.k1_B, algMachine.k2_B);
                drawGraph.GetGraph(drawGraph.chart3, algMachine.E_C, "Кульбак", 3, algMachine.k1_C, algMachine.k2_C);
                drawGraph.Show();

                parallel = false;
            }
            else if (consistent == true)
            {
                DrawGraph drawGraph = new DrawGraph();
                drawGraph.Text = "Графіки після послідовної оптимізації";

                AlgMachine algMachine = new AlgMachine(classA, classB, classC);
                algMachine.alg("consistent");
                algMachine.algFind_K_KFE();

                drawGraph.GetGraph(drawGraph.chart1, algMachine.E_A, "Кульбак", 1, algMachine.k1_A, algMachine.k2_A);
                drawGraph.GetGraph(drawGraph.chart2, algMachine.E_B, "Кульбак", 2, algMachine.k1_B, algMachine.k2_B);
                drawGraph.GetGraph(drawGraph.chart3, algMachine.E_C, "Кульбак", 3, algMachine.k1_C, algMachine.k2_C);
                drawGraph.Show();

                consistent = false;
            }
        }
Beispiel #3
0
        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();
        }