Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Model.cpp
Go to the documentation of this file.
2
3#include <boost/algorithm/string/join.hpp>
4
19#include "storm/utility/dd.h"
21
22namespace storm {
23namespace models {
24namespace symbolic {
25template<storm::dd::DdType Type, typename ValueType>
27 storm::dd::Bdd<Type> reachableStates, storm::dd::Bdd<Type> initialStates, storm::dd::Bdd<Type> deadlockStates,
28 storm::dd::Add<Type, ValueType> transitionMatrix, std::set<storm::expressions::Variable> const& rowVariables,
29 std::shared_ptr<storm::adapters::AddExpressionAdapter<Type, ValueType>> rowExpressionAdapter,
30 std::set<storm::expressions::Variable> const& columnVariables,
31 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& rowColumnMetaVariablePairs,
32 std::map<std::string, storm::expressions::Expression> labelToExpressionMap,
33 std::unordered_map<std::string, RewardModelType> const& rewardModels)
34 : storm::models::Model<ValueType>(modelType),
35 manager(manager),
36 reachableStates(reachableStates),
38 rowVariables(rowVariables),
39 rowExpressionAdapter(rowExpressionAdapter),
40 columnVariables(columnVariables),
41 rowColumnMetaVariablePairs(rowColumnMetaVariablePairs),
42 labelToExpressionMap(labelToExpressionMap),
43 rewardModels(rewardModels) {
44 this->labelToBddMap.emplace("init", initialStates);
45 this->labelToBddMap.emplace("deadlock", deadlockStates);
46}
47
48template<storm::dd::DdType Type, typename ValueType>
50 storm::dd::Bdd<Type> reachableStates, storm::dd::Bdd<Type> initialStates, storm::dd::Bdd<Type> deadlockStates,
51 storm::dd::Add<Type, ValueType> transitionMatrix, std::set<storm::expressions::Variable> const& rowVariables,
52 std::set<storm::expressions::Variable> const& columnVariables,
53 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& rowColumnMetaVariablePairs,
54 std::map<std::string, storm::dd::Bdd<Type>> labelToBddMap, std::unordered_map<std::string, RewardModelType> const& rewardModels)
55 : storm::models::Model<ValueType>(modelType),
56 manager(manager),
57 reachableStates(reachableStates),
59 rowVariables(rowVariables),
60 rowExpressionAdapter(nullptr),
61 columnVariables(columnVariables),
62 rowColumnMetaVariablePairs(rowColumnMetaVariablePairs),
63 labelToBddMap(labelToBddMap),
64 rewardModels(rewardModels) {
65 STORM_LOG_THROW(this->labelToBddMap.find("init") == this->labelToBddMap.end(), storm::exceptions::WrongFormatException, "Illegal custom label 'init'.");
66 STORM_LOG_THROW(this->labelToBddMap.find("deadlock") == this->labelToBddMap.end(), storm::exceptions::WrongFormatException,
67 "Illegal custom label 'deadlock'.");
68 this->labelToBddMap.emplace("init", initialStates);
69 this->labelToBddMap.emplace("deadlock", deadlockStates);
70}
71
72template<storm::dd::DdType Type, typename ValueType>
74 return reachableStates.getNonZeroCount();
75}
76
77template<storm::dd::DdType Type, typename ValueType>
79 return transitionMatrix.getNonZeroCount();
80}
81
82template<storm::dd::DdType Type, typename ValueType>
84 return reachableStates.getNonZeroCount();
85}
86
87template<storm::dd::DdType Type, typename ValueType>
91
92template<storm::dd::DdType Type, typename ValueType>
93std::shared_ptr<storm::dd::DdManager<Type>> const& Model<Type, ValueType>::getManagerAsSharedPointer() const {
94 return manager;
95}
96
97template<storm::dd::DdType Type, typename ValueType>
99 return reachableStates;
100}
101
102template<storm::dd::DdType Type, typename ValueType>
104 return labelToBddMap.at("init");
106
107template<storm::dd::DdType Type, typename ValueType>
109 return labelToBddMap.at("deadlock");
110}
111
112template<storm::dd::DdType Type, typename ValueType>
114 // First check whether we have a BDD for this label.
115 auto bddIt = labelToBddMap.find(label);
116 if (bddIt != labelToBddMap.end()) {
117 return bddIt->second;
118 } else {
119 // If not, check for an expression we can translate.
120 auto expressionIt = labelToExpressionMap.find(label);
121 STORM_LOG_THROW(expressionIt != labelToExpressionMap.end(), storm::exceptions::IllegalArgumentException,
122 "The label " << label << " is invalid for the labeling of the model.");
123 return this->getStates(expressionIt->second);
124 }
125}
126
127template<storm::dd::DdType Type, typename ValueType>
129 auto expressionIt = labelToExpressionMap.find(label);
130 STORM_LOG_THROW(expressionIt != labelToExpressionMap.end(), storm::exceptions::IllegalArgumentException,
131 "Cannot retrieve the expression for the label " << label << ".");
132 return expressionIt->second;
133}
134
135template<storm::dd::DdType Type, typename ValueType>
137 if (expression.isTrue()) {
138 return this->getReachableStates();
139 } else if (expression.isFalse()) {
140 return manager->getBddZero();
141 }
143 // Look up the string equivalent of the expression.
144 std::stringstream stream;
145 stream << expression;
146 auto bddIt = labelToBddMap.find(stream.str());
147 if (bddIt != labelToBddMap.end()) {
148 return bddIt->second;
149 }
151 // Finally try to translate the expression with an adapter.
152 STORM_LOG_THROW(rowExpressionAdapter != nullptr, storm::exceptions::InvalidOperationException,
153 "Cannot create BDD for expression without expression adapter.");
154 return rowExpressionAdapter->translateExpression(expression).toBdd() && this->reachableStates;
155}
156
157template<storm::dd::DdType Type, typename ValueType>
158bool Model<Type, ValueType>::hasLabel(std::string const& label) const {
159 auto bddIt = labelToBddMap.find(label);
160 if (bddIt != labelToBddMap.end()) {
161 return true;
162 }
163
164 auto expressionIt = labelToExpressionMap.find(label);
165 if (expressionIt != labelToExpressionMap.end()) {
166 return true;
167 } else {
168 return false;
169 }
170}
171
172template<storm::dd::DdType Type, typename ValueType>
175}
176
177template<storm::dd::DdType Type, typename ValueType>
182template<storm::dd::DdType Type, typename ValueType>
184 return this->getTransitionMatrix().notZero();
185}
186
187template<storm::dd::DdType Type, typename ValueType>
188std::set<storm::expressions::Variable> const& Model<Type, ValueType>::getRowVariables() const {
189 return rowVariables;
190}
191
192template<storm::dd::DdType Type, typename ValueType>
193std::set<storm::expressions::Variable> const& Model<Type, ValueType>::getColumnVariables() const {
194 return columnVariables;
195}
196
197template<storm::dd::DdType Type, typename ValueType>
198std::set<storm::expressions::Variable> Model<Type, ValueType>::getRowAndNondeterminismVariables() const {
199 std::set<storm::expressions::Variable> result;
200 std::set_union(this->getRowVariables().begin(), this->getRowVariables().end(), this->getNondeterminismVariables().begin(),
201 this->getNondeterminismVariables().end(), std::inserter(result, result.begin()));
202 return result;
203}
205template<storm::dd::DdType Type, typename ValueType>
206std::set<storm::expressions::Variable> Model<Type, ValueType>::getColumnAndNondeterminismVariables() const {
207 std::set<storm::expressions::Variable> result;
208 std::set_union(this->getColumnVariables().begin(), this->getColumnVariables().end(), this->getNondeterminismVariables().begin(),
209 this->getNondeterminismVariables().end(), std::inserter(result, result.begin()));
210 return result;
212
213template<storm::dd::DdType Type, typename ValueType>
214std::set<storm::expressions::Variable> const& Model<Type, ValueType>::getNondeterminismVariables() const {
215 return emptyVariableSet;
216}
217
218template<storm::dd::DdType Type, typename ValueType>
219std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& Model<Type, ValueType>::getRowColumnMetaVariablePairs() const {
220 return rowColumnMetaVariablePairs;
221}
222
223template<storm::dd::DdType Type, typename ValueType>
224std::map<std::string, storm::expressions::Expression> const& Model<Type, ValueType>::getLabelToExpressionMap() const {
225 return labelToExpressionMap;
226}
227
228template<storm::dd::DdType Type, typename ValueType>
229std::map<std::string, storm::dd::Bdd<Type>> const& Model<Type, ValueType>::getLabelToBddMap() const {
230 return labelToBddMap;
231}
233template<storm::dd::DdType Type, typename ValueType>
238
239template<storm::dd::DdType Type, typename ValueType>
240bool Model<Type, ValueType>::hasRewardModel(std::string const& rewardModelName) const {
241 return this->rewardModels.find(rewardModelName) != this->rewardModels.end();
242}
243
244template<storm::dd::DdType Type, typename ValueType>
245typename Model<Type, ValueType>::RewardModelType const& Model<Type, ValueType>::getRewardModel(std::string const& rewardModelName) const {
246 auto it = this->rewardModels.find(rewardModelName);
247 if (it == this->rewardModels.end()) {
248 if (rewardModelName.empty()) {
249 if (this->hasUniqueRewardModel()) {
250 return this->getUniqueRewardModel();
251 } else {
252 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException,
253 "Unable to refer to default reward model, because there is no default model or it is not unique.");
254 }
255 } else {
256 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "The requested reward model '" << rewardModelName << "' does not exist.");
257 }
258 }
259 return it->second;
261
262template<storm::dd::DdType Type, typename ValueType>
264 STORM_LOG_THROW(this->hasUniqueRewardModel(), storm::exceptions::InvalidOperationException,
265 "Cannot retrieve unique reward model, because there is no unique one.");
266 return this->rewardModels.cbegin()->second;
268
269template<storm::dd::DdType Type, typename ValueType>
271 STORM_LOG_THROW(this->hasUniqueRewardModel(), storm::exceptions::InvalidOperationException,
272 "Cannot retrieve name of unique reward model, because there is no unique one.");
273 return this->rewardModels.cbegin()->first;
275
276template<storm::dd::DdType Type, typename ValueType>
278 STORM_LOG_THROW(this->hasUniqueRewardModel(), storm::exceptions::InvalidOperationException,
279 "Cannot retrieve unique reward model, because there is no unique one.");
280 return this->rewardModels.begin()->second;
281}
282
283template<storm::dd::DdType Type, typename ValueType>
285 return this->rewardModels.size() == 1;
286}
287
288template<storm::dd::DdType Type, typename ValueType>
290 return !this->rewardModels.empty();
291}
292
293template<storm::dd::DdType Type, typename ValueType>
294std::unordered_map<std::string, typename Model<Type, ValueType>::RewardModelType>& Model<Type, ValueType>::getRewardModels() {
295 return this->rewardModels;
296}
298template<storm::dd::DdType Type, typename ValueType>
299std::unordered_map<std::string, typename Model<Type, ValueType>::RewardModelType> const& Model<Type, ValueType>::getRewardModels() const {
300 return this->rewardModels;
301}
303template<storm::dd::DdType Type, typename ValueType>
307}
309template<storm::dd::DdType Type, typename ValueType>
310std::vector<std::string> Model<Type, ValueType>::getLabels() const {
311 std::vector<std::string> labels;
312 for (auto const& entry : labelToExpressionMap) {
313 labels.push_back(entry.first);
314 }
315 return labels;
317
318template<storm::dd::DdType Type, typename ValueType>
320 out << "-------------------------------------------------------------- \n";
321 out << "Model type: \t" << (storm::IsIntervalType<ValueType> ? "I" : "") << this->getType() << " (symbolic)\n";
322 out << "States: \t" << this->getNumberOfStates() << " (" << reachableStates.getNodeCount() << " nodes)\n";
323 out << "Transitions: \t" << this->getNumberOfTransitions() << " (" << transitionMatrix.getNodeCount() << " nodes)\n";
324}
326template<storm::dd::DdType Type, typename ValueType>
330 out << "\nLabels: \t" << (this->labelToExpressionMap.size() + this->labelToBddMap.size()) << '\n';
331 for (auto const& label : labelToBddMap) {
332 out << " * " << label.first << " -> " << label.second.getNonZeroCount() << " state(s) (" << label.second.getNodeCount() << " nodes)\n";
333 }
334 for (auto const& label : labelToExpressionMap) {
335 out << " * " << label.first << '\n';
336 }
337 out << "-------------------------------------------------------------- \n";
339
340template<storm::dd::DdType Type, typename ValueType>
342 if (this->rewardModels.size()) {
343 std::vector<std::string> rewardModelNames;
344 std::for_each(this->rewardModels.cbegin(), this->rewardModels.cend(),
345 [&rewardModelNames](typename std::pair<std::string, RewardModelType> const& nameRewardModelPair) {
346 if (nameRewardModelPair.first.empty()) {
347 rewardModelNames.push_back("(default)");
348 } else {
349 rewardModelNames.push_back(nameRewardModelPair.first);
350 }
351 });
352 out << "Reward Models: " << boost::join(rewardModelNames, ", ") << '\n';
353 } else {
354 out << "Reward Models: none\n";
355 }
356}
357
358template<storm::dd::DdType Type, typename ValueType>
360 uint_fast64_t rowVariableCount = 0;
361 for (auto const& metaVariable : this->rowVariables) {
362 rowVariableCount += this->getManager().getMetaVariable(metaVariable).getNumberOfDdVariables();
363 }
364 uint_fast64_t columnVariableCount = 0;
365 for (auto const& metaVariable : this->columnVariables) {
366 columnVariableCount += this->getManager().getMetaVariable(metaVariable).getNumberOfDdVariables();
368
369 out << "Variables: \t"
370 << "rows: " << this->rowVariables.size() << " meta variables (" << rowVariableCount << " DD variables)"
371 << ", columns: " << this->columnVariables.size() << " meta variables (" << columnVariableCount << " DD variables)";
372}
373
374template<storm::dd::DdType Type, typename ValueType>
375std::shared_ptr<storm::adapters::AddExpressionAdapter<Type, ValueType>> const& Model<Type, ValueType>::getRowExpressionAdapter() const {
376 return this->rowExpressionAdapter;
377}
378
379template<storm::dd::DdType Type, typename ValueType>
381 return true;
383
384template<storm::dd::DdType Type, typename ValueType>
385std::optional<storm::dd::DdType> Model<Type, ValueType>::getDdType() const {
386 return Type;
387}
388
389template<storm::dd::DdType Type, typename ValueType>
393
394template<storm::dd::DdType Type, typename ValueType>
396 return std::is_same<ValueType, storm::RationalFunction>::value;
397}
398
399template<storm::dd::DdType Type, typename ValueType>
400void Model<Type, ValueType>::writeDotToFile(std::string const& filename) const {
401 this->getTransitionMatrix().exportToDot(filename, true);
402 this->getInitialStates().exportToDot(filename, true);
403 for (auto const& lab : this->getLabels()) {
404 this->getStates(lab).exportToDot(filename, true);
405 }
406}
407
408template<storm::dd::DdType Type, typename ValueType>
410 if (!this->supportsParameters()) {
411 return false;
412 }
413 // Check for parameters
414 for (auto it = this->getTransitionMatrix().begin(false); it != this->getTransitionMatrix().end(); ++it) {
415 if (!storm::utility::isConstant((*it).second)) {
416 return true;
417 }
418 }
419 // Only constant values present
420 return false;
421}
422
423template<storm::dd::DdType Type, typename ValueType>
424void Model<Type, ValueType>::addParameters(std::set<storm::RationalFunctionVariable> const& parameters) {
425 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "This value type does not support parameters.");
426}
427
428template<storm::dd::DdType Type, typename ValueType>
429std::set<storm::RationalFunctionVariable> const& Model<Type, ValueType>::getParameters() const {
430 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "This value type does not support parameters.");
431}
432
433template<>
434void Model<storm::dd::DdType::Sylvan, storm::RationalFunction>::addParameters(std::set<storm::RationalFunctionVariable> const& parameters) {
435 this->parameters.insert(parameters.begin(), parameters.end());
436}
437
438template<>
439std::set<storm::RationalFunctionVariable> const& Model<storm::dd::DdType::Sylvan, storm::RationalFunction>::getParameters() const {
440 return parameters;
441}
442
443template<storm::dd::DdType Type, typename ValueType>
444template<typename NewValueType>
445typename std::enable_if<!std::is_same<ValueType, NewValueType>::value, std::shared_ptr<Model<Type, NewValueType>>>::type Model<Type, ValueType>::toValueType()
446 const {
447 STORM_LOG_TRACE("Converting value type of symbolic model from " << typeid(ValueType).name() << " to " << typeid(NewValueType).name() << ".");
448
449 // Make a huge branching here as we cannot make a templated function virtual.
452 } else if (this->getType() == storm::models::ModelType::Ctmc) {
454 } else if (this->getType() == storm::models::ModelType::Mdp) {
458 } else if (this->getType() == storm::models::ModelType::S2pg) {
460 }
461
462 STORM_LOG_WARN("Could not convert value type of model.");
463 return nullptr;
464}
465
466template<storm::dd::DdType Type, typename ValueType>
467template<typename NewValueType>
468typename std::enable_if<std::is_same<ValueType, NewValueType>::value, std::shared_ptr<Model<Type, NewValueType>>>::type Model<Type, ValueType>::toValueType()
469 const {
470 // Make a huge branching here as we cannot make a templated function virtual.
471 if (this->getType() == storm::models::ModelType::Dtmc) {
472 return std::make_shared<storm::models::symbolic::Dtmc<Type, ValueType>>(*this->template as<storm::models::symbolic::Dtmc<Type, ValueType>>());
473 } else if (this->getType() == storm::models::ModelType::Ctmc) {
474 return std::make_shared<storm::models::symbolic::Ctmc<Type, ValueType>>(*this->template as<storm::models::symbolic::Ctmc<Type, ValueType>>());
475 } else if (this->getType() == storm::models::ModelType::Mdp) {
476 return std::make_shared<storm::models::symbolic::Mdp<Type, ValueType>>(*this->template as<storm::models::symbolic::Mdp<Type, ValueType>>());
477 } else if (this->getType() == storm::models::ModelType::MarkovAutomaton) {
478 return std::make_shared<storm::models::symbolic::MarkovAutomaton<Type, ValueType>>(
479 *this->template as<storm::models::symbolic::MarkovAutomaton<Type, ValueType>>());
480 } else if (this->getType() == storm::models::ModelType::S2pg) {
481 return std::make_shared<storm::models::symbolic::StochasticTwoPlayerGame<Type, ValueType>>(
482 *this->template as<storm::models::symbolic::StochasticTwoPlayerGame<Type, ValueType>>());
483 }
484
485 STORM_LOG_WARN("Could not convert value type of model.");
486 return nullptr;
487}
488
489// Explicitly instantiate the template class.
491template typename std::enable_if<std::is_same<double, double>::value, std::shared_ptr<Model<storm::dd::DdType::CUDD, double>>>::type
493
496template typename std::enable_if<std::is_same<double, double>::value, std::shared_ptr<Model<storm::dd::DdType::Sylvan, double>>>::type
498template typename std::enable_if<std::is_same<storm::RationalNumber, storm::RationalNumber>::value,
499 std::shared_ptr<Model<storm::dd::DdType::Sylvan, storm::RationalNumber>>>::type
501template typename std::enable_if<std::is_same<storm::RationalFunction, storm::RationalFunction>::value,
502 std::shared_ptr<Model<storm::dd::DdType::Sylvan, storm::RationalFunction>>>::type
504template typename std::enable_if<!std::is_same<storm::RationalNumber, double>::value, std::shared_ptr<Model<storm::dd::DdType::Sylvan, double>>>::type
507
508} // namespace symbolic
509} // namespace models
510} // namespace storm
bool isFalse() const
Checks if the expression is equal to the boolean literal false.
bool isTrue() const
Checks if the expression is equal to the boolean literal true.
virtual bool isExact() const
Checks whether the model is exact.
Definition ModelBase.cpp:62
virtual bool isSymbolicModel() const
Checks whether the model is a symbolic model.
Definition ModelBase.cpp:15
virtual std::optional< storm::dd::DdType > getDdType() const
Definition ModelBase.cpp:19
virtual bool hasParameters() const
Checks whether the model has parameters.
Definition ModelBase.cpp:58
virtual ModelType getType() const
Return the actual type of the model.
Definition ModelBase.cpp:7
std::shared_ptr< ModelType > as()
Casts the model into the model type given by the template parameter.
Definition ModelBase.h:38
virtual bool supportsParameters() const
Checks whether the model supports parameters.
Definition ModelBase.cpp:54
storm::dd::DdManager< Type > & getManager() const
Retrieves the manager responsible for the DDs that represent this model.
Definition Model.cpp:88
RewardModelType const & getRewardModel(std::string const &rewardModelName) const
Retrieves the reward model with the given name, if one exists.
Definition Model.cpp:245
void addParameters(std::set< storm::RationalFunctionVariable > const &parameters)
Definition Model.cpp:424
storm::dd::Add< Type, ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
Definition Model.cpp:173
storm::dd::Bdd< Type > const & getDeadlockStates() const
Definition Model.cpp:108
virtual void printModelInformationToStream(std::ostream &out) const override
Prints information about the model to the specified stream.
Definition Model.cpp:304
virtual storm::expressions::Expression getExpression(std::string const &label) const
Returns the expression for the given label.
Definition Model.cpp:128
std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > const & getRowExpressionAdapter() const
Retrieves the expression adapter of this model.
Definition Model.cpp:375
void writeDotToFile(std::string const &filename) const
Definition Model.cpp:400
RewardModelType const & getUniqueRewardModel() const
Definition Model.cpp:263
virtual void printDdVariableInformationToStream(std::ostream &out) const
Prints information about the DD variables to the specified stream.
Definition Model.cpp:359
virtual std::string const & getUniqueRewardModelName() const override
Retrieves the name of the unique reward model, if there exists exactly one.
Definition Model.cpp:270
std::set< storm::expressions::Variable > const & getColumnVariables() const
Retrieves the meta variables used to encode the columns of the transition matrix and the vector indic...
Definition Model.cpp:193
std::shared_ptr< storm::dd::DdManager< Type > > const & getManagerAsSharedPointer() const
Retrieves the manager responsible for the DDs that represent this model.
Definition Model.cpp:93
virtual storm::dd::Bdd< Type > getQualitativeTransitionMatrix(bool keepNondeterminism=true) const
Retrieves the matrix qualitatively (i.e.
Model(Model< Type, ValueType > const &other)=default
std::enable_if<!std::is_same< ValueType, NewValueType >::value, std::shared_ptr< Model< Type, NewValueType > > >::type toValueType() const
Definition Model.cpp:445
std::vector< std::string > getLabels() const
Definition Model.cpp:310
storm::dd::Add< Type, ValueType > getRowColumnIdentity() const
Retrieves an ADD that represents the diagonal of the transition matrix.
Definition Model.cpp:234
void printRewardModelsInformationToStream(std::ostream &out) const
Prints information about the reward models to the specified stream.
Definition Model.cpp:341
virtual bool supportsParameters() const override
Checks whether the model supports parameters.
Definition Model.cpp:395
std::map< std::string, storm::dd::Bdd< Type > > const & getLabelToBddMap() const
Retrieves the mapping of labels to their defining expressions.
Definition Model.cpp:229
std::set< storm::RationalFunctionVariable > const & getParameters() const
Definition Model.cpp:429
storm::dd::Bdd< Type > const & getInitialStates() const
Retrieves the initial states of the model.
Definition Model.cpp:103
storm::dd::Add< Type, ValueType > transitionMatrix
Definition Model.h:393
virtual std::set< storm::expressions::Variable > const & getNondeterminismVariables() const
Retrieves all meta variables used to encode the nondeterminism.
Definition Model.cpp:214
void printModelInformationFooterToStream(std::ostream &out) const
Definition Model.cpp:327
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const & getRowColumnMetaVariablePairs() const
Retrieves the pairs of row and column meta variables.
Definition Model.cpp:219
std::set< storm::expressions::Variable > const & getRowVariables() const
Retrieves the meta variables used to encode the rows of the transition matrix and the vector indices.
Definition Model.cpp:188
virtual bool hasLabel(std::string const &label) const
Retrieves whether the given label is a valid label in this model.
Definition Model.cpp:158
std::map< std::string, storm::expressions::Expression > const & getLabelToExpressionMap() const
Retrieves the mapping of labels to their defining expressions.
Definition Model.cpp:224
void printModelInformationHeaderToStream(std::ostream &out) const
Definition Model.cpp:319
std::unordered_map< std::string, RewardModelType > & getRewardModels()
Definition Model.cpp:294
virtual uint_fast64_t getNumberOfChoices() const override
Returns the number of choices ine the model.
Definition Model.cpp:83
std::set< storm::expressions::Variable > getRowAndNondeterminismVariables() const
Retrieves all meta variables used to encode rows and nondetermism.
Definition Model.cpp:198
std::set< storm::expressions::Variable > getColumnAndNondeterminismVariables() const
Retrieves all meta variables used to encode columns and nondetermism.
Definition Model.cpp:206
virtual storm::dd::Bdd< Type > getStates(std::string const &label) const
Returns the sets of states labeled with the given label.
Definition Model.cpp:113
virtual uint_fast64_t getNumberOfTransitions() const override
Returns the number of (non-zero) transitions of the model.
Definition Model.cpp:78
StandardRewardModel< Type, ValueType > RewardModelType
Definition Model.h:47
bool hasRewardModel() const
Retrieves whether the model has at least one reward model.
Definition Model.cpp:289
virtual bool hasUniqueRewardModel() const override
Definition Model.cpp:284
storm::dd::Bdd< Type > const & getReachableStates() const
Retrieves the reachable states of the model.
Definition Model.cpp:98
virtual uint_fast64_t getNumberOfStates() const override
Returns the number of states of the model.
Definition Model.cpp:73
#define STORM_LOG_WARN(message)
Definition logging.h:28
#define STORM_LOG_TRACE(message)
Definition logging.h:15
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:28
storm::dd::Bdd< Type > getRowColumnDiagonal(storm::dd::DdManager< Type > const &ddManager, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs)
Definition dd.cpp:88
bool isConstant(ValueType const &)
constexpr bool IsIntervalType
Helper to check if a type is an interval.
static const bool IsExact