private void DisplayTestResults(TournamentStrategy tournamentStrategy, MatchStrategy matchStrategy, Study study)
 {
     Trace.WriteLine(string.Format("Number of Tournament Iterations: {0}", _numberOfTournamentIterations));
     Trace.WriteLine(study.StrategyInformation);
 }
        public Study(TournamentStrategy tournamentStrategy, MatchStrategy matchStrategy, bool isLowMemoryMode)
        {
            _matchStrategy = matchStrategy;
            _thisTournamentStrategy = tournamentStrategy;
            _isLowMemoryMode = isLowMemoryMode;

            if (!_isLowMemoryMode)
                _tournaments = new List<Tournament>();

            _tournamentMADs = new List<double>();
            _tournamentMAD_Adjusteds = new List<double>();
            _tournamentMAD_Adjusted_WithOddCompetitorAdjustments = new List<double>();

        }
        private void RunStudy(List<Competitor> competitors, TournamentStrategy tournamentStrategy, MatchStrategy matchStrategy, bool isJumbleCompetitorSeeds)
        {
            _currentIteration = 0;
            _startTime = DateTime.Now;

            Study study = new Study(tournamentStrategy, matchStrategy, chkIsLowMemoryMode.Checked);
            study.Iterated += new IteratedEventHandler(StudyIterated);

            if (!string.IsNullOrEmpty(txtResults.Text.Trim()))
                AppendResultsText("\r\n\r\n");

            AppendResultsText("===============================================================================================");

            try
            {
                study.Run(competitors, _numberOfTournamentIterations, isJumbleCompetitorSeeds);

                AppendResultsText(study.StrategyInformation);
                if (chkShowStudyStatistics.Checked) AppendResultsText(study.ResultsStatistics);
                if (chkShowStudyTransformationMatrix.Checked) AppendResultsText(study.CombinedTournamentTransformationMatrixForDisplay.ToString());
                if (chkShowCompetitorInfo.Checked) AppendResultsText(study.CompetitorInformation);
                if (chkShowResultsFrequenciesGraph.Checked) AppendResultsText(study.ResultsFrequenciesGraph);
                if (chkShowRawTournamentResults.Checked) AppendResultsText(study.RawTournamentResultsForDisplay);
                if (chkShowRunTime.Checked) AppendResultsText(string.Format("\r\n\r\nRun Time: {0}", DateTime.Now.Subtract(_startTime)));
            }
            catch (Exception ex)
            {
                AppendResultsText(string.Format("\r\n\r\nTournament Strategy: {0}", study.TournamentStrategyForDisplay));
                AppendResultsText(string.Format("\r\n\r\nCould not run this study. Error: {0}", ex.Message));
            }
            finally
            {
                study = null;
            }
        }
 private void RunStudy(List<Competitor> competitors, TournamentStrategy tournamentStrategy, MatchStrategy matchStrategy)
 {
     RunStudy(competitors, tournamentStrategy, matchStrategy, false);
 }
        private static void DisplayTestResults(TournamentStrategy tournamentStrategy, MatchStrategy matchStrategy, Study study)
        {
            Trace.WriteLine("Study Parameters:");
            Trace.WriteLine(string.Format("Tournament Strategy: {0}", tournamentStrategy.GetType()));
            Trace.WriteLine(string.Format("Match Strategy: {0}", matchStrategy.GetType()));
            Trace.WriteLine(string.Format("Number of Tournament Iterations: {0}", _numberOfTournamentIterations));

            Trace.WriteLine("");
            Trace.WriteLine(study.StrategyInformation);
        }
 public Tournament(TournamentStrategy tournamentStrategy, MatchStrategy matchStrategy)
 {
     _matchStrategy = matchStrategy;
     _tournamentStrategy = tournamentStrategy;
 }