Beispiel #1
0
        public void CalculateProbabilityRange()
        {
            var model = new ExampleModelBase();

            var tc = SafetySharpModelChecker.TraversalConfiguration;

            tc.WriteGraphvizModels = true;
            SafetySharpModelChecker.TraversalConfiguration = tc;

            var result = SafetySharpModelChecker.CalculateProbabilityRangeToReachStateBounded(model, model.ModelComponent.HazardActive, 50);

            Console.Write($"Probability of hazard: {result}");
        }
Beispiel #2
0
        public void CalculateDcca()
        {
            var model = new ExampleModelBase();

            var analysis = new SafetySharpSafetyAnalysis {
                Backend = SafetyAnalysisBackend.FaultOptimizedOnTheFly, Heuristics = { new MaximalSafeSetHeuristic(model.Faults) }
            };
            var result = analysis.ComputeMinimalCriticalSets(model, model.ModelComponent.HazardActive);
            //result.SaveCounterExamples("counter examples/height control/dcca/collision/original");

            var orderResult = SafetySharpOrderAnalysis.ComputeOrderRelationships(result);

            Console.WriteLine(orderResult);
        }
Beispiel #3
0
        public void CalculateProbability()
        {
            var model = new ExampleModelBase();

            var isHazardActive = new ExecutableStateFormula(() => model.ModelComponent.HazardActive, "HazardActive");

            var tc = SafetySharpModelChecker.TraversalConfiguration;

            tc.WriteGraphvizModels                         = true;
            tc.AllowFaultsOnInitialTransitions             = false;
            SafetySharpModelChecker.TraversalConfiguration = tc;

            var result = SafetySharpModelChecker.CalculateProbabilityToReachStateBounded(model, isHazardActive, 50);

            Console.Write($"Probability of hazard: {result}");
        }