Beispiel #1
0
        public void generatePoissonRandom()
        {
            StreamWriter writer = new StreamWriter("result.csv");
            double       lambda = (double.Parse(lambdaTextBox.Text));

            for (int i = 0; i < int.Parse(jumlahTextBox.Text); i++)
            {
                writer.WriteLine(SimpleRNG.GetPoisson(lambda));
            }
            writer.Close();
        }
Beispiel #2
0
        public void generateLogNormalRandom()
        {
            StreamWriter writer = new StreamWriter("result.csv");
            double       sigma  = (double.Parse(sigmaTextBox.Text));
            double       mu     = (double.Parse(muTextBox.Text));

            for (int i = 0; i < int.Parse(jumlahTextBox.Text); i++)
            {
                writer.WriteLine(SimpleRNG.GetLogNormal(mu, sigma));
            }
            writer.Close();
        }
Beispiel #3
0
        public void generateEksRandom()
        {
            StreamWriter writer = new StreamWriter("result.csv");

            try
            {
                double mean = (double.Parse(meanEksTextBox.Text));
                for (int i = 0; i < int.Parse(jumlahTextBox.Text); i++)
                {
                    writer.WriteLine(SimpleRNG.GetExponential(mean));
                }
            }catch (System.FormatException)
            {
                for (int i = 0; i < int.Parse(jumlahTextBox.Text); i++)
                {
                    writer.WriteLine(SimpleRNG.GetExponential());
                }
            }

            writer.Close();
        }
Beispiel #4
0
        public void generateNormalRandom()
        {
            double       mean, deviasi;
            StreamWriter writer = new StreamWriter("result.csv");

            try
            {
                mean    = double.Parse(meanTextBox.Text);
                deviasi = double.Parse(deviasiTextBox.Text);
                for (int i = 0; i < int.Parse(jumlahTextBox.Text); i++)
                {
                    writer.WriteLine(SimpleRNG.GetNormal(mean, deviasi) + ",");
                }
            }
            catch (System.FormatException)
            {
                for (int i = 0; i < int.Parse(jumlahTextBox.Text); i++)
                {
                    writer.WriteLine(SimpleRNG.GetNormal() + ",");
                }
            }
            writer.Close();
        }