public NsgaProcessForm( Form prevForm, Model model, NsgaParams gaParams) { InitializeComponent(); // Подстройка интерфейса Left = prevForm.Left; Top = prevForm.Top; if (FormBorderStyle != FormBorderStyle.FixedSingle) { WindowState = prevForm.WindowState; } if (WindowState == FormWindowState.Normal) { Width = prevForm.Width; Height = prevForm.Height; } _prevForm = prevForm; _model = model; _gaParams = gaParams; // Поищем решение _result = NsgaSolver.FindDecision(ref _model, _gaParams, dgvData); // Запустим сборщик мусора, чтобы убить // предыдущие ветки GC.Collect(); }
private void btnNext_Click(object sender, EventArgs e) { string externalAppPath = this.txtExternalAppPath.Text.Trim(); if (string.IsNullOrEmpty(externalAppPath)) { MessageBoxHelper.ShowExclamation("Необходимо выбрать внешнюю расчетную программу, которая будет осуществлять расчет значений критериев"); return; } NsgaParams geneticAlgorithmParams = new NsgaParams(this._model.Experiments.CountActiveExperiments(), (int)this.nudSelectionLimit.Value, (int)this.nudMaxGenerationsNumber.Value, externalAppPath); if (this.chbShowProcess.Checked) { this._nextForm = new NsgaProcessForm(this, this._model, geneticAlgorithmParams); } else { this._nextForm = new NsgaResultsForm(this, this._model, geneticAlgorithmParams); } this._nextForm.Show(); this.Hide(); }
public NsgaResultsForm( Form prevForm, Model model, NsgaParams gaParams) { InitializeComponent(); // Подстройка интерфейса this.Left = prevForm.Left; this.Top = prevForm.Top; if (this.FormBorderStyle != FormBorderStyle.FixedSingle) { this.WindowState = prevForm.WindowState; } if (this.WindowState == FormWindowState.Normal) { this.Width = prevForm.Width; this.Height = prevForm.Height; } this._prevForm = prevForm; this._model = model; this._gaParams = gaParams; // Придется искать решение, потому что пользователь // не захотел смотреть на процесс его поиска this._result = NsgaSolver.FindDecision(ref _model, _gaParams, null); // Выведем на экран NsgaDataGridFiller.FillDataGrid( this._model, this._result, this.dgvData); // Запустим сборщик мусора, чтобы убить // предыдущие ветки GC.Collect(); }
public NsgaResultsForm( Form prevForm, Model model, NsgaMethodResult result) { InitializeComponent(); // Подстройка интерфейса this.Left = prevForm.Left; this.Top = prevForm.Top; if (this.FormBorderStyle != FormBorderStyle.FixedSingle) { this.WindowState = prevForm.WindowState; } if (this.WindowState == FormWindowState.Normal) { this.Width = prevForm.Width; this.Height = prevForm.Height; } this._prevForm = prevForm; this._model = model; this._gaParams = null; // Решение уже найдено this._result = result; // Выведем на экран NsgaDataGridFiller.FillDataGrid( this._model, this._result, this.dgvData); // Запустим сборщик мусора, чтобы убить // предыдущие ветки GC.Collect(); }