14namespace modelchecker {
15namespace multiobjective {
17template<
class SparseModelType,
typename GeometryValueType>
20 :
SparsePcaaQuery<SparseModelType, GeometryValueType>(preprocessorResult) {
22 "Invalid query Type");
25template<
class SparseModelType,
typename GeometryValueType>
28 storm::exceptions::IllegalArgumentException,
"Unhandled multiobjective precision type.");
31 typename SparseModelType::ValueType weightedPrecision =
33 weightedPrecision /=
storm::utility::sqrt(storm::utility::convertNumber<typename SparseModelType::ValueType, uint_fast64_t>(this->objectives.size()));
38 weightedPrecision *= storm::utility::convertNumber<typename SparseModelType::ValueType>(0.9);
39 this->weightVectorChecker->setWeightedPrecision(weightedPrecision);
42 exploreSetOfAchievablePoints(env);
45 std::vector<std::vector<typename SparseModelType::ValueType>> paretoOptimalPoints;
46 std::vector<Point> vertices = this->underApproximation->getVertices();
47 paretoOptimalPoints.reserve(vertices.size());
48 for (
auto const& vertex : vertices) {
49 paretoOptimalPoints.push_back(
53 this->originalModel.getInitialStates().getNextSetIndex(0), std::move(paretoOptimalPoints),
55 ->
template convertNumberRepresentation<typename SparseModelType::ValueType>(),
57 ->
template convertNumberRepresentation<typename SparseModelType::ValueType>()));
60template<
class SparseModelType,
typename GeometryValueType>
63 storm::exceptions::IllegalArgumentException,
"Unhandled multiobjective precision type.");
66 for (uint_fast64_t objIndex = 0; objIndex < this->objectives.size() && !this->maxStepsPerformed(env); ++objIndex) {
67 WeightVector direction(this->objectives.size(), storm::utility::zero<GeometryValueType>());
68 direction[objIndex] = storm::utility::one<GeometryValueType>();
69 this->performRefinementStep(env, std::move(direction));
77 std::vector<storm::storage::geometry::Halfspace<GeometryValueType>> underApproxHalfspaces = this->underApproximation->getHalfspaces();
78 std::vector<Point> overApproxVertices = this->overApproximation->getVertices();
79 uint_fast64_t farestHalfspaceIndex = underApproxHalfspaces.size();
80 GeometryValueType farestDistance = storm::utility::zero<GeometryValueType>();
81 for (uint_fast64_t halfspaceIndex = 0; halfspaceIndex < underApproxHalfspaces.size(); ++halfspaceIndex) {
82 for (
auto const& vertex : overApproxVertices) {
83 GeometryValueType distance = underApproxHalfspaces[halfspaceIndex].euclideanDistance(vertex);
84 if (distance > farestDistance) {
85 farestHalfspaceIndex = halfspaceIndex;
86 farestDistance = distance;
94 STORM_LOG_INFO(
"Current precision of the approximation of the pareto curve is ~" << storm::utility::convertNumber<double>(farestDistance));
95 WeightVector direction = underApproxHalfspaces[farestHalfspaceIndex].normalVector();
96 this->performRefinementStep(env, std::move(direction));
98 STORM_LOG_ERROR(
"Could not reach the desired precision: Termination requested or maximum number of refinement steps exceeded.");
101#ifdef STORM_HAVE_CARL
102template class SparsePcaaParetoQuery<storm::models::sparse::Mdp<double>, storm::RationalNumber>;
103template class SparsePcaaParetoQuery<storm::models::sparse::MarkovAutomaton<double>, storm::RationalNumber>;
105template class SparsePcaaParetoQuery<storm::models::sparse::Mdp<storm::RationalNumber>, storm::RationalNumber>;
106template class SparsePcaaParetoQuery<storm::models::sparse::MarkovAutomaton<storm::RationalNumber>, storm::RationalNumber>;
ModelCheckerEnvironment & modelchecker()
MultiObjectiveModelCheckerEnvironment & multi()
storm::RationalNumber const & getPrecision() const
PrecisionType const & getPrecisionType() const
SparsePcaaParetoQuery(preprocessing::SparseMultiObjectivePreprocessorResult< SparseModelType > &preprocessorResult)
virtual std::unique_ptr< CheckResult > check(Environment const &env) override
#define STORM_LOG_INFO(message)
#define STORM_LOG_ERROR(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
std::vector< GeometryValueType > transformObjectiveValuesToOriginal(std::vector< Objective< ValueType > > objectives, std::vector< GeometryValueType > const &point)
std::shared_ptr< storm::storage::geometry::Polytope< GeometryValueType > > transformObjectivePolytopeToOriginal(std::vector< Objective< ValueType > > objectives, std::shared_ptr< storm::storage::geometry::Polytope< GeometryValueType > > const &polytope)
bool isTerminate()
Check whether the program should terminate (due to some abort signal).
ValueType sqrt(ValueType const &number)