private ISet <FaultSet> GetSubsets(IEnumerable <FaultSet> sets) { return(new HashSet <FaultSet>( from set in sets // get a subset of size subsetStepSize from subset in GetSubsets(set, _subsetStepSize) // remove all faults in the subset and their subsuming faults let suggestion = set.GetDifference(FaultSet.SubsumingFaults(subset, _allFaults)) select suggestion )); }
private void CollectSuggestions(IEnumerable <IEnumerable <Fault> > faultGroups) { var faults = new FaultSet(_allFaults); _currentSuggestions = new HashSet <FaultSet>( // one fault of each group is not activated (try all combinations) from excludedFaults in CartesianProduct(faultGroups) // also exclude subsuming faults let subsuming = FaultSet.SubsumingFaults(excludedFaults, _allFaults) orderby subsuming.Cardinality ascending select faults.GetDifference(subsuming) ); }