Storm
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 using Bdd = sylvan::Bdd;
26
28 std::shared_ptr<storm::dft::storage::SylvanBddManager> sylvanBddManager = std::make_shared<storm::dft::storage::SylvanBddManager>());
29
31
35 std::shared_ptr<storm::dft::storage::DFT<ValueType>> getDFT() const noexcept;
36
40 std::shared_ptr<storm::dft::storage::SylvanBddManager> getSylvanBddManager() const noexcept;
41
45 std::shared_ptr<storm::dft::transformations::SftToBddTransformator<ValueType>> getTransformator() const noexcept;
46
54 void exportBddToDot(std::string const &filename) {
55 getSylvanBddManager()->exportBddToDot(getTopLevelElementBdd(), filename);
56 }
57
63 std::vector<std::vector<std::string>> getMinimalCutSets();
64
71 std::vector<std::vector<uint32_t>> getMinimalCutSetsAsIndices();
72
78 return getProbabilityAtTimebound(getTopLevelElementBdd(), timebound);
79 }
80
90
102 std::vector<ValueType> getProbabilitiesAtTimepoints(std::vector<ValueType> const &timepoints, size_t const chunksize = 0) {
103 return getProbabilitiesAtTimepoints(getTopLevelElementBdd(), timepoints, chunksize);
104 }
105
121 std::vector<ValueType> getProbabilitiesAtTimepoints(Bdd bdd, std::vector<ValueType> const &timepoints, size_t chunksize = 0) const;
122
128 ValueType getBirnbaumFactorAtTimebound(std::string const &beName, ValueType timebound);
129
139 std::vector<ValueType> getAllBirnbaumFactorsAtTimebound(ValueType timebound);
140
152 std::vector<ValueType> getBirnbaumFactorsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
153
165 std::vector<std::vector<ValueType>> getAllBirnbaumFactorsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
166
173 ValueType getCIFAtTimebound(std::string const &beName, ValueType timebound);
174
185 std::vector<ValueType> getAllCIFsAtTimebound(ValueType timebound);
186
197 std::vector<ValueType> getCIFsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
198
209 std::vector<std::vector<ValueType>> getAllCIFsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
210
217 ValueType getDIFAtTimebound(std::string const &beName, ValueType timebound);
218
229 std::vector<ValueType> getAllDIFsAtTimebound(ValueType timebound);
230
241 std::vector<ValueType> getDIFsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
242
253 std::vector<std::vector<ValueType>> getAllDIFsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
254
261 ValueType getRAWAtTimebound(std::string const &beName, ValueType timebound);
262
273 std::vector<ValueType> getAllRAWsAtTimebound(ValueType timebound);
274
285 std::vector<ValueType> getRAWsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
286
297 std::vector<std::vector<ValueType>> getAllRAWsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
298
305 ValueType getRRWAtTimebound(std::string const &beName, ValueType timebound);
306
317 std::vector<ValueType> getAllRRWsAtTimebound(ValueType timebound);
318
329 std::vector<ValueType> getRRWsAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize = 0);
330
341 std::vector<std::vector<ValueType>> getAllRRWsAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize = 0);
342
343 private:
358 void recursiveMCS(Bdd const bdd, std::vector<uint32_t> &buffer, std::vector<std::vector<uint32_t>> &minimalCutSets) const;
359
360 template<typename FuncType>
361 void chunkCalculationTemplate(std::vector<ValueType> const &timepoints, size_t chunksize, FuncType func) const;
362
363 template<typename FuncType>
364 ValueType getImportanceMeasureAtTimebound(std::string const &beName, ValueType timebound, FuncType func);
365
366 template<typename FuncType>
367 std::vector<ValueType> getAllImportanceMeasuresAtTimebound(ValueType timebound, FuncType func);
368
369 template<typename FuncType>
370 std::vector<ValueType> getImportanceMeasuresAtTimepoints(std::string const &beName, std::vector<ValueType> const &timepoints, size_t chunksize,
371 FuncType func);
372
373 template<typename FuncType>
374 std::vector<std::vector<ValueType>> getAllImportanceMeasuresAtTimepoints(std::vector<ValueType> const &timepoints, size_t chunksize, FuncType func);
375
380 Bdd getTopLevelElementBdd();
381
382 std::shared_ptr<storm::dft::transformations::SftToBddTransformator<ValueType>> transformator;
383};
384
385} // namespace modelchecker
386} // namespace storm::dft
Main class for the SFTBDDChecker.
std::shared_ptr< storm::dft::storage::SylvanBddManager > getSylvanBddManager() const noexcept
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::transformations::SftToBddTransformator< ValueType > > getTransformator() const noexcept
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::shared_ptr< storm::dft::storage::DFT< ValueType > > getDFT() const noexcept
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::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
SFTBDDChecker::ValueType ValueType
SFTBDDChecker::Bdd Bdd
LabParser.cpp.
Definition cli.cpp:18