Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ParetoCurveCheckResult.cpp
Go to the documentation of this file.
2
5
6namespace storm {
7namespace modelchecker {
8
9template<typename ValueType>
11 // Intentionally left empty.
12}
13
14template<typename ValueType>
15ParetoCurveCheckResult<ValueType>::ParetoCurveCheckResult(std::vector<point_type> const& points, polytope_type const& underApproximation,
16 polytope_type const& overApproximation)
17 : points(points), underApproximation(underApproximation), overApproximation(overApproximation) {
18 // Intentionally left empty.
20
21template<typename ValueType>
22ParetoCurveCheckResult<ValueType>::ParetoCurveCheckResult(std::vector<point_type>&& points, polytope_type&& underApproximation,
23 polytope_type&& overApproximation)
24 : points(points), underApproximation(underApproximation), overApproximation(overApproximation) {
25 // Intentionally left empty.
26}
28template<typename ValueType>
30 return true;
31}
33template<typename ValueType>
34std::vector<typename ParetoCurveCheckResult<ValueType>::point_type> const& ParetoCurveCheckResult<ValueType>::getPoints() const {
35 return points;
36}
37
38template<typename ValueType>
40 return bool(underApproximation);
41}
42
43template<typename ValueType>
45 return bool(overApproximation);
46}
47
48template<typename ValueType>
50 STORM_LOG_ASSERT(hasUnderApproximation(), "Requested under approx. of Pareto curve although it does not exist.");
51 return underApproximation;
52}
53
54template<typename ValueType>
56 STORM_LOG_ASSERT(hasUnderApproximation(), "Requested over approx. of Pareto curve although it does not exist.");
57 return overApproximation;
58}
59
60template<typename ValueType>
61std::ostream& ParetoCurveCheckResult<ValueType>::writeToStream(std::ostream& out) const {
62 out << '\n';
63 if (hasUnderApproximation()) {
64 out << "Underapproximation of achievable values: " << underApproximation->toString() << '\n';
65 }
66 if (hasOverApproximation()) {
67 out << "Overapproximation of achievable values: " << overApproximation->toString() << '\n';
68 }
69 out << points.size() << " Pareto optimal points found:\n";
70 for (auto const& p : points) {
71 out << " (";
72 for (auto it = p.begin(); it != p.end(); ++it) {
73 if (it != p.begin()) {
74 out << ", ";
75 }
76 out << std::setw(storm::NumberTraits<ValueType>::IsExact ? 20 : 11) << *it;
77 }
78 out << " )";
80 out << " approx. ";
81 out << " (";
82 for (auto it = p.begin(); it != p.end(); ++it) {
83 if (it != p.begin()) {
84 out << ", ";
85 }
86 out << std::setw(11) << storm::utility::convertNumber<double>(*it);
87 }
88 out << " )";
89 }
90 out << '\n';
91 }
92 return out;
93}
94
96
97#ifdef STORM_HAVE_CARL
99#endif
100} // namespace modelchecker
101} // namespace storm
std::shared_ptr< storm::storage::geometry::Polytope< ValueType > > polytope_type
virtual std::ostream & writeToStream(std::ostream &out) const override
std::vector< point_type > const & getPoints() const
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
LabParser.cpp.
Definition cli.cpp:18