STAMINA/STORM 0.1
Infinite state-space truncator which generates a probability within a window
ProbabilityState.h
1#ifndef STAMINA_BUILDER_PROBABILITYSTATE_H
2#define STAMINA_BUILDER_PROBABILITYSTATE_H
3
4#include "__storm_needed_for_builder.h"
5
6namespace stamina {
7 namespace builder {
8 using namespace storm::builder;
9 /* Class for states with probabilities */
10 template <typename StateType>
12 public:
13 StateType index;
14 uint8_t iterationLastSeen;
15 bool assignedInRemapping;
16 bool isNew;
17 bool wasPutInTerminalQueue;
19 StateType index = 0
20 , double pi = 0.0
21 , bool terminal = true
22 , uint8_t iterationLastSeen = 0
23 ) : index(index)
24 , pi(pi)
25 , terminal(terminal)
26 , assignedInRemapping(false)
27 , iterationLastSeen(iterationLastSeen)
28 , isNew(true)
29 , wasPutInTerminalQueue(false)
30 {
31 // Intentionally left empty
32 }
33 // Copy constructor
35 : index(other.index)
36 , pi(other.pi)
37 , terminal(other.terminal)
38 , assignedInRemapping(other.assignedInRemapping)
39 , isNew(other.isNew)
40 {
41 // Intentionally left empty
42 }
43
44 double getPi() {
45 return pi;
46 }
47 void addToPi(double add) {
48 pi += add;
49 }
50 void setPi(double pi) {
51 this->pi = pi;
52 }
53 bool isTerminal() {
54 return terminal;
55 }
56 void setTerminal(bool term) {
57 terminal = term;
58 }
59 inline bool operator==(const ProbabilityState & rhs) const {
60 return index == rhs.index;
61 }
62 inline bool operator>=(const ProbabilityState & rhs) const {
63 return index >= rhs.index;
64 }
65 inline bool operator<=(const ProbabilityState & rhs) const {
66 return index <= rhs.index;
67 }
68 inline bool operator>(const ProbabilityState & rhs) const {
69 return index > rhs.index;
70 }
71 inline bool operator<(const ProbabilityState & rhs) const {
72 return index < rhs.index;
73 }
74 double pi;
75 bool terminal;
76
77 };
78
79 template <typename StateType>
81 bool operator() (
82 const ProbabilityState<StateType> * first
83 , const ProbabilityState<StateType> * second
84 ) const {
85 // Create a max heap on the reachability probability
86 return first->pi < second->pi;
87 }
88 };
89
90 template <typename StateType>
92 public:
94 CompressedState second;
95 };
96
97 template <typename StateType>
99 bool operator() (
102 ) const {
103 // Create a max heap on the reachability probability
104 return first.first->pi < second.first->pi;
105 }
106 };
107 } // namespace builder
108} // namespace stamina
109
110#endif // STAMINA_BUILDER_PROBABILITYSTATE_H
Definition: ProbabilityState.h:91
Definition: ProbabilityState.h:11
Definition: ExplicitTruncatedModelBuilder.cpp:40
Definition: ProbabilityState.h:80
Definition: ProbabilityState.h:98