Ejemplo n.º 1
0
        private void StartButtonPressed(object sender, RoutedEventArgs args)
        {
            try
            {
                Int32 aCoeff = ReadInt32(ACoeffInput);
                Int32 mCoeff = ReadInt32(MCoeffInput);
                if (mCoeff == 0)
                {
                    throw new Exception("M coefficient must be a positive value!");
                }
                Int32 startingNumber = ReadInt32(StartingValueInput);

                LemerGenerator lg = new LemerGenerator(aCoeff, mCoeff, startingNumber);
                lg.GenerateRealization();
                IList<Double> lemerRealization = lg.Realization;

                StatisticsResults sr = new StatisticsResults();
                sr.Calculate(lemerRealization);

                OutStatisticsResults(sr);
                DrawHistogram(sr);
            }
            catch (Exception e)
            {
                MessageWindow mw = new MessageWindow(this, e.Message);
                mw.ShowDialog();
                
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("aCoeff");
            Int32 aCoeff = ReadInt32();
            System.Console.WriteLine("mCoeff");
            Int32 mCoeff = ReadInt32();
            System.Console.WriteLine("startingNumber");
            Int32 startingNumber = ReadInt32();

            LemerGenerator lg = new LemerGenerator(aCoeff, mCoeff, startingNumber);
            lg.GenerateRealization();
            IList<Double> lemerRealization = lg.Realization;

            StatisticsResults sr = new StatisticsResults();
            sr.Calculate(lemerRealization);

            OutStatitisticsResults(sr);
        }