Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
LexicographicCheckResult.cpp
Go to the documentation of this file.
2
8
9namespace storm {
10namespace modelchecker {
11
12template<typename ValueType>
14 : values(values), state(state) {}
15
16template<typename ValueType>
17std::vector<ValueType> const& LexicographicCheckResult<ValueType>::getInitialStateValue() const {
18 return values;
19}
20
21template<typename ValueType>
25
26template<typename ValueType>
30
31template<typename ValueType>
32std::unique_ptr<CheckResult> LexicographicCheckResult<ValueType>::clone() const {
33 return std::make_unique<LexicographicCheckResult<ValueType>>(values, state);
34}
35
36template<typename ValueType>
38 return true;
39}
40
41template<typename ValueType>
43 STORM_LOG_THROW(filter.isExplicitQualitativeCheckResult(), storm::exceptions::InvalidOperationException,
44 "Cannot filter explicit check result with non-explicit filter.");
45 STORM_LOG_THROW(filter.isResultForAllStates(), storm::exceptions::InvalidOperationException, "Cannot filter check result with non-complete filter.");
46 ExplicitQualitativeCheckResult const& explicitFilter = filter.asExplicitQualitativeCheckResult();
47 ExplicitQualitativeCheckResult::vector_type const& filterTruthValues = explicitFilter.getTruthValuesVector();
48
49 STORM_LOG_THROW(filterTruthValues.getNumberOfSetBits() == 1 && filterTruthValues.get(state), storm::exceptions::InvalidOperationException,
50 "The check result fails to contain some results referred to by the filter.");
51}
52
53template<typename ValueType>
54std::ostream& LexicographicCheckResult<ValueType>::writeToStream(std::ostream& out) const {
55 out << " (";
56 for (auto it = values.begin(); it != values.end(); ++it) {
57 if (it != values.begin()) {
58 out << ", ";
59 }
60 out << std::setw(storm::NumberTraits<ValueType>::IsExact ? 20 : 11) << *it;
61 }
62 out << " )";
64 out << " approx. ";
65 out << " (";
66 for (auto it = values.begin(); it != values.end(); ++it) {
67 if (it != values.begin()) {
68 out << ", ";
69 }
70 out << std::setw(11) << storm::utility::convertNumber<double>(*it);
71 }
72 out << " )";
73 }
74 out << '\n';
75 return out;
76}
77
80
81} // namespace modelchecker
82} // namespace storm
virtual void filter(QualitativeCheckResult const &filter) override
Filters the current result wrt.
std::vector< ValueType > const & getInitialStateValue() const
storm::storage::sparse::state_type const & getState() const
virtual std::unique_ptr< CheckResult > clone() const override
virtual std::ostream & writeToStream(std::ostream &out) const override
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
uint_fast64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
bool get(uint_fast64_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
LabParser.cpp.
Definition cli.cpp:18