public AnalysisContext(
     ParametersPack args,
     AnalysisLaunchContext launchContext,
     FileInfo outputExcelFile,
     PhaseOnePartOneAnalysisKind phaseOnePartOne,
     PhaseOnePartTwoAnalysisKind phaseOnePartTwo,
     PhaseTwoAnalysisKind phaseTwo,
     GoodnessOfFitKind goodnessOfFit)
 {
     Args            = args.ThrowIfNull(nameof(args));
     LaunchContext   = launchContext.ThrowIfNull(nameof(launchContext));
     OutputExcelFile = outputExcelFile.ThrowIfNull(nameof(outputExcelFile));
     PhaseOnePartOne = phaseOnePartOne.ThrowIfNull(nameof(phaseOnePartOne));
     PhaseOnePartTwo = phaseOnePartTwo.ThrowIfNull(nameof(phaseOnePartTwo));
     PhaseTwo        = phaseTwo.ThrowIfNull(nameof(phaseTwo));
     GoodnessOfFit   = goodnessOfFit.ThrowIfNull(nameof(goodnessOfFit));
 }
Exemplo n.º 2
0
        internal static IFunctionSelector CreateGoodnessOfFit(GoodnessOfFitKind goodnessOfFit)
        {
            goodnessOfFit.ThrowIfNull(nameof(goodnessOfFit));

            if (GoodnessOfFitKind.CoefficientOfDetermination.Equals(goodnessOfFit))
            {
                return(new FunctionSelectorBasedOnCoefficientOfDetermination());
            }
            if (GoodnessOfFitKind.RSquaredValue.Equals(goodnessOfFit))
            {
                return(new FunctionSelectorBasedOnRSquaredValue());
            }

            throw new ArgumentOutOfRangeException(
                      nameof(goodnessOfFit), goodnessOfFit,
                      $"Unknown goodness of fit kind value: {goodnessOfFit.ToLogString()}"
                      );
        }