Example #1
0
        private void btnGetResult_Click(object sender, EventArgs e)
        {
            int ch = operationsBox.SelectedIndex;

            if (ch == 0)
            {
                setRes = setA / setB;
            }
            if (ch == 1)
            {
                setRes = setA | setB;
            }
            if (ch == 2)
            {
                setRes = setA & setB;
            }
            if (ch == 3)
            {
                setRes = setA * setB;
            }
            if (ch == 4)
            {
                setRes = setA + setB;
            }
            if (ch == 5)
            {
                setRes = setA - setB;
            }
            if (ch == 6)
            {
                setRes = FuzzySets.FuzzySet1D.dSum(setA, setB);
            }
            if (ch == 7)
            {
                setRes = FuzzySets.FuzzySet1D.gIntersect(setA, setB);
            }
            if (ch == 8)
            {
                setRes = FuzzySets.FuzzySet1D.gUnion(setA, setB);
            }


            if (ch == 9)
            {
                try
                {
                    double lamda = double.Parse(txtLamda.Text);
                    lamda         = Math.Max(0, lamda);
                    lamda         = Math.Min(lamda, 1);
                    txtLamda.Text = lamda.ToString();
                    setRes        = FuzzySets.FuzzySet1D.alphaSum(setA, setB, lamda);
                }
                catch (Exception exx)
                {
                    MessageBox.Show("Помилка виникла при обчисленні лямда суми");
                }
            }

            refresh();
        }
Example #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            BufferData t = Common.DataBuffer.Instance.LoadDialog(FuzzySets.FuzzySet1D.ValidationCallback);

            if (t != null)
            {
                setA = new FuzzySets.FuzzySet1D(((Matrix <double>)t).Value);
            }
            refresh();
        }
Example #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            BufferData t = Common.DataBuffer.Instance.LoadDialog(FuzzySets.FuzzySet1D.ValidationCallback);

            if (t == null)
            {
                MessageBox.Show("ERROR");
            }
            else
            {
                setB = new FuzzySets.FuzzySet1D(((Matrix <double>)t).Value);
            }
            refresh();
        }
Example #4
0
        public frmBinOperations()
        {
            InitializeComponent();
            setA   = new FuzzySets.FuzzySet1D();
            setB   = new FuzzySets.FuzzySet1D();
            setRes = new FuzzySets.FuzzySet1D();

            refresh();

            operationsBox.Items.Add("  /  ");
            operationsBox.Items.Add("  |  ");
            operationsBox.Items.Add("  &  ");
            operationsBox.Items.Add("  *  "); // Алгебраическое произведение
            operationsBox.Items.Add("  +  "); // Алгебраическая сумма
            operationsBox.Items.Add("  -  "); // Семетрична сума
            operationsBox.Items.Add(" Дизъюнктивная сумма ");
            operationsBox.Items.Add(" Граничное пересечение ");
            operationsBox.Items.Add(" Граничное объединение ");
            operationsBox.Items.Add(" Лямда сума ");
            operationsBox.SelectedIndex = 0;
        }