1#include "storm-config.h"
10TEST(BEDistributionTest, ConstantFail) {
12 double timebound = 0.8;
14#ifdef STORM_HAVE_SYLVAN
16 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
17 double resultBDD = checker->getProbabilityAtTimebound(timebound);
18 EXPECT_NEAR(resultBDD, 0.3296799540, 1e-10);
24 std::string
property =
"Pmax=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
27 EXPECT_NEAR(resultMC, 0.3296799540, 1e-10);
30TEST(BEDistributionTest, ConstantNonFail) {
32 double timebound = 0.8;
34#ifdef STORM_HAVE_SYLVAN
36 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
37 double resultBDD = checker->getProbabilityAtTimebound(timebound);
38 EXPECT_NEAR(resultBDD, 0.9592377960, 1e-10);
44 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
47 EXPECT_NEAR(resultMC, 0.9592377960, 1e-10);
50TEST(BEDistributionTest, ConstantNonFail2) {
52 double timebound = 0.8;
54#ifdef STORM_HAVE_SYLVAN
56 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
57 double resultBDD = checker->getProbabilityAtTimebound(timebound);
58 EXPECT_EQ(resultBDD, 0);
64 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
67 EXPECT_EQ(resultMC, 0);
70TEST(BEDistributionTest, Probability) {
72 double timebound = 0.8;
74#ifdef STORM_HAVE_SYLVAN
76 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
77 double resultBDD = checker->getProbabilityAtTimebound(timebound);
78 EXPECT_NEAR(resultBDD, 0.1095403852, 1e-10);
84 std::string
property =
"Pmax=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
87 EXPECT_NEAR(resultMC, 0.1095403852, 1e-10);
90TEST(BEDistributionTest, Exponential) {
92 double timebound = 0.8;
94#ifdef STORM_HAVE_SYLVAN
96 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
97 double resultBDD = checker->getProbabilityAtTimebound(timebound);
98 EXPECT_NEAR(resultBDD, 0.108688872, 1e-10);
104 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
107 EXPECT_NEAR(resultMC, 0.108688872, 1e-10);
110TEST(BEDistributionTest, Erlang) {
112 double timebound = 0.8;
114#ifdef STORM_HAVE_SYLVAN
116 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
117 double resultBDD = checker->getProbabilityAtTimebound(timebound);
118 EXPECT_NEAR(resultBDD, 0.4949009834, 1e-10);
124 std::string
property =
"P=? [F<=" + std::to_string(timebound) +
" \"failed\"]";
127 EXPECT_NEAR(resultMC, 0.4949009834, 1e-10);
130TEST(BEDistributionTest, Weibull) {
131#ifdef STORM_HAVE_SYLVAN
133 double timebound = 2;
136 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
137 double resultBDD = checker->getProbabilityAtTimebound(timebound);
138 EXPECT_NEAR(resultBDD, 0.0382982486, 1e-10);
140 GTEST_SKIP() <<
"Library Sylvan not available.";
144TEST(BEDistributionTest, LogNormal) {
145#ifdef STORM_HAVE_SYLVAN
147 double timebound = 0.8;
150 auto checker = std::make_shared<storm::dft::modelchecker::SFTBDDChecker>(dft);
151 double resultBDD = checker->getProbabilityAtTimebound(timebound);
152 EXPECT_NEAR(resultBDD, 0.2336675428, 1e-10);
154 GTEST_SKIP() <<
"Library Sylvan not available.";
std::vector< storm::jani::Property > parseProperties(storm::parser::FormulaParser &formulaParser, std::string const &inputString, boost::optional< std::set< std::string > > const &propertyFilter)
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
storm::dft::modelchecker::DFTModelChecker< ValueType >::dft_results analyzeDFT(storm::dft::storage::DFT< ValueType > const &dft, std::vector< std::shared_ptr< storm::logic::Formula const > > const &properties, bool symred=true, bool allowModularisation=true, storm::dft::utility::RelevantEvents const &relevantEvents={}, bool allowDCForRelevant=false, double approximationError=0.0, storm::dft::builder::ApproximationHeuristic approximationHeuristic=storm::dft::builder::ApproximationHeuristic::DEPTH, bool eliminateChains=false, storm::transformer::EliminationLabelBehavior labelBehavior=storm::transformer::EliminationLabelBehavior::KeepLabels, bool printOutput=false)
Compute the exact or approximate analysis result of the given DFT according to the given properties.
std::shared_ptr< storm::dft::storage::DFT< ValueType > > prepareForMarkovAnalysis(storm::dft::storage::DFT< ValueType > const &dft)
Apply transformations to make DFT feasible for Markovian analysis.
std::pair< bool, std::string > isWellFormed(storm::dft::storage::DFT< ValueType > const &dft, bool validForMarkovianAnalysis=true)
Check whether the DFT is well-formed.
std::shared_ptr< storm::dft::storage::DFT< ValueType > > loadDFTGalileoFile(std::string const &file)
Load DFT from Galileo file.