Storm 1.11.1.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),
37 transitionMatrix(transitionMatrix),
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),
58 transitionMatrix(transitionMatrix),
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>
174 return transitionMatrix;
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>
235 return (storm::utility::dd::getRowColumnDiagonal<Type>(this->getManager(), this->getRowColumnMetaVariablePairs()) && this->getReachableStates())
236 .template toAdd<ValueType>();
237}
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;
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>
305 this->printModelInformationHeaderToStream(out);
306 this->printModelInformationFooterToStream(out);
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>
328 this->printRewardModelsInformationToStream(out);
329 this->printDdVariableInformationToStream(out);
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" << "rows: " << this->rowVariables.size() << " meta variables (" << rowVariableCount << " DD variables)"
370 << ", columns: " << this->columnVariables.size() << " meta variables (" << columnVariableCount << " DD variables)";
371}
372
373template<storm::dd::DdType Type, typename ValueType>
374std::shared_ptr<storm::adapters::AddExpressionAdapter<Type, ValueType>> const& Model<Type, ValueType>::getRowExpressionAdapter() const {
375 return this->rowExpressionAdapter;
376}
377
378template<storm::dd::DdType Type, typename ValueType>
380 return true;
381}
383template<storm::dd::DdType Type, typename ValueType>
384std::optional<storm::dd::DdType> Model<Type, ValueType>::getDdType() const {
385 return Type;
386}
387
388template<storm::dd::DdType Type, typename ValueType>
392
393template<storm::dd::DdType Type, typename ValueType>
395 return std::is_same<ValueType, storm::RationalFunction>::value;
396}
397
398template<storm::dd::DdType Type, typename ValueType>
399void Model<Type, ValueType>::writeDotToFile(std::string const& filename) const {
400 this->getTransitionMatrix().exportToDot(filename, true);
401 this->getInitialStates().exportToDot(filename, true);
402 for (auto const& lab : this->getLabels()) {
403 this->getStates(lab).exportToDot(filename, true);
404 }
405}
406
407template<storm::dd::DdType Type, typename ValueType>
409 if (!this->supportsParameters()) {
410 return false;
411 }
412 // Check for parameters
413 for (auto it = this->getTransitionMatrix().begin(false); it != this->getTransitionMatrix().end(); ++it) {
414 if (!storm::utility::isConstant((*it).second)) {
415 return true;
416 }
417 }
418 // Only constant values present
419 return false;
420}
421
422template<storm::dd::DdType Type, typename ValueType>
423void Model<Type, ValueType>::addParameters(std::set<storm::RationalFunctionVariable> const& parameters) {
424 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "This value type does not support parameters.");
425}
426
427template<storm::dd::DdType Type, typename ValueType>
428std::set<storm::RationalFunctionVariable> const& Model<Type, ValueType>::getParameters() const {
429 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "This value type does not support parameters.");
430}
431
432template<>
433void Model<storm::dd::DdType::Sylvan, storm::RationalFunction>::addParameters(std::set<storm::RationalFunctionVariable> const& parameters) {
434 this->parameters.insert(parameters.begin(), parameters.end());
435}
436
437template<>
438std::set<storm::RationalFunctionVariable> const& Model<storm::dd::DdType::Sylvan, storm::RationalFunction>::getParameters() const {
439 return parameters;
440}
441
442template<storm::dd::DdType Type, typename ValueType>
443template<typename NewValueType>
444typename std::enable_if<!std::is_same<ValueType, NewValueType>::value, std::shared_ptr<Model<Type, NewValueType>>>::type Model<Type, ValueType>::toValueType()
445 const {
446 STORM_LOG_TRACE("Converting value type of symbolic model from " << typeid(ValueType).name() << " to " << typeid(NewValueType).name() << ".");
447
448 // Make a huge branching here as we cannot make a templated function virtual.
449 if (this->getType() == storm::models::ModelType::Dtmc) {
450 return this->template as<storm::models::symbolic::Dtmc<Type, ValueType>>()->template toValueType<NewValueType>();
451 } else if (this->getType() == storm::models::ModelType::Ctmc) {
452 return this->template as<storm::models::symbolic::Ctmc<Type, ValueType>>()->template toValueType<NewValueType>();
453 } else if (this->getType() == storm::models::ModelType::Mdp) {
454 return this->template as<storm::models::symbolic::Mdp<Type, ValueType>>()->template toValueType<NewValueType>();
455 } else if (this->getType() == storm::models::ModelType::MarkovAutomaton) {
456 return this->template as<storm::models::symbolic::MarkovAutomaton<Type, ValueType>>()->template toValueType<NewValueType>();
457 } else if (this->getType() == storm::models::ModelType::S2pg) {
458 return this->template as<storm::models::symbolic::StochasticTwoPlayerGame<Type, ValueType>>()->template toValueType<NewValueType>();
459 }
460
461 STORM_LOG_WARN("Could not convert value type of model.");
462 return nullptr;
463}
464
465template<storm::dd::DdType Type, typename ValueType>
466template<typename NewValueType>
467typename std::enable_if<std::is_same<ValueType, NewValueType>::value, std::shared_ptr<Model<Type, NewValueType>>>::type Model<Type, ValueType>::toValueType()
468 const {
469 // Make a huge branching here as we cannot make a templated function virtual.
470 if (this->getType() == storm::models::ModelType::Dtmc) {
471 return std::make_shared<storm::models::symbolic::Dtmc<Type, ValueType>>(*this->template as<storm::models::symbolic::Dtmc<Type, ValueType>>());
472 } else if (this->getType() == storm::models::ModelType::Ctmc) {
473 return std::make_shared<storm::models::symbolic::Ctmc<Type, ValueType>>(*this->template as<storm::models::symbolic::Ctmc<Type, ValueType>>());
474 } else if (this->getType() == storm::models::ModelType::Mdp) {
475 return std::make_shared<storm::models::symbolic::Mdp<Type, ValueType>>(*this->template as<storm::models::symbolic::Mdp<Type, ValueType>>());
476 } else if (this->getType() == storm::models::ModelType::MarkovAutomaton) {
477 return std::make_shared<storm::models::symbolic::MarkovAutomaton<Type, ValueType>>(
478 *this->template as<storm::models::symbolic::MarkovAutomaton<Type, ValueType>>());
479 } else if (this->getType() == storm::models::ModelType::S2pg) {
480 return std::make_shared<storm::models::symbolic::StochasticTwoPlayerGame<Type, ValueType>>(
481 *this->template as<storm::models::symbolic::StochasticTwoPlayerGame<Type, ValueType>>());
482 }
483
484 STORM_LOG_WARN("Could not convert value type of model.");
485 return nullptr;
486}
487
488// Explicitly instantiate the template class.
489template class Model<storm::dd::DdType::CUDD, double>;
490template typename std::enable_if<std::is_same<double, double>::value, std::shared_ptr<Model<storm::dd::DdType::CUDD, double>>>::type
491Model<storm::dd::DdType::CUDD, double>::toValueType<double>() const;
492
493template class Model<storm::dd::DdType::Sylvan, double>;
494template class Model<storm::dd::DdType::Sylvan, storm::RationalNumber>;
495template typename std::enable_if<std::is_same<double, double>::value, std::shared_ptr<Model<storm::dd::DdType::Sylvan, double>>>::type
496Model<storm::dd::DdType::Sylvan, double>::toValueType<double>() const;
497template typename std::enable_if<std::is_same<storm::RationalNumber, storm::RationalNumber>::value,
498 std::shared_ptr<Model<storm::dd::DdType::Sylvan, storm::RationalNumber>>>::type
499Model<storm::dd::DdType::Sylvan, storm::RationalNumber>::toValueType<storm::RationalNumber>() const;
500template typename std::enable_if<std::is_same<storm::RationalFunction, storm::RationalFunction>::value,
501 std::shared_ptr<Model<storm::dd::DdType::Sylvan, storm::RationalFunction>>>::type
502Model<storm::dd::DdType::Sylvan, storm::RationalFunction>::toValueType<storm::RationalFunction>() const;
503template typename std::enable_if<!std::is_same<storm::RationalNumber, double>::value, std::shared_ptr<Model<storm::dd::DdType::Sylvan, double>>>::type
504Model<storm::dd::DdType::Sylvan, storm::RationalNumber>::toValueType<double>() const;
505template class Model<storm::dd::DdType::Sylvan, storm::RationalFunction>;
506
507} // namespace symbolic
508} // namespace models
509} // 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 bool supportsParameters() const
Checks whether the model supports parameters.
Definition ModelBase.cpp:54
Base class for all symbolic models.
Definition Model.h:42
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
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
RewardModelType const & getUniqueRewardModel() const
Retrieves the unique reward model, if there exists exactly one.
Definition Model.cpp:263
virtual std::string const & getUniqueRewardModelName() const override
Retrieves the name of the unique reward model, if there exists exactly one.
Definition Model.cpp:270
virtual storm::dd::Bdd< Type > getQualitativeTransitionMatrix(bool keepNondeterminism=true) const
Retrieves the matrix qualitatively (i.e.
Definition Model.cpp:183
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
Model(Model< Type, ValueType > const &other)=default
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
std::map< std::string, storm::dd::Bdd< Type > > const & getLabelToBddMap() const
Retrieves the mapping of labels to their defining expressions.
Definition Model.cpp:229
storm::dd::Bdd< Type > const & getInitialStates() const
Retrieves the initial states of the model.
Definition Model.cpp:103
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
Prints the information footer (reward models, labels) of the model to the specified stream.
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
Prints the information header (number of states and transitions) of the model to the specified stream...
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
bool hasRewardModel() const
Retrieves whether the model has at least one reward model.
Definition Model.cpp:289
virtual bool hasUniqueRewardModel() const override
Retrieves whether the model has a unique reward model.
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:25
#define STORM_LOG_TRACE(message)
Definition logging.h:12
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
bool isConstant(ValueType const &)