public AdditiveProcessForm( Form prevForm, Model model, AdditiveParams 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 = AdditiveSolver.FindDecision(this._model, this._gaParams, this.dgvData); // Запустим сборщик мусора, чтобы убить // предыдущие ветки System.GC.Collect(); }
private void btnNext_Click(object sender, EventArgs e) { string externalAppPath = this.txtExternalAppPath.Text.Trim(); if (string.IsNullOrEmpty(externalAppPath)) { MessageBoxHelper.ShowExclamation("Необходимо выбрать внешнюю расчетную программу, которая будет осуществлять расчет значений критериев"); return; } AdditiveParams geneticAlgorithmParams = new AdditiveParams(this._model.Experiments.CountActiveExperiments(), (int)this.nudSelectionLimit.Value, (double)this.nudMutationProbability.Value, (int)this.nudMaxGenerationsNumber.Value, externalAppPath); if (this.chbShowProcess.Checked) { this._nextForm = new AdditiveProcessForm(this, this._model, geneticAlgorithmParams); } else { this._nextForm = new AdditiveResultsForm(this, this._model, geneticAlgorithmParams); } this._nextForm.Show(); this.Hide(); }
public AdditiveResultsForm( Form prevForm, Model model, AdditiveParams 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 = AdditiveSolver.FindDecision(this._model, this._gaParams, null); // Выведем на экран AdditiveDataGridFiller.FillDataGrid( this._model, this._result, this.dgvData); // Запустим сборщик мусора, чтобы убить // предыдущие ветки System.GC.Collect(); }
public AdditiveResultsForm( Form prevForm, Model model, AdditiveMethodResult 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; // Выведем на экран AdditiveDataGridFiller.FillDataGrid( this._model, this._result, this.dgvData); // Запустим сборщик мусора, чтобы убить // предыдущие ветки System.GC.Collect(); }