Browse Source

Added function to retrieve range DD for meta variable.

Former-commit-id: 32ef6715f4
tempestpy_adaptions
dehnert 11 years ago
parent
commit
a63cda69f5
  1. 10
      src/storage/dd/CuddDdManager.cpp
  2. 9
      src/storage/dd/CuddDdManager.h

10
src/storage/dd/CuddDdManager.cpp

@ -39,6 +39,16 @@ namespace storm {
return result;
}
Dd<CUDD> DdManager<CUDD>::getRange(std::string const metaVariableName) {
storm::dd::DdMetaVariable<CUDD> const& metaVariable = this->getMetaVariable(metaVariableName);
Dd<CUDD> result = this->getZero();
for (int_fast64_t value = metaVariable.getLow(); value <= metaVariable.getHigh(); ++value) {
result.setValue(metaVariableName, value - metaVariable.getLow(), static_cast<double>(value));
}
return result;
}
void DdManager<CUDD>::addMetaVariable(std::string const& name, int_fast64_t low, int_fast64_t high) {
if (high == low) {

9
src/storage/dd/CuddDdManager.h

@ -62,6 +62,15 @@ namespace storm {
*/
Dd<CUDD> getEncoding(std::string const& metaVariableName, int_fast64_t value);
/*!
* Retrieves the DD representing the range of the meta variable, i.e., a function that maps all legal values
* of the range of the meta variable to one.
*
* @param metaVariableName The name of the meta variable whose range to retrieve.
* @return The range of the meta variable
*/
Dd<CUDD> getRange(std::string const metaVariableName);
/*!
* Adds a meta variable with the given name and range.
*

Loading…
Cancel
Save