public RoundRobinVisitContextFactory(Test test, bool distributeEvenlyForSubGroups = true)
        {
            DistributeEvenlyForSubGroups = distributeEvenlyForSubGroups;

            Test = test;
            _counters = new Dictionary<long, RoundRobinCounter>();
            _rules = Test.Experiences.SelectMany(e => e.Levels.Keys.OfType<PersonalizationRule>()).Distinct().ToArray();
        }
예제 #2
0
파일: Test.cs 프로젝트: BIGANDYT/colossus
        public static Test FromFactors(params ExperienceFactor[] factors)
        {
            var test = new Test(factors);
            test.Experiences = new RoundRobinCounter(factors.Select(f => f.Levels.Length).ToArray(), false).All
                .Select((combination, i) =>
                    new Experience
                    {
                        Test = test,
                        Number = i + 1,
                        Levels = combination.ToDictionary((level, j) => factors[j], (level, j) => level)
                    }).ToList();

            return test;
        }