Exemplo n.º 1
0
		/// <summary>
		///   Checks the <see cref="faults" /> for criticality using the <see cref="activation" /> mode.
		/// </summary>
		/// <param name="faults">The fault set that should be checked for criticality.</param>
		/// <param name="activation">The activation mode of the fault set.</param>
		internal override AnalysisResult CheckCriticality(FaultSet faults, Activation activation)
		{
			var suppressedFaults = new FaultSet();
			foreach (var fault in Model.Faults)
			{
				if (GetEffectiveActivation(fault, faults, activation) == Activation.Suppressed)
					suppressedFaults = suppressedFaults.Add(fault);
			}

			_checker.Context.TraversalParameters.TransitionModifiers.Clear();
			_checker.Context.TraversalParameters.TransitionModifiers.Add(() => new FaultSuppressionModifier(suppressedFaults));

			return _checker.Check();
		}
Exemplo n.º 2
0
        /// <summary>
        ///   Checks the <see cref="faults" /> for criticality using the <see cref="activation" /> mode.
        /// </summary>
        /// <param name="faults">The fault set that should be checked for criticality.</param>
        /// <param name="activation">The activation mode of the fault set.</param>
        internal override InvariantAnalysisResult CheckCriticality(FaultSet faults, Activation activation)
        {
            var suppressedFaults = new FaultSet();

            foreach (var fault in RuntimeModelCreator.FaultsInBaseModel)
            {
                if (GetEffectiveActivation(fault, faults, activation) == Activation.Suppressed)
                {
                    suppressedFaults = suppressedFaults.Add(fault);
                }
            }

            _checker.ModelTraverser.Context.TraversalParameters.TransitionModifiers.Clear();
            _checker.ModelTraverser.Context.TraversalParameters.TransitionModifiers.Add(() => new FaultSuppressionModifier(suppressedFaults));

            return(_checker.Check());
        }
Exemplo n.º 3
0
        /// <summary>
        ///   Gets all combinations of fault sets that have one fault of each minimal critical fault set removed.
        /// </summary>
        private IEnumerable <FaultSet> RemoveAllFaults(FaultSet removed, int setIndex)
        {
            if (setIndex >= _minimalCriticalSets.Count)
            {
                yield return(removed);
            }
            else
            {
                foreach (var fault in _minimalCriticalSets[setIndex].Where(f => f.Activation != Activation.Forced))
                {
                    var next = removed.Contains(fault) ? removed : removed.Add(fault);

                    foreach (var set in RemoveAllFaults(next, setIndex + 1))
                    {
                        yield return(set);
                    }
                }
            }
        }
		/// <summary>
		///   Gets all combinations of fault sets that have one fault of each minimal critical fault set removed.
		/// </summary>
		private IEnumerable<FaultSet> RemoveAllFaults(FaultSet removed, int setIndex)
		{
			if (setIndex >= _minimalCriticalSets.Count)
				yield return removed;
			else
			{
				foreach (var fault in _minimalCriticalSets[setIndex].Where(f => f.Activation != Activation.Forced))
				{
					var next = removed.Contains(fault) ? removed : removed.Add(fault);

					foreach (var set in RemoveAllFaults(next, setIndex + 1))
						yield return set;
				}
			}
		}