private string GetCategoryAt(double distance, FailureMechanismResultInformation fmResultInfo) { var endSections = fmResultInfo.SectionList.Select(it => it.EndDistance).ToList(); int index = endSections.FindIndex(it => distance < it); var label = fmResultInfo.SectionList[index].AssemblyGroup; return(label); }
private double PCombin2(FailureMechanismResultInformation fmResultInfo) { var maxPdsn = fmResultInfo.SectionList.Select(sc => sc.CalculationFailureProbPerProfile). Select(fraction => fraction.Substring(2).ToNoGroupSeparator()). Where(denom => denom != "Oneindig"). Select(denom => 1.0 / Double.Parse(denom)).Max(); var probMechanism2 = maxPdsn * Double.Parse(N_FM); return(probMechanism2); }
private double PCombin1(FailureMechanismResultInformation fmResultInfo) { double productInverseFailureProbability = 1.0; foreach (var section in fmResultInfo.SectionList) { var denominator = section.CalculationFailureProbPerSection.Substring(2).ToNoGroupSeparator(); if (denominator != "Oneindig") { productInverseFailureProbability = productInverseFailureProbability * (1.0 - 1.0 / Double.Parse(denominator)); } } double failureProbFMMech1 = 1.0 - productInverseFailureProbability; return(failureProbFMMech1); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 0; Keyboard.DefaultKeyPressTime = 0; Delay.SpeedFactor = 0; var fmAssessmentInformation = new FailureMechanismResultInformation(); fmAssessmentInformation.Label = labelFM; var repo = global::AutomatedSystemTests.AutomatedSystemTestsRepository.Instance; var rowsSectionsDivisions = repo.RiskeerMainWindow.ContainerMultipleViews.DocumentViewContainer.FMSectionsViewTable.Rows; var sectionIndeces = GetColumnIndecesSectionsView(rowsSectionsDivisions[0]); rowsSectionsDivisions.RemoveAt(0); foreach (var row in rowsSectionsDivisions) { fmAssessmentInformation.SectionList.Add(CreateSectionFromRow(row, sectionIndeces)); } var trajectAssessmentInformation = TrajectResultInformation.BuildAssessmenTrajectInformation(trajectAssessmentInformationString); trajectAssessmentInformation.ListFMsResultInformation.Add(fmAssessmentInformation); trajectAssessmentInformationString = JsonConvert.SerializeObject(trajectAssessmentInformation, Formatting.Indented); }
private double CalculateExpectedFailureProbFM(FailureMechanismResultInformation fmResultInfo) { return(Math.Min(PCombin1(fmResultInfo), PCombin2(fmResultInfo))); }