Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DeterministicSchedsParetoExplorer.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <queue>
5
10
16
17namespace storm {
18
19class Environment;
20
21namespace modelchecker {
22namespace multiobjective {
23
28template<class SparseModelType, typename GeometryValueType>
30 public:
31 typedef uint64_t PointId;
32 typedef typename std::shared_ptr<storm::storage::geometry::Polytope<GeometryValueType>> Polytope;
33 typedef typename SparseModelType::ValueType ModelValueType;
34
35 class Point {
36 public:
37 Point(std::vector<GeometryValueType> const& coordinates);
38 Point(std::vector<GeometryValueType>&& coordinates);
39
40 std::vector<GeometryValueType> const& get() const;
41 std::vector<GeometryValueType>& get();
42
43 uint64_t dimension() const;
44
46 DominanceResult getDominance(Point const& other) const;
47
48 void setOnFacet(bool value = true);
49 bool liesOnFacet() const;
50 void setParetoOptimal(bool value = true);
51 bool isParetoOptimal() const;
52
53 std::string toString(bool convertToDouble = false) const;
54
55 private:
56 std::vector<GeometryValueType> coordinates;
57 bool onFacet;
58 bool paretoOptimal;
59 };
60
61 class Pointset {
62 public:
63 typedef typename std::map<PointId, Point>::const_iterator iterator_type;
64
65 Pointset();
66
74 boost::optional<PointId> addPoint(Environment const& env, Point&& point);
75
79 Point const& getPoint(PointId const& id) const;
80
81 iterator_type begin() const;
82 iterator_type end() const;
83
87 uint64_t size() const;
88
93
94 void collectPointsInPolytope(std::set<PointId>& collectedPoints, Polytope const& polytope);
95
96 void printToStream(std::ostream& out, bool includeIDs = true, bool convertToDouble = false);
97
98 private:
99 std::map<PointId, Point> points;
100 PointId currId;
101 };
102
103 class Facet {
104 public:
108 void addPoint(PointId const& pointId, Point const& point);
109 std::vector<PointId> const& getPoints() const;
110 uint64_t getNumberOfPoints() const;
111
115 Polytope getInducedPolytope(Pointset const& pointset, std::vector<GeometryValueType> const& referenceCoordinates);
116
117 private:
119 std::vector<PointId> pointsOnFacet;
120 };
121
123
124 virtual std::unique_ptr<CheckResult> check(Environment const& env);
125
127
128 private:
132 void clean();
133
137 void addHalfspaceToOverApproximation(Environment const& env, std::vector<GeometryValueType> const& normalVector, GeometryValueType const& offset);
138
142 void addUnachievableArea(Environment const& env, Polytope const& area);
143
148 void initializeFacets(Environment const& env);
149
153 std::vector<GeometryValueType> getReferenceCoordinates(Environment const& env) const;
154
158 void processFacet(Environment const& env, Facet& f);
159
166 bool optimizeAndSplitFacet(Environment const& env, Facet& f);
167
168 Polytope negateMinObjectives(Polytope const& polytope) const;
169 void negateMinObjectives(std::vector<GeometryValueType>& vector) const;
170
171 Pointset pointset;
172 std::queue<Facet> unprocessedFacets;
173 Polytope overApproximation;
174 std::vector<Polytope> unachievableAreas;
175 std::vector<GeometryValueType> eps;
176 std::shared_ptr<DeterministicSchedsLpChecker<SparseModelType, GeometryValueType>> lpChecker;
177 std::unique_ptr<PcaaWeightVectorChecker<SparseModelType>> wvChecker;
178 std::vector<DeterministicSchedsObjectiveHelper<SparseModelType>> objectiveHelper;
179
180 std::shared_ptr<SparseModelType> const& model;
181 uint64_t originalModelInitialState;
182 std::vector<Objective<ModelValueType>> const& objectives;
183};
184
185} // namespace multiobjective
186} // namespace modelchecker
187} // namespace storm
storm::storage::geometry::Halfspace< GeometryValueType > const & getHalfspace() const
Polytope getInducedPolytope(Pointset const &pointset, std::vector< GeometryValueType > const &referenceCoordinates)
Creates a polytope that captures all points that lie 'under' the facet.
void printToStream(std::ostream &out, bool includeIDs=true, bool convertToDouble=false)
Polytope downwardClosure() const
Returns the downward closure of the contained points.
Point const & getPoint(PointId const &id) const
Returns the point with the given ID.
void collectPointsInPolytope(std::set< PointId > &collectedPoints, Polytope const &polytope)
uint64_t size() const
Returns the number of points currently contained in the set.
boost::optional< PointId > addPoint(Environment const &env, Point &&point)
If the given point is not dominated by another point in the set, it is added to the set and its ID is...
virtual std::unique_ptr< CheckResult > check(Environment const &env)
std::shared_ptr< storm::storage::geometry::Polytope< GeometryValueType > > Polytope
LabParser.cpp.
Definition cli.cpp:18