Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SolveGoal.cpp
Go to the documentation of this file.
2
10
11namespace storm {
12namespace storage {
13template<typename ValueType>
14class SparseMatrix;
15}
16
17namespace solver {
18
19template<typename ValueType, typename SolutionType>
21 // Intentionally left empty.
22}
23
24template<typename ValueType, typename SolutionType>
27 // Intentionally left empty.
28}
29
30template<typename ValueType, typename SolutionType>
31SolveGoal<ValueType, SolutionType>::SolveGoal(OptimizationDirection optimizationDirection) : optimizationDirection(optimizationDirection) {
32 // Intentionally left empty.
33}
34
35template<typename ValueType, typename SolutionType>
37 SolutionType const& boundThreshold, storm::storage::BitVector const& relevantValues)
38 : optimizationDirection(optimizationDirection), comparisonType(boundComparisonType), threshold(boundThreshold), relevantValueVector(relevantValues) {
39 // Intentionally left empty.
40}
41
42template<typename ValueType, typename SolutionType>
44 : optimizationDirection(optimizationDirection), relevantValueVector(relevantValues) {
45 // Intentionally left empty.
46}
47
48template<typename ValueType, typename SolutionType>
50 return static_cast<bool>(optimizationDirection);
51}
52
53template<typename ValueType, typename SolutionType>
55 if (optimizationDirection) {
56 if (optimizationDirection == storm::solver::OptimizationDirection::Minimize) {
57 optimizationDirection = storm::solver::OptimizationDirection::Maximize;
58 } else {
59 optimizationDirection = storm::solver::OptimizationDirection::Minimize;
60 }
61 }
62 if (threshold) {
63 this->threshold = storm::utility::one<SolutionType>() - this->threshold.get();
64 }
65 if (comparisonType) {
66 switch (comparisonType.get()) {
69 break;
72 break;
75 break;
78 break;
79 }
80 }
81}
82
83template<typename ValueType, typename SolutionType>
85 return optimizationDirection == OptimizationDirection::Minimize;
86}
87
88template<typename ValueType, typename SolutionType>
90 STORM_LOG_THROW(optimizationDirection.has_value(), storm::exceptions::InvalidPropertyException, "Optimization direction not set.");
91 return optimizationDirection.get();
92}
93
94template<typename ValueType, typename SolutionType>
96 return comparisonType && threshold && relevantValueVector;
97}
98
99template<typename ValueType, typename SolutionType>
103
104template<typename ValueType, typename SolutionType>
106 return (comparisonType.get() == storm::logic::ComparisonType::Greater || comparisonType.get() == storm::logic::ComparisonType::Less);
107}
108
109template<typename ValueType, typename SolutionType>
113
114template<typename ValueType, typename SolutionType>
116 return threshold.get();
117}
118
119template<typename ValueType, typename SolutionType>
121 return static_cast<bool>(relevantValueVector);
122}
123
124template<typename ValueType, typename SolutionType>
126 return relevantValueVector.get();
127}
128
129template<typename ValueType, typename SolutionType>
133
134template<typename ValueType, typename SolutionType>
136 if (relevantValueVector) {
137 relevantValueVector = relevantValueVector.get() % filter;
138 }
139}
140
141template<typename ValueType, typename SolutionType>
143 relevantValueVector = std::move(values);
144}
145
146template class SolveGoal<double>;
150
151} // namespace solver
152} // namespace storm
UncertaintyResolutionMode getUncertaintyResolutionMode() const
bool boundIsALowerBound() const
void oneMinus()
Flips the comparison type, the direction, and computes the new threshold as 1 - old threshold.
Definition SolveGoal.cpp:54
SolutionType const & thresholdValue() const
bool hasRelevantValues() const
void restrictRelevantValues(storm::storage::BitVector const &filter)
storm::storage::BitVector & relevantValues()
void setRelevantValues(storm::storage::BitVector &&values)
bool hasDirection() const
Definition SolveGoal.cpp:49
OptimizationDirection direction() const
Definition SolveGoal.cpp:89
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
bool constexpr minimize(OptimizationDirection d)