Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DftInstantiator.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace storm::dft {
7namespace transformations {
8
12template<typename ParametricType, typename ConstantType>
14 public:
21
25 virtual ~DftInstantiator() = default;
26
32 std::shared_ptr<storm::dft::storage::DFT<ConstantType>> instantiate(storm::utility::parametric::Valuation<ParametricType> const& valuation);
33
37 void checkValid() const;
38
39 private:
41
42 template<typename PT = ParametricType>
43 typename std::enable_if<std::is_same<PT, ConstantType>::value, ConstantType>::type instantiate_helper(
44 ParametricType const& function, storm::utility::parametric::Valuation<ParametricType> const& valuation) {
45 return storm::utility::parametric::substitute(function, valuation);
46 }
47
48 template<typename PT = ParametricType>
49 typename std::enable_if<!std::is_same<PT, ConstantType>::value, ConstantType>::type instantiate_helper(
50 ParametricType const& function, storm::utility::parametric::Valuation<ParametricType> const& valuation) {
51 return storm::utility::convertNumber<ConstantType>(storm::utility::parametric::evaluate(function, valuation));
52 }
53
59 std::vector<std::string> getChildrenVector(std::shared_ptr<storm::dft::storage::elements::DFTElement<ParametricType> const> element);
60};
61
62} // namespace transformations
63} // namespace storm::dft
Represents a Dynamic Fault Tree.
Definition DFT.h:52
Abstract base class for DFT elements.
Definition DFTElement.h:39
Instantiator to yield a concrete DFT from a parametric DFT (with parametric failure rates).
virtual ~DftInstantiator()=default
Destructs the Instantiator.
std::shared_ptr< storm::dft::storage::DFT< ConstantType > > instantiate(storm::utility::parametric::Valuation< ParametricType > const &valuation)
Evaluates the occurring parametric functions and retrieves the instantiated DFT.
FunctionType substitute(FunctionType const &function, Valuation< FunctionType > const &valuation)
Evaluates the given function wrt.
std::map< typename VariableType< FunctionType >::type, typename CoefficientType< FunctionType >::type > Valuation
Definition parametric.h:41
CoefficientType< FunctionType >::type evaluate(FunctionType const &function, Valuation< FunctionType > const &valuation)
Evaluates the given function wrt.