public CauchyDistribution(double a, double mu, int samplemingLenght)
 {
     this._a = a;
     this._mu = mu;
     this._samplingLength = samplemingLenght;
     _unDistr = new UniformDistributions(-1, 1, _samplingLength);
                 _unDistr.CalculateSampling();
                 r = new Random();
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (_currentTab)
            {
                case 0:
                    {
                        //пока яд.ф тестирую только на гнормальном 
                        double mx = Double.Parse(mxTextBox.Text.Trim().Replace('.', ','));
                        double dx = Double.Parse(dxTextBox.Text.Trim().Replace('.', ','));
                        _samplingLenght = Int32.Parse(samplingLengthTextBox.Text.Trim());
                        GausianDistribution d = new GausianDistribution(mx, dx, _samplingLenght);
                        EpanichnikovKernal epan = new EpanichnikovKernal(d);
                        GaussianKernal g = new GaussianKernal(d);
                        Triangular tr = new Triangular(d);
                        _presenter.OnSetDistribution(d,tr);
                        _intervalsCount = Int32.Parse(intervalsLengthTextBox.Text.Trim());
                        _presenter.OnGetBarChart(_intervalsCount);/*отправили в модель*/
                        _FP = mx;
                        _SP = dx;
                        break;
                    }
                case 1:
                    {
                        double alpha = Double.Parse(alphaTetxBox.Text.Trim().Replace('.', ','));
                        double beta = Double.Parse(betaTextBox.Text.Trim().Replace('.', ','));
                        _samplingLenght = Int32.Parse(AmountVibTextBox.Text.Trim().Replace('.', ','));
                        VibrullDistribution vib = new VibrullDistribution(alpha, beta, _samplingLenght);
                        GaussianKernal gk = new GaussianKernal(vib);
                        _presenter.OnSetDistribution(vib,gk);
                        _intervalsCount = Int32.Parse(VIntervalsLenghtTextBox.Text.Trim());
                        _presenter.OnGetBarChart(_intervalsCount);
                        _FP = alpha;
                        _SP = beta;
                        break;
                    }
                case 2:
                    {
                        double inten = Double.Parse(IntenTextBox.Text.Trim().Replace('.', ','));
                        _samplingLenght = Int32.Parse(ExponAmountSapmlingTextBox.Text.Trim());
                        ExponentialDistribution expon = new ExponentialDistribution(inten, _samplingLenght);
                        GaussianKernal gk = new GaussianKernal(expon);
                        _presenter.OnSetDistribution(expon, gk);
                        _intervalsCount = Int32.Parse(ExpAmoubtIntervalsTextBox.Text.Trim());
                        _presenter.OnGetBarChart(_intervalsCount);
                        _FP = inten;
                        _SP = 0;
                        break;
                    }
                case 3:
                    {
                        double mu = Double.Parse(MutextBox.Text.Trim().Replace('.', ','));
                        double lambda = Convert.ToDouble(LambdatextBox.Text.Trim().Replace('.', ','));
                        _samplingLenght = Int32.Parse(VtextBox.Text.Trim());
                        LaplasDistribution laplas = new LaplasDistribution(mu, lambda, _samplingLenght);
                        GaussianKernal gk = new GaussianKernal(laplas);
                        _presenter.OnSetDistribution(laplas, gk);
                        _intervalsCount = Int32.Parse(LAmountTextBox.Text.Trim());
                        _presenter.OnGetBarChart(_intervalsCount);
                        _FP = mu;
                        _SP = lambda;
                        break;
                    }
                case 4:
                    {
                        double a = Double.Parse(aUniformTextBox.Text.Trim().Replace('.', ','));
                        double b = Double.Parse(bUniformTextBox.Text.Trim().Replace('.', ','));
                        _samplingLenght = Int32.Parse(USLenghtTextBox.Text.Trim());
                        UniformDistributions uniforn = new UniformDistributions(a, b, _samplingLenght);
                        GaussianKernal gk = new GaussianKernal(uniforn);
                        _presenter.OnSetDistribution(uniforn, gk);
                        _intervalsCount = Int32.Parse(CoolIntUniform.Text.Trim());
                        _presenter.OnGetBarChart(_intervalsCount);
                        _FP = a;
                        _SP = b;
                        break;
                    }
                case 5:
                    {
                        //double aC = Double.Parse(aCTextBox.Text.Trim().Replace('.', ','));
                        //double muC = Double.Parse(muCTextBox.Text.Trim().Replace('.', ','));
                        //_samplingLenght = Int32.Parse(VCTextBox.Text.Trim());
                        //CauchyDistribution c = new CauchyDistribution(aC, muC, _samplingLenght);
                        //GaussianKernal gk = new GaussianKernal(c);
                        //_presenter.OnSetDistribution(c,gk);
                        //_intervalsCount = Int32.Parse(CCTextBox.Text.Trim());
                        //_presenter.OnGetBarChart(_intervalsCount);
                        //_FP = aC;
                        //_SP = muC;
                        break;
                    }
            }



        }