Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        internal static IAnalysisPhaseOnePartTwo CreateAnalysisPhaseOnePartTwo(
            PhaseOnePartTwoAnalysisKind phaseOnePartTwo, ParametersPack args)
        {
            phaseOnePartTwo.ThrowIfNull(nameof(phaseOnePartTwo));

            if (PhaseOnePartTwoAnalysisKind.BetaDistributionWithScott.Equals(phaseOnePartTwo))
            {
                return(new BetaDistributionAnalysisPhaseOnePartTwo(
                           new ScottFrequencyHistogramBuilder(args), args
                           ));
            }
            if (PhaseOnePartTwoAnalysisKind.BetaDistributionWithSturges.Equals(phaseOnePartTwo))
            {
                // TODO: add formulas for solution based on Sturges's formula.
                throw new NotImplementedException(
                          "Sturges's analysis for phase 1 part 2 is not implemented."
                          );
            }

            throw new ArgumentOutOfRangeException(
                      nameof(phaseOnePartTwo), phaseOnePartTwo,
                      $"Unknown analysis kind for phase 1 part 2 value: {phaseOnePartTwo.ToLogString()}"
                      );
        }