Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DFTElementState.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace storm::dft {
6namespace storage {
7
8enum class DFTElementState { Operational = 0, Failed = 2, Failsafe = 1, DontCare = 3 };
9
10inline std::ostream& operator<<(std::ostream& os, DFTElementState st) {
11 switch (st) {
13 return os << "Operational";
15 return os << "Failed";
17 return os << "Failsafe";
19 return os << "Don't Care";
20 default:
21 STORM_LOG_ASSERT(false, "Element state not known.");
22 return os;
23 }
24}
25
26inline char toChar(DFTElementState st) {
27 switch (st) {
29 return 'O';
31 return 'F';
33 return 'S';
35 return '-';
36 default:
37 STORM_LOG_ASSERT(false, "Element state not known.");
38 return ' ';
39 }
40}
41
42enum class DFTDependencyState { Passive = 0, Unsuccessful = 1, Successful = 2, DontCare = 3 };
43
44inline std::ostream& operator<<(std::ostream& os, DFTDependencyState st) {
45 switch (st) {
47 return os << "Passive";
49 return os << "Successful";
51 return os << "Unsuccessful";
53 return os << "Don't Care";
54 default:
55 STORM_LOG_ASSERT(false, "Element state not known.");
56 return os;
57 }
58}
59
60inline char toChar(DFTDependencyState st) {
61 switch (st) {
63 return 'P';
65 return 'S';
67 return 'U';
69 return '-';
70 default:
71 STORM_LOG_ASSERT(false, "Element state not known.");
72 return ' ';
73 }
74}
75
76} // namespace storage
77} // namespace storm::dft
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
std::ostream & operator<<(std::ostream &os, DFTElementState st)
char toChar(DFTElementState st)