コード例 #1
0
ファイル: Form45.cs プロジェクト: tsimafei-markhel/opt
 private void mnuEnableSorting_Click(object sender, EventArgs e)
 {
     this._enableSorting = this.mnuEnableSorting.Checked;
     // Заполним табличку
     MatrixDataGridFiller.FillMatrixDataGrid(this._model,
                                             this.dgvData, this._enableSorting, this._repeatParams, this._hideInactiveExperiments);
 }
コード例 #2
0
ファイル: Form45.cs プロジェクト: tsimafei-markhel/opt
        private void mnuChangeConstraints_Click(object sender, EventArgs e)
        {
            ChangeConstraintsForm ccf = new ChangeConstraintsForm(this._model);

            if (ccf.ShowDialog() == DialogResult.OK)
            {
                if (this.mnuApplyConstraints.Checked)
                {
                    // Заполним табличку
                    MatrixDataGridFiller.FillMatrixDataGrid(this._model,
                                                            this.dgvData, this._enableSorting, this._repeatParams, this._hideInactiveExperiments);
                }
            }
            ccf.Dispose();
        }
コード例 #3
0
        public MatrixForm(
            Model model)
        {
            InitializeComponent();

            this._model = model;

            this._enableSorting           = true;
            this._repeatParams            = true;
            this._hideInactiveExperiments = false;

            // Заполним табличку
            MatrixDataGridFiller.FillMatrixDataGrid(this._model,
                                                    this.dgvData, this._enableSorting, this._repeatParams, this._hideInactiveExperiments);
        }
コード例 #4
0
        private void btnRefreshAdmissibleSet_Click(object sender, EventArgs e)
        {
            // Получим граничные точки, которые ввел пользователь
            Dictionary <TId, int> boundaryPoints = new Dictionary <TId, int>();
            bool gotAllPoints = true;

            foreach (DataGridViewRow row in this.dgvBoundaryPoints.Rows)
            {
                TId critId     = (TId)row.Cells[0].Value;
                int boundaryPt = 0;

                try
                {
                    string value = (string)row.Cells[2].FormattedValue;
                    if (string.IsNullOrEmpty(value))
                    {
                        value = "0";
                    }
                    boundaryPt = Convert.ToInt32(value);
                }
                catch (Exception ex)
                {
                    string message = "Не могу преобразовать введенное для критерия '" +
                                     this._model.Criteria[critId].Name +
                                     "' значение номера граничного эксперимента в целое число" +
                                     "\nОригинальное сообщение: " + ex.Message;
                    MessageBoxHelper.ShowError(message);
                    gotAllPoints = false;
                    return;
                }

                if (boundaryPt >= 0)
                {
                    boundaryPoints.Add(critId, boundaryPt);
                }
            }

            // Если все точки собраны без ошибок
            if (gotAllPoints)
            {
                // Сформируем допустимое множество
                ReadOnlyCollection <TId> admissibleSet = AdmissibleSetFinder.GetAdmissibleSet(boundaryPoints, this._model);
                // Применим его
                AdmissibleSetFinder.ApplyAdmissibleSet(admissibleSet, this._model);
                // Покажем его
                MatrixDataGridFiller.FillAdmissibleSetDataGrid(this._model, this.dgvData, this._showConstraints, this._repeatParams);
            }
        }
コード例 #5
0
ファイル: Form45.cs プロジェクト: tsimafei-markhel/opt
 private void mnuApplyConstraints_Click(object sender, EventArgs e)
 {
     if (this.mnuApplyConstraints.Checked)
     {
         this._model.ApplyFunctionalConstraints();
     }
     else
     {
         foreach (Experiment exp in this._model.Experiments.Values)
         {
             exp.IsActive = true;
         }
     }
     // Заполним табличку
     MatrixDataGridFiller.FillMatrixDataGrid(this._model,
                                             this.dgvData, this._enableSorting, this._repeatParams, this._hideInactiveExperiments);
 }
コード例 #6
0
        public AdmissibleSetForm(
            Form prevForm,
            Model model)
        {
            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._showConstraints = false;
            this._repeatParams    = false;

            this.lblSelectedMethod.Text = string.Empty;

            // Получим начальное состояние, чтобы можно было
            // начинать сначала
            this._initialState = AdmissibleSetFinder.GetInitialSet(this._model);

            // Заполним таблицу граничных точек
            this.FillBoundaryPointsGrid();

            // Заполним матрицу решений
            MatrixDataGridFiller.FillAdmissibleSetDataGrid(
                this._model,
                this.dgvData,
                this._showConstraints,
                this._repeatParams);

            // Запустим сборщик мусора, чтобы убить
            // предыдущие ветки
            System.GC.Collect();
        }
コード例 #7
0
ファイル: Form45.cs プロジェクト: tsimafei-markhel/opt
        public Form45(
            Form prevForm,
            Model model)
        {
            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._enableSorting           = true;
            this._repeatParams            = true;
            this._hideInactiveExperiments = false;

            // Применим ограничения
            this._model.ApplyFunctionalConstraints();
            // Заполним табличку
            MatrixDataGridFiller.FillMatrixDataGrid(this._model,
                                                    this.dgvData, this._enableSorting, this._repeatParams, this._hideInactiveExperiments);

            // Запустим сборщик мусора, чтобы убить
            // предыдущие ветки
            System.GC.Collect();
        }
コード例 #8
0
 private void mnuShowConstraints_Click(object sender, EventArgs e)
 {
     this._showConstraints = this.mnuShowConstraints.Checked;
     MatrixDataGridFiller.FillAdmissibleSetDataGrid(this._model, this.dgvData,
                                                    this._showConstraints, this._repeatParams);
 }
コード例 #9
0
 private void btnResetAdmissibleSet_Click(object sender, EventArgs e)
 {
     AdmissibleSetFinder.ApplyAdmissibleSet(this._initialState, this._model);
     this.FillBoundaryPointsGrid();
     MatrixDataGridFiller.FillAdmissibleSetDataGrid(this._model, this.dgvData, this._showConstraints, this._repeatParams);
 }