Ejemplo n.º 1
0
        private void nineteenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FuzzySet1D res = StandartSetForm.GetSet(StandartSet.Trapeze);

            if (res != null)
            {
                sets.Add(res);
                UpdateListToDgw();
            }
        }
Ejemplo n.º 2
0
        private void seventeenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FuzzySet1D res = StandartSetForm.GetSet(StandartSet.NormalDistribution);

            if (res != null)
            {
                sets.Add(res);
                UpdateListToDgw();
            }
        }
Ejemplo n.º 3
0
        private void трикутнаМножинаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FuzzySet1D res = StandartSetForm.GetSet(StandartSet.Triangle);

            if (res != null)
            {
                sets.Add(res);
                UpdateListToDgw();
            }
        }
Ejemplo n.º 4
0
        public static FuzzySet1D GetSet(StandartSet setType)
        {
            sType = setType;
            StandartSetForm form = new StandartSetForm();

            switch (setType)
            {
            case StandartSet.NormalDistribution:
                #region Нормальное распределение
            {
                DataGridViewRow row = new DataGridViewRow();
                {
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.ValueType       = typeof(string);
                    cell.Value           = "m";
                    cell.Style.Font      = new Font("Symbol", 10.0f, FontStyle.Bold);
                    cell.Style.BackColor = SystemColors.Info;
                    row.Cells.Add(cell);
                }
                {
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.ValueType  = typeof(double);
                    cell.Value      = 0.0;
                    cell.Style.Font = new Font("Courier New", 10.0f);
                    row.Cells.Add(cell);
                }
                form.dgwMain.Rows.Add(row);
            }
                {
                    DataGridViewRow row = new DataGridViewRow();
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType       = typeof(string);
                        cell.Value           = "s";
                        cell.Style.BackColor = SystemColors.Info;
                        cell.Style.Font      = new Font("Symbol", 10.0f, FontStyle.Bold);
                        row.Cells.Add(cell);
                    }
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType  = typeof(double);
                        cell.Value      = 1.0;
                        cell.Style.Font = new Font("Courier New", 10.0f);
                        row.Cells.Add(cell);
                    }
                    form.dgwMain.Rows.Add(row);
                }
                form.pbExample.Image = Resources.normaD1;
                #endregion
                form.lblCaption.Text = "Нормальний розподіл";
                break;

            case StandartSet.Triangle:
                #region  Треугольник
            {
                DataGridViewRow row = new DataGridViewRow();
                {
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.ValueType       = typeof(string);
                    cell.Value           = "d";
                    cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                    cell.Style.BackColor = SystemColors.Info;
                    row.Cells.Add(cell);
                }
                {
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.ValueType  = typeof(double);
                    cell.Value      = 5.0;
                    cell.Style.Font = new Font("Courier New", 10.0f);
                    row.Cells.Add(cell);
                }
                form.dgwMain.Rows.Add(row);
            }
                {
                    DataGridViewRow row = new DataGridViewRow();
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType       = typeof(string);
                        cell.Value           = "s";
                        cell.Style.BackColor = SystemColors.Info;
                        cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                        row.Cells.Add(cell);
                    }
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType  = typeof(double);
                        cell.Value      = 3.0;
                        cell.Style.Font = new Font("Courier New", 10.0f);
                        row.Cells.Add(cell);
                    }
                    form.dgwMain.Rows.Add(row);
                }
                {
                    DataGridViewRow row = new DataGridViewRow();
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType       = typeof(string);
                        cell.Value           = "h";
                        cell.Style.BackColor = SystemColors.Info;
                        cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                        row.Cells.Add(cell);
                    }
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType  = typeof(double);
                        cell.Value      = 1.0;
                        cell.Style.Font = new Font("Courier New", 10.0f);
                        row.Cells.Add(cell);
                    }
                    form.dgwMain.Rows.Add(row);
                }
                form.pbExample.Image = Resources.tr;
                #endregion
                form.lblCaption.Text = "Трикутна множина";
                break;

            case StandartSet.Trapeze:
                #region  Трапеция
            {
                DataGridViewRow row = new DataGridViewRow();
                {
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.ValueType       = typeof(string);
                    cell.Value           = "d";
                    cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                    cell.Style.BackColor = SystemColors.Info;
                    row.Cells.Add(cell);
                }
                {
                    DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                    cell.ValueType  = typeof(double);
                    cell.Value      = 5.0;
                    cell.Style.Font = new Font("Courier New", 10.0f);
                    row.Cells.Add(cell);
                }
                form.dgwMain.Rows.Add(row);
            }
                {
                    DataGridViewRow row = new DataGridViewRow();
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType       = typeof(string);
                        cell.Value           = "s";
                        cell.Style.BackColor = SystemColors.Info;
                        cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                        row.Cells.Add(cell);
                    }
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType  = typeof(double);
                        cell.Value      = 3.0;
                        cell.Style.Font = new Font("Courier New", 10.0f);
                        row.Cells.Add(cell);
                    }
                    form.dgwMain.Rows.Add(row);
                }
                {
                    DataGridViewRow row = new DataGridViewRow();
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType       = typeof(string);
                        cell.Value           = "h";
                        cell.Style.BackColor = SystemColors.Info;
                        cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                        row.Cells.Add(cell);
                    }
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType  = typeof(double);
                        cell.Value      = 1.0;
                        cell.Style.Font = new Font("Courier New", 10.0f);
                        row.Cells.Add(cell);
                    }
                    form.dgwMain.Rows.Add(row);
                }
                {
                    DataGridViewRow row = new DataGridViewRow();
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType       = typeof(string);
                        cell.Value           = "H";
                        cell.Style.BackColor = SystemColors.Info;
                        cell.Style.Font      = new Font("Arial", 10.0f, FontStyle.Bold);
                        row.Cells.Add(cell);
                    }
                    {
                        DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                        cell.ValueType  = typeof(double);
                        cell.Value      = 1.0;
                        cell.Style.Font = new Font("Courier New", 10.0f);
                        row.Cells.Add(cell);
                    }
                    form.dgwMain.Rows.Add(row);
                }
                form.pbExample.Image = Resources.tra;
                #endregion
                form.lblCaption.Text = "Трапецієподібна множина";
                break;
            }
            form.ShowDialog();
            return(res);
        }