Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
BEWeibull.h
Go to the documentation of this file.
1#pragma once
2
3#include "DFTBE.h"
4
5namespace storm::dft {
6namespace storage {
7namespace elements {
8
12template<typename ValueType>
13class BEWeibull : public DFTBE<ValueType> {
14 public:
22 BEWeibull(size_t id, std::string const& name, ValueType shape, ValueType rate) : DFTBE<ValueType>(id, name), mShape(shape), mRate(rate) {
23 // Intentionally empty
24 }
25
26 std::shared_ptr<DFTElement<ValueType>> clone() const override {
27 return std::shared_ptr<DFTElement<ValueType>>(new BEWeibull<ValueType>(this->id(), this->name(), this->shape(), this->rate()));
28 }
29
33
34 bool canFail() const override {
35 STORM_LOG_ASSERT(!storm::utility::isZero(this->rate()), "BE WEIBULL should have rate > 0.");
36 STORM_LOG_ASSERT(!storm::utility::isZero(this->shape()), "BE WEIBULL should have shape > 0.");
37 return true;
38 }
39
44 ValueType const& shape() const {
45 return mShape;
46 }
47
52 ValueType const& rate() const {
53 return mRate;
54 }
55
56 ValueType getUnreliability(ValueType time) const override;
57
58 std::string distributionString() const override {
59 std::stringstream stream;
60 stream << "weibull " << this->rate() << ", " << this->shape();
61 return stream.str();
62 }
63
64 private:
65 ValueType mShape;
66 ValueType mRate;
67};
68
69} // namespace elements
70} // namespace storage
71} // namespace storm::dft
BE with Weibull failure distribution.
Definition BEWeibull.h:13
ValueType const & rate() const
Return failure rate (also called scale parameter).
Definition BEWeibull.h:52
ValueType getUnreliability(ValueType time) const override
Return the unreliability of the BE up to the given time point.
Definition BEWeibull.cpp:17
bool canFail() const override
Return whether the BE can fail.
Definition BEWeibull.h:34
std::shared_ptr< DFTElement< ValueType > > clone() const override
Create a shallow copy of the element.
Definition BEWeibull.h:26
ValueType const & shape() const
Return shape parameter.
Definition BEWeibull.h:44
std::string distributionString() const override
Print information about failure distribution to string.
Definition BEWeibull.h:58
storm::dft::storage::elements::BEType beType() const override
Get type of BE (constant, exponential, etc.).
Definition BEWeibull.h:30
BEWeibull(size_t id, std::string const &name, ValueType shape, ValueType rate)
Constructor.
Definition BEWeibull.h:22
Abstract base class for basic events (BEs) in DFTs.
Definition DFTBE.h:14
virtual size_t id() const
Get id.
Definition DFTElement.h:73
virtual std::string const & name() const
Get name.
Definition DFTElement.h:89
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
bool isZero(ValueType const &a)
Definition constants.cpp:41