Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SFTBDDChecker.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <memory>
5#include <set>
6#include <unordered_map>
7#include <utility>
8#include <vector>
9
14
15namespace storm::dft {
16namespace modelchecker {
17
23 public:
24 using ValueType = double;
25#ifdef STORM_HAVE_SYLVAN
26 using Bdd = sylvan::Bdd;
27#endif
28
30 std::shared_ptr<storm::dft::storage::SylvanBddManager> sylvanBddManager = std::make_shared<storm::dft::storage::SylvanBddManager>());
31
33
37 std::shared_ptr<storm::dft::storage::DFT<ValueType>> getDFT() const;
38
42 std::shared_ptr<storm::dft::storage::SylvanBddManager> getSylvanBddManager() const;
43
47 std::shared_ptr<storm::dft::transformations::SftToBddTransformator<ValueType>> getTransformator() const;
48
56 void exportBddToDot(std::string const &filename) {
57#ifdef STORM_HAVE_SYLVAN
58 getSylvanBddManager()->exportBddToDot(getTopLevelElementBdd(), filename);
59#else
60 STORM_LOG_THROW(false, storm::exceptions::MissingLibraryException,
61 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
62 "version of Storm with Sylvan support.");
63#endif
64 }
65
71 std::vector<std::vector<std::string>> getMinimalCutSets();
72
79 std::vector<std::vector<uint32_t>> getMinimalCutSetsAsIndices();
80
86#ifdef STORM_HAVE_SYLVAN
87 return getProbabilityAtTimebound(getTopLevelElementBdd(), timebound);
88#else
89 STORM_LOG_THROW(false, storm::exceptions::MissingLibraryException,
90 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
91 "version of Storm with Sylvan support.");
92#endif
93 }
94
95#ifdef STORM_HAVE_SYLVAN
104 ValueType getProbabilityAtTimebound(Bdd bdd, ValueType timebound) const;
105#endif
106
118 std::vector<ValueType> getProbabilitiesAtTimepoints(std::vector<ValueType> const &timepoints, size_t const chunksize = 0) {
119#ifdef STORM_HAVE_SYLVAN
120 return getProbabilitiesAtTimepoints(getTopLevelElementBdd(), timepoints, chunksize);
121#else
122 STORM_LOG_THROW(false, storm::exceptions::MissingLibraryException,
123 "This version of Storm was compiled without support for Sylvan. Yet, a method was called that requires this support. Please choose a "
124 "version of Storm with Sylvan support.");
125#endif
126 }
127
128#ifdef STORM_HAVE_SYLVAN
144 std::vector<ValueType> getProbabilitiesAtTimepoints(Bdd bdd, std::vector<ValueType> const &timepoints, size_t chunksize = 0) const;
145#endif
146
152 ValueType getBirnbaumFactorAtTimebound(std::string const &beName, ValueType timebound);
153
163 std::vector<ValueType> getAllBirnbaumFactorsAtTimebound(ValueType timebound);
164
176 std::vector<ValueType> getBirnbaumFactorsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
177
189 std::vector<std::vector<ValueType>> getAllBirnbaumFactorsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
190
197 ValueType getCIFAtTimebound(std::string const &beName, ValueType timebound);
198
209 std::vector<ValueType> getAllCIFsAtTimebound(ValueType timebound);
210
221 std::vector<ValueType> getCIFsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
222
233 std::vector<std::vector<ValueType>> getAllCIFsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
234
241 ValueType getDIFAtTimebound(std::string const &beName, ValueType timebound);
242
253 std::vector<ValueType> getAllDIFsAtTimebound(ValueType timebound);
254
265 std::vector<ValueType> getDIFsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
266
277 std::vector<std::vector<ValueType>> getAllDIFsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
278
285 ValueType getRAWAtTimebound(std::string const &beName, ValueType timebound);
286
297 std::vector<ValueType> getAllRAWsAtTimebound(ValueType timebound);
298
309 std::vector<ValueType> getRAWsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
310
321 std::vector<std::vector<ValueType>> getAllRAWsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
322
329 ValueType getRRWAtTimebound(std::string const &beName, ValueType timebound);
330
341 std::vector<ValueType> getAllRRWsAtTimebound(ValueType timebound);
342
353 std::vector<ValueType> getRRWsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
354
365 std::vector<std::vector<ValueType>> getAllRRWsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
366
367 private:
368#ifdef STORM_HAVE_SYLVAN
383 void recursiveMCS(Bdd const bdd, std::vector<uint32_t> &buffer, std::vector<std::vector<uint32_t>> &minimalCutSets) const;
384
385 template<typename FuncType>
386 void chunkCalculationTemplate(std::vector<ValueType> const &timepoints, size_t chunksize, FuncType func) const;
387
388 template<typename FuncType>
389 ValueType getImportanceMeasureAtTimebound(std::string const &beName, ValueType timebound, FuncType func);
390
391 template<typename FuncType>
392 std::vector<ValueType> getAllImportanceMeasuresAtTimebound(ValueType timebound, FuncType func);
393
394 template<typename FuncType>
395 std::vector<ValueType> getImportanceMeasuresAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize,
396 FuncType func);
397
398 template<typename FuncType>
399 std::vector<std::vector<ValueType>> getAllImportanceMeasuresAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize, FuncType func);
400
405 Bdd getTopLevelElementBdd();
406
407 std::shared_ptr<storm::dft::transformations::SftToBddTransformator<ValueType>> transformator;
408#endif
409};
410
411} // namespace modelchecker
412} // namespace storm::dft
Main class for the SFTBDDChecker.
std::vector< ValueType > getAllRRWsAtTimebound(ValueType timebound)
ValueType getRAWAtTimebound(std::string const &beName, ValueType timebound)
std::vector< std::vector< ValueType > > getAllRAWsAtTimepoints(std::vector< ValueType > const &timepoints, size_t chunksize=0)
ValueType getCIFAtTimebound(std::string const &beName, ValueType timebound)
std::vector< std::vector< ValueType > > getAllBirnbaumFactorsAtTimepoints(std::vector< ValueType > const &timepoints, size_t chunksize=0)
std::vector< ValueType > getAllDIFsAtTimebound(ValueType timebound)
std::vector< ValueType > getAllRAWsAtTimebound(ValueType timebound)
std::vector< ValueType > getRRWsAtTimepoints(std::string const &beName, std::vector< ValueType > const &timepoints, size_t chunksize=0)
std::shared_ptr< storm::dft::storage::DFT< ValueType > > getDFT() const
std::vector< std::vector< ValueType > > getAllDIFsAtTimepoints(std::vector< ValueType > const &timepoints, size_t chunksize=0)
ValueType getRRWAtTimebound(std::string const &beName, ValueType timebound)
std::vector< std::vector< ValueType > > getAllRRWsAtTimepoints(std::vector< ValueType > const &timepoints, size_t chunksize=0)
std::vector< ValueType > getAllBirnbaumFactorsAtTimebound(ValueType timebound)
std::vector< ValueType > getRAWsAtTimepoints(std::string const &beName, std::vector< ValueType > const &timepoints, size_t chunksize=0)
ValueType getBirnbaumFactorAtTimebound(std::string const &beName, ValueType timebound)
std::vector< ValueType > getProbabilitiesAtTimepoints(std::vector< ValueType > const &timepoints, size_t const chunksize=0)
std::vector< std::vector< ValueType > > getAllCIFsAtTimepoints(std::vector< ValueType > const &timepoints, size_t chunksize=0)
std::vector< ValueType > getBirnbaumFactorsAtTimepoints(std::string const &beName, std::vector< ValueType > const &timepoints, size_t chunksize=0)
std::shared_ptr< storm::dft::storage::SylvanBddManager > getSylvanBddManager() const
std::shared_ptr< storm::dft::transformations::SftToBddTransformator< ValueType > > getTransformator() const
std::vector< std::vector< uint32_t > > getMinimalCutSetsAsIndices()
std::vector< ValueType > getCIFsAtTimepoints(std::string const &beName, std::vector< ValueType > const &timepoints, size_t chunksize=0)
void exportBddToDot(std::string const &filename)
Exports the Bdd that represents the top level event to a file in the dot format.
std::vector< std::vector< std::string > > getMinimalCutSets()
std::vector< ValueType > getAllCIFsAtTimebound(ValueType timebound)
ValueType getDIFAtTimebound(std::string const &beName, ValueType timebound)
std::vector< ValueType > getDIFsAtTimepoints(std::string const &beName, std::vector< ValueType > const &timepoints, size_t chunksize=0)
ValueType getProbabilityAtTimebound(ValueType timebound)
Represents a Dynamic Fault Tree.
Definition DFT.h:52
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
SFTBDDChecker::ValueType ValueType