Пример #1
0
        /// <summary>
        ///   Changes the sets that will be checked by DCCA, by reordering and adding sets.
        /// </summary>
        /// <param name="cardinalityLevel">The level of cardinality that is currently checked.</param>
        /// <param name="setsToCheck">The next sets to be checked, in reverse order (the last set is checked first).</param>
        public void Augment(uint cardinalityLevel, LinkedList <FaultSet> setsToCheck)
        {
            if (setsToCheck.Count == 0 || _minimalCriticalSets.Count == 0 || _cardinalityLevel > cardinalityLevel || !_hasNewMinimalCriticalSets)
            {
                return;
            }

            _suggestedSets.Clear();
            _hasNewMinimalCriticalSets = false;

            foreach (var set in RemoveAllFaults(new FaultSet(), 0))
            {
                setsToCheck.AddFirst(_allFaults.GetDifference(set));
                _suggestedSets.Add(_allFaults.GetDifference(set));
            }
        }
        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)
                );
        }