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