Ejemplo n.º 1
0
        private void button10_Click(object sender, EventArgs e)
        {
            int rows = dataGridView2.Rows.Count;

            double[]  expertTrust   = GetExpertTrust();
            ArrayList expertOpinion = new ArrayList();

            for (int i = 0; i < rows; i++)
            {
                double[] opinions = new double[3];
                for (int j = 0; j < 3; j++)
                {
                    opinions[j] = Convert.ToDouble(dataGridView2[j, i].Value);
                }
                expertOpinion.Add(opinions);
            }
            double        gamma1 = Convert.ToDouble(optimData.Text);
            double        gamma2 = Convert.ToDouble(realData.Text);
            double        gamma3 = Convert.ToDouble(pessData.Text);
            double        gamma4 = Convert.ToDouble(koefData.Text);
            TestedSumming m      = new TestedSumming();

            m.Init(gamma1, gamma2, gamma3, gamma4);
            double efficiency;
            object results;

            m.Execute(rows, expertTrust, expertOpinion, out efficiency, out results);
            textBox4.Text = round100(((double)results)).ToString();
            textBox3.Text = round100(efficiency).ToString();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Method m = new TestedSumming();
            double t;
            Object a;

            double[] marks = { 1, 0.5, 2 };

            double[] x1 = { 1, 1, 1, 1 };
            double[] x2 = { 2, 1.5, 1, 2 };
            double[] x3 = { 10, 10, 10, 3 };

            ArrayList opinions = new ArrayList();

            opinions.Add(x1);
            opinions.Add(x2);
            opinions.Add(x3);

            m.Execute(3, marks, opinions, out t, out a);
            MessageBox.Show(t.ToString());
            MessageBox.Show(a.ToString());
        }