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