public UniformAdaptiveCompetitorRandom(UniformAdaptiveCompetitorModel model, ExperimentHistory history, double holeSize, double ballSize)
 {
     this._model = model;
     this._history = history;
     _holeSize = holeSize;
     _ballSize = ballSize;
 }
        public void Sample()
        {
            #region Конфигурирование
            var adaptiveCompetitorModel = new UniformAdaptiveCompetitorModel
            {
                HitProbabilityFactorIfPlayerHit = 1.2,
                HitProbabilityFactorIfPlayerMissed = 1,
                PlayerHistorySamples = new List<PlayerHistorySample>
                {
                    new PlayerHistorySample
                    {
                        GameTitle = "Game"
                    }
                }
            };

            var history = CreateHistory(hitCount: 50, size: 100, lastStrikeHit: true);

            var holeSize = 2;
            var ballSize = 1;

            #endregion

            var newSamples = new List<double>();

            var generator = new UniformAdaptiveCompetitorRandom(adaptiveCompetitorModel, history, holeSize, ballSize);

            var sampesSize = 1000;

            for (var j = 0; j < sampesSize; j++)
            {
                newSamples.Add(generator.Sample());
            }

            #region Оценка ошибки

            var a = (holeSize - ballSize)/2.0;

            double hitCounts = newSamples.Count(newSample => Math.Abs(newSample) < a);

            #endregion

            Assert.IsTrue(Math.Abs(hitCounts/sampesSize - 0.6) < 0.05);
        }
        public void Sample3()
        {
            #region Конфигурирование
            var adaptiveCompetitorModel = new UniformAdaptiveCompetitorModel
            {
                HitProbabilityFactorIfPlayerHit = 1,
                HitProbabilityFactorIfPlayerMissed = 0,
                PlayerHistorySamples = new List<PlayerHistorySample>
                {
                    new PlayerHistorySample
                    {
                        GameTitle = "Game"
                    }
                }
            };

            var history = CreateHistory(hitCount: 50, size: 100, lastStrikeHit: false);

            var holeSize = 2;
            var ballSize = 1;

            #endregion

            var newSamples = new List<double>();

            var generator = new UniformAdaptiveCompetitorRandom(adaptiveCompetitorModel, history, holeSize, ballSize);

            generator.Sample();
        }