Exemplo n.º 1
0
        public FailureMechanismSectionAssemblyResultWrapper AssembleFailureMechanismSection(FailureMechanismSectionAssemblyInput input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            try
            {
                IAssessmentResultsTranslator kernel = factory.CreateFailureMechanismSectionAssemblyKernel();

                if (!IsProbabilityDefined(input))
                {
                    return(AssembleWithUndefinedProbabilities(input, kernel));
                }

                Probability sectionProbability = kernel.DetermineRepresentativeProbabilityBoi0A1(
                    input.FurtherAnalysisType != FailureMechanismSectionResultFurtherAnalysisType.NotNecessary,
                    AssemblyCalculatorInputCreator.CreateProbability(input.InitialSectionProbability),
                    AssemblyCalculatorInputCreator.CreateProbability(input.RefinedSectionProbability));
                EInterpretationCategory interpretationCategory = AssembleInterpretationCategory(input, kernel, sectionProbability);

                return(new FailureMechanismSectionAssemblyResultWrapper(
                           FailureMechanismSectionAssemblyResultCreator.Create(sectionProbability, interpretationCategory),
                           AssemblyMethod.BOI0A1, AssemblyMethod.BOI0B1));
            }
            catch (AssemblyException e)
            {
                throw new FailureMechanismSectionAssemblyCalculatorException(AssemblyErrorMessageCreator.CreateErrorMessage(e.Errors), e);
            }
            catch (Exception e)
            {
                throw new FailureMechanismSectionAssemblyCalculatorException(AssemblyErrorMessageCreator.CreateGenericErrorMessage(), e);
            }
        }
        public void CreateFailureMechanismSectionAssemblyKernel_Always_ReturnsKernelAssessmentResultsTranslator()
        {
            // Setup
            IAssemblyToolKernelFactory factory = AssemblyToolKernelFactory.Instance;

            // Call
            IAssessmentResultsTranslator kernel = factory.CreateFailureMechanismSectionAssemblyKernel();

            // Assert
            Assert.IsInstanceOf <AssessmentResultsTranslator>(kernel);
        }
Exemplo n.º 3
0
        private EInterpretationCategory AssembleInterpretationCategory(FailureMechanismSectionAssemblyInput input, IAssessmentResultsTranslator kernel, Probability probability)
        {
            ICategoryLimitsCalculator assemblyGroupsKernel = factory.CreateAssemblyGroupsKernel();
            CategoriesList <InterpretationCategory> interpretationCategories = assemblyGroupsKernel.CalculateInterpretationCategoryLimitsBoi01(
                new AssessmentSection(AssemblyCalculatorInputCreator.CreateProbability(input.SignalFloodingProbability),
                                      AssemblyCalculatorInputCreator.CreateProbability(input.MaximumAllowableFloodingProbability)));

            return(kernel.DetermineInterpretationCategoryFromFailureMechanismSectionProbabilityBoi0B1(
                       probability, interpretationCategories));
        }
Exemplo n.º 4
0
        private static FailureMechanismSectionAssemblyResultWrapper AssembleWithUndefinedProbabilities(FailureMechanismSectionAssemblyInput input, IAssessmentResultsTranslator kernel)
        {
            EInterpretationCategory interpretationCategory = kernel.DetermineInterpretationCategoryWithoutProbabilityEstimationBoi0C1(GetAnalysisStatus(input));
            Probability             sectionProbability     = kernel.TranslateInterpretationCategoryToProbabilityBoi0C2(interpretationCategory);

            return(new FailureMechanismSectionAssemblyResultWrapper(
                       FailureMechanismSectionAssemblyResultCreator.Create(sectionProbability, interpretationCategory),
                       AssemblyMethod.BOI0C2, AssemblyMethod.BOI0C1));
        }
Exemplo n.º 5
0
 public void Init()
 {
     translator = new AssessmentResultsTranslator();
 }