예제 #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
                       ));
        }
예제 #2
0
        private static ExcelContextForPhaseOne <IAnalysisPhaseOnePartOne> CreateExcelContextPartOne(
            AnalysisContext context, int iterationNumber, int calculatedSampleSize)
        {
            Func <ParametersPack, IAnalysisPhaseOnePartOne> analysisFactory =
                args => AnalysisHelper.CreateAnalysisPhaseOnePartOne(
                    context.PhaseOnePartOne, args
                    );

            return(ExcelContextForPhaseOne <IAnalysisPhaseOnePartOne> .CreateFor(
                       args : context.Args.CreateWith(calculatedSampleSize),
                       launchContext : context.LaunchContext,
                       outputExcelFile : context.OutputExcelFile,
                       sheetName : ExcelHelper.CreateSheetName(PhaseNumber, iterationNumber),
                       analysisFactory : analysisFactory
                       ));
        }
예제 #3
0
        private static ExcelContextForPhaseOne <IAnalysisPhaseOnePartTwo> CreateExcelContextPartTwo(
            AnalysisContext context, AnalysisPhaseOnePartOneResult partOneResult)
        {
            string sheetName =
                ExcelHelper.CreateSheetName(PhaseNumber, partOneResult.TotalIterationNumber);

            Func <ParametersPack, IAnalysisPhaseOnePartTwo> analysisFactory =
                args => AnalysisHelper.CreateAnalysisPhaseOnePartTwo(context.PhaseOnePartTwo, args);

            return(ExcelContextForPhaseOne <IAnalysisPhaseOnePartTwo> .CreateFor(
                       args : context.Args,
                       launchContext : context.LaunchContext,
                       outputExcelFile : context.OutputExcelFile,
                       sheetName : sheetName,
                       analysisFactory : analysisFactory
                       ));
        }