Exemplo n.º 1
0
        public void Construction()
        {
            var factory = SmallRng.GetFactory();
            var rng     = factory.Create();

            Assert.True(Statistics.TestMonobitFrequency32(rng, 100_000, Statistics.WideZScore));
            Assert.True(Statistics.TestMonobitFrequency64(rng, 100_000, Statistics.WideZScore));
            Assert.True(Statistics.TestMonobitFrequencyFill(rng, 100_000, Statistics.WideZScore));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Changes the current medium, and resets the program.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MaterialsList_SelectedIndexChanged(object sender, EventArgs e)
        {
            _timer.Enabled        = false;
            _startButton.Enabled  = true;
            _pauseButton.Enabled  = false;
            _resumeButton.Enabled = false;
            _clearButton.Enabled  = false;
            _timeElapsed          = 0;
            _timeShown.Text       = _timeElapsed.ToString("E03");

            int selected = _materialsList.SelectedIndex;

            if (selected == 5)
            {
                var rng = SmallRng.Create();
                selected = _dist.Sample(rng);
            }

            if (selected == 0)
            {
                _current = _glass;
            }
            else if (selected == 1)
            {
                _current = _diamond;
            }
            else if (selected == 2)
            {
                _current = _water;
            }
            else if (selected == 3)
            {
                _current = _air;
            }
            else if (selected == 4)
            {
                _current = _brett;
            }


            _ycurrent = new YValues();
            _ypast    = new YValues();
            _yfuture  = new YValues();
        }