Beispiel #1
0
        private async Task <int> PerformOneIterationOfPartOneAsync(
            ExcelContextForPhaseOne <IAnalysisPhaseOnePartOne> excelContext)
        {
            using FileObject fileObject = await AnalysisRunner.PerformOneIterationOfPhaseOneAsync(
                      excelContext.Args, excelContext.LaunchContext, _fileWorker
                      );

            return(_excelWrapperPartOne.ApplyAnalysisAndSaveData(
                       fileObject.Data.GetData(item => item.operationNumber), excelContext
                       ));
        }
        private async Task <AnalysisPhaseTwoResult> PerformPhaseTwoAsync(AnalysisContext context)
        {
            var excelContext = CreateExcelContext(context);

            await AnalysisRunner.PerformFullAnalysisForPhaseTwoAsync(
                args : context.Args,
                launchContext : context.LaunchContext,
                fileWorker : _fileWorker,
                asyncCallback : fileObject => PerformOneIterationASync(excelContext, fileObject)
                );

            _excelWrapperForPhaseTwo.ApplyAnalysisAndSaveData(excelContext);

            return(new AnalysisPhaseTwoResult());
        }
Beispiel #3
0
        private async Task <AnalysisPhaseOnePartTwoResult> PerfromPartTwoAsync(
            AnalysisContext context, AnalysisPhaseOnePartOneResult partOneResult)
        {
            _logger.Info("Starting analysis phase one part two.");

            var excelContext = CreateExcelContextPartTwo(context, partOneResult);

            _logger.Info($"Final parameters pack: {excelContext.Args.ToLogString()}");

            // Perform the final iteration to get actual data using calculated sample size.
            using FileObject fileObject = await AnalysisRunner.PerformOneIterationOfPhaseOneAsync(
                      excelContext.Args, excelContext.LaunchContext, _fileWorker
                      );

            bool isH0HypothesisProved = _excelWrapperPartTwo.ApplyAnalysisAndSaveData(
                fileObject.Data.GetData(item => item.operationNumber), excelContext
                );

            _logger.Info("Finished analysis phase one part two.");
            _logger.Info(
                $"H0 hypothesis for the algorithm was proved: '{isH0HypothesisProved.ToString()}'."
                );
            return(new AnalysisPhaseOnePartTwoResult(partOneResult, isH0HypothesisProved));
        }