public override void BuildMatch() { IList <ITeam> list1 = new List <ITeam>(TeamList); IList <ITeam> list2 = new List <ITeam>(TeamList); MatchList.Clear(); foreach (var team1 in list1) { foreach (var team2 in list2) { if (team1 == team2 || MatchList.Count(item => item.Team1 == team1 && item.Team2 == team2 || item.Team1 == team2 && item.Team2 == team1) != 0) { continue; } CreateMatch(team1, team2); if (!MatchWithRevenge) { continue; } CreateMatch(team2, team1); } } }
/// <summary> /// Function to call to re-calculate algorithm results. /// </summary> public void MatchFeatures() { MatchList.Clear(); MatchList = FindMatches(m_observedFeatureList, m_targetFeatureList, m_matchParameters.UserTolerances, 0); var lengthCheck = (MatchList.Count >= MIN_MATCHES_FOR_NORMAL_ASSUMPTION); if (m_matchParameters.ShouldCalculateSTAC && lengthCheck) { var stacInformation = new STACInformation(m_matchParameters.UseDriftTime); // Attach the event handlers stacInformation.MessageEvent += StacInformationMessageHandler; ReportMessage("Performing STAC"); PerformStac(stacInformation); // Add the Refined Tolerances that STAC calculated RefinedToleranceList.Add(stacInformation.RefinedTolerances); StacParameterList.Add(stacInformation); ReportMessage("Populating FDR table"); StacFdrTable = PopulateStacfdrTable(MatchList); } if (m_matchParameters.ShouldCalculateHistogramFDR) { ReportMessage("Setting Mass Error Histogram FDR"); SetMassErrorHistogramFdr(); } if (m_matchParameters.ShouldCalculateShiftFDR) { ReportMessage("Calculating Shift FDR"); foreach (var t in MatchList) { t.InRegion(RefinedToleranceList[0], m_matchParameters.UseEllipsoid); } var count = MatchList.Count(t => t.WithinRefinedRegion); ShiftedMatchList.AddRange(FindMatches(m_observedFeatureList, m_targetFeatureList, RefinedToleranceList[0], m_matchParameters.ShiftAmount)); ShiftFdr = (1.0 * count) / ShiftedMatchList.Count; ShiftConservativeFdr = (2.0 * count) / ShiftedMatchList.Count; } OnProcessingComplete(new ProgressNotifierArgs("Processing Complete")); }