Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
BEErlang.cpp
Go to the documentation of this file.
1#include "BEErlang.h"
2
5
6namespace storm::dft {
7namespace storage {
8namespace elements {
9
10template<>
11double BEErlang<double>::getUnreliability(double time) const {
12 // 1 - \sum_{n=0}^{k-1} 1/n! * e^(-lambda * t) * (lambda * t)^n
13 // where lambda is the rate and k the number of phases
14 double res = 1;
15 double factorFactorial = 1;
16 double factorExp = std::exp(-this->activeFailureRate() * time);
17 double factorPow = 1;
18 for (unsigned i = 0; i <= this->phases() - 1; ++i) {
19 if (i > 0) {
20 factorFactorial /= i;
21 factorPow *= this->activeFailureRate() * time;
22 }
23 res -= factorFactorial * factorExp * factorPow;
24 }
25 return res;
26}
27
28template<typename ValueType>
29ValueType BEErlang<ValueType>::getUnreliability(ValueType time) const {
30 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Computing cumulative failure probability not supported for this data type.");
31}
32
33// Explicitly instantiate the class.
34template class BEErlang<double>;
35template class BEErlang<RationalFunction>;
36
37} // namespace elements
38} // namespace storage
39} // namespace storm::dft
BE with Erlang failure distribution.
Definition BEErlang.h:13
ValueType getUnreliability(ValueType time) const override
Return the unreliability of the BE up to the given time point.
Definition BEErlang.cpp:29
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30