Exemplo n.º 1
0
        /// <summary>
        ///   Informs the heuristic of the result of analyzing <paramref name="checkedSet" />
        ///   and allows it to adapt the sets to check next.
        /// </summary>
        public void Update(LinkedList <FaultSet> setsToCheck, FaultSet checkedSet, bool isSafe)
        {
            // Ignore critical sets we've suggested ourself as these are likely not minimal and
            // would degrade the quality of our suggestions
            if (isSafe || _suggestedSets.Contains(checkedSet))
            {
                return;
            }

            _hasNewMinimalCriticalSets = true;
            _minimalCriticalSets.Add(checkedSet.ToFaultSequence(_modelFaults).ToArray());
        }
Exemplo n.º 2
0
            /// <summary>
            ///   Converts the integer-based set to a set faults.
            /// </summary>
            private static ISet <Fault> Convert(Dictionary <FaultSet, ISet <Fault> > knownSets, FaultSet set, Fault[] faults)
            {
                ISet <Fault> faultSet;

                if (knownSets.TryGetValue(set, out faultSet))
                {
                    return(faultSet);
                }

                faultSet = new HashSet <Fault>(set.ToFaultSequence(faults));
                knownSets.Add(set, faultSet);

                return(faultSet);
            }
        /// <summary>
        ///   Converts the integer-based set to a set faults.
        /// </summary>
        private ISet <Fault> Convert(Dictionary <FaultSet, ISet <Fault> > knownSets, FaultSet set)
        {
            ISet <Fault> faultSet;

            if (knownSets.TryGetValue(set, out faultSet))
            {
                return(faultSet);
            }

            faultSet = new HashSet <Fault>(set.ToFaultSequence(RuntimeModelCreator.FaultsInBaseModel));
            knownSets.Add(set, faultSet);

            return(faultSet);
        }
		/// <summary>
		///   Informs the heuristic of the result of analyzing <paramref name="checkedSet" />
		///   and allows it to adapt the sets to check next.
		/// </summary>
		public void Update(LinkedList<FaultSet> setsToCheck, FaultSet checkedSet, bool isSafe)
		{
			// Ignore critical sets we've suggested ourself as these are likely not minimal and
			// would degrade the quality of our suggestions
			if (isSafe || _suggestedSets.Contains(checkedSet))
				return;

			_hasNewMinimalCriticalSets = true;
			_minimalCriticalSets.Add(checkedSet.ToFaultSequence(_model.Faults).ToArray());
		}
Exemplo n.º 5
0
		/// <summary>
		///   Converts the integer-based set to a set faults.
		/// </summary>
		private ISet<Fault> Convert(Dictionary<FaultSet, ISet<Fault>> knownSets, FaultSet set)
		{
			ISet<Fault> faultSet;
			if (knownSets.TryGetValue(set, out faultSet))
				return faultSet;

			faultSet = new HashSet<Fault>(set.ToFaultSequence(Model.Faults));
			knownSets.Add(set, faultSet);

			return faultSet;
		}