Beispiel #1
0
        private void ShowResults()
        {
            synchronizationContext.Post(new SendOrPostCallback(o =>
            {
                GaEngine gaEng = (GaEngine)o;
                labelMinF.Text = $"Min - F1: {gaEng.MinF1}, F2:{gaEng.MinF2}";
                labelMaxF.Text = $"Max - F1: {gaEng.MaxF1}, F2:{gaEng.MaxF2}";
                labelAvgF.Text = $"Avg - F1: {gaEng.AvgF1}, F2:{gaEng.AvfF2}";

                chartPareto.Series.Clear();
                var series = gaEng.GetIterSeries();
                chartPareto.Series.Add(series[0]);
                chartPareto.Series.Add(series[1]);
                chartPareto.Invalidate();
            }), _GaEngine);

            _gGraph.Clear(Color.White);

            if (_graphIsImag)
            {
                _graph.DrawImagGraph(_gGraph, _GaEngine.BestF1, panelGraphGraphics.Width, panelGraphGraphics.Height);
            }
            else
            {
                _graph.Draw(_gGraph, _GaEngine.BestF1);
            }

            _gPareto.Clear(Color.White);
            _GaEngine.DrawPareto(_gPareto, _paretoWidth, _paretoHeight);
        }
Beispiel #2
0
        private void buttonGenPop_Click(object sender, EventArgs e)
        {
            _GaEngine = new GaEngine(_graph, (int)numericUpDownPopSize.Value);

            buttonOneGeneration.Enabled = true;
            buttonEvoluate.Enabled      = true;
        }