Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseCbQuery.cpp
Go to the documentation of this file.
2
12
15
16namespace storm {
17namespace modelchecker {
18namespace multiobjective {
19
20template<class SparseModelType>
22 : originalModel(preprocessorResult.originalModel),
23 originalFormula(preprocessorResult.originalFormula),
24 objectives(std::move(preprocessorResult.objectives)) {
26 STORM_LOG_THROW(rewardAnalysis.rewardFinitenessType != preprocessing::RewardFinitenessType::Infinite, storm::exceptions::NotSupportedException,
27 "TThere is no Pareto optimal scheduler that yields finite reward for all objectives. This is not supported.");
28
29 STORM_LOG_THROW(rewardAnalysis.totalRewardLessInfinityEStates, storm::exceptions::UnexpectedException,
30 "The set of states with reward < infinity for some scheduler has not been computed during preprocessing.");
31 STORM_LOG_THROW(preprocessorResult.containsOnlyTrivialObjectives(), storm::exceptions::NotSupportedException,
32 "At least one objective was not reduced to an expected (total or cumulative) reward objective during preprocessing. This is not supported "
33 "by the considered weight vector checker.");
34 STORM_LOG_THROW(preprocessorResult.preprocessedModel->getInitialStates().getNumberOfSetBits() == 1, storm::exceptions::NotSupportedException,
35 "The model has multiple initial states.");
36
37 // Build a subsystem of the preprocessor result model that discards states that yield infinite reward for all schedulers.
38 // We can also merge the states that will have reward zero anyway.
39 storm::storage::BitVector maybeStates = rewardAnalysis.totalRewardLessInfinityEStates.get() & ~rewardAnalysis.reward0AStates;
40 std::set<std::string> relevantRewardModels;
41 for (auto const& obj : this->objectives) {
42 obj.formula->gatherReferencedRewardModels(relevantRewardModels);
43 }
45 auto mergerResult = merger.mergeTargetAndSinkStates(maybeStates, rewardAnalysis.reward0AStates, storm::storage::BitVector(maybeStates.size(), false),
46 std::vector<std::string>(relevantRewardModels.begin(), relevantRewardModels.end()));
47
48 preprocessedModel = mergerResult.model;
49 reward0EStates = rewardAnalysis.totalReward0EStates % maybeStates;
50 if (mergerResult.targetState) {
51 // There is an additional state in the result
53 }
54 expressionManager = std::make_shared<storm::expressions::ExpressionManager>();
55}
56
57#ifdef STORM_HAVE_CARL
60
63#endif
64} // namespace multiobjective
65} // namespace modelchecker
66} // namespace storm
std::shared_ptr< storm::expressions::ExpressionManager > expressionManager
std::shared_ptr< SparseModelType > preprocessedModel
std::vector< Objective< typename SparseModelType::ValueType > > objectives
SparseCbQuery(preprocessing::SparseMultiObjectivePreprocessorResult< SparseModelType > const &preprocessorResult)
static ReturnType analyze(storm::modelchecker::multiobjective::preprocessing::SparseMultiObjectivePreprocessorResult< SparseModelType > const &preprocessorResult)
Analyzes the reward objectives of the multi objective query.
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
void resize(uint_fast64_t newLength, bool init=false)
Resizes the bit vector to hold the given new number of bits.
size_t size() const
Retrieves the number of bits this bit vector can store.
bool get(uint_fast64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
ReturnType mergeTargetAndSinkStates(storm::storage::BitVector const &maybeStates, storm::storage::BitVector const &targetStates, storm::storage::BitVector const &sinkStates, std::vector< std::string > const &selectedRewardModels=std::vector< std::string >(), boost::optional< storm::storage::BitVector > const &choiceFilter=boost::none) const
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
LabParser.cpp.
Definition cli.cpp:18
std::shared_ptr< SparseModelType > model