Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparsePcaaQuery.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <optional>
5#include <variant>
6#include <vector>
7
12
13namespace storm {
14
15class Environment;
16
17namespace modelchecker::multiobjective {
18
19/*
20 * This class represents a query for the Pareto curve approximation algorithm (Pcaa).
21 * It implements the necessary computations for the different query types.
22 * @See Section 3.4 of https://doi.org/10.18154/RWTH-2023-09669
23 */
24template<class SparseModelType, typename GeometryValueType>
26 public:
27 using Point = std::vector<GeometryValueType>;
28 using WeightVector = std::vector<GeometryValueType>;
31 using PolytopePtr = std::shared_ptr<Polytope>;
33 using ModelValueType = typename SparseModelType::ValueType;
34
39 SparsePcaaQuery(PreprocessorResult& preprocessorResult);
40
44 std::unique_ptr<CheckResult> check(Environment const& env, bool produceScheduler);
45
46 private:
55 struct RefinementStep {
56 WeightVector weightVector;
57 Point achievablePoint;
58 GeometryValueType optimalWeightedSum;
59 std::optional<storm::storage::Scheduler<ModelValueType>> scheduler;
60 };
61
62 struct WeightedSumOptimizationInput {
63 WeightVector weightVector;
64 GeometryValueType epsilonWso;
65 };
66 using AnswerOrWeights = std::variant<std::unique_ptr<CheckResult>, WeightedSumOptimizationInput>;
67 AnswerOrWeights tryAnswerOrNextWeights(Environment const& env, std::vector<RefinementStep> const& refinementSteps, PolytopePtr overApproximation,
68 bool produceScheduler);
69 AnswerOrWeights tryAnswerOrNextWeightsAchievability(Environment const& env, std::optional<uint64_t> const optObjIndex,
70 std::vector<GeometryValueType> const& thresholds, std::vector<RefinementStep> const& refinementSteps,
71 PolytopePtr overApproximation, bool produceScheduler);
72 AnswerOrWeights tryAnswerOrNextWeightsPareto(Environment const& env, std::vector<RefinementStep> const& refinementSteps, PolytopePtr overApproximation,
73 bool produceScheduler);
74
80 GeometryValueType getEpsilonWso(Environment const& env, std::optional<GeometryValueType> approxDistance = std::nullopt);
81
88 void exportPlotOfCurrentApproximation(Environment const& env, std::vector<RefinementStep> const& refinementSteps, PolytopePtr overApproximation) const;
89
90 uint64_t const initialStateOfOriginalModel; // needed to prepare the CheckResult.
91 std::vector<Objective<ModelValueType>> objectives;
92
93 // The corresponding weight vector checker
94 std::unique_ptr<PcaaWeightVectorChecker<SparseModelType>> weightVectorChecker;
95};
96
97} // namespace modelchecker::multiobjective
98} // namespace storm
typename SparseModelType::ValueType ModelValueType
std::unique_ptr< CheckResult > check(Environment const &env, bool produceScheduler)
Invokes the computation and retrieves the result.