|
@ -638,6 +638,22 @@ namespace storm { |
|
|
return constantToIndex.find(name) != constantToIndex.end(); |
|
|
return constantToIndex.find(name) != constantToIndex.end(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Model::removeConstant(std::string const& name) { |
|
|
|
|
|
auto pos = constantToIndex.find(name); |
|
|
|
|
|
if (pos != constantToIndex.end()) { |
|
|
|
|
|
uint64_t index = pos->second; |
|
|
|
|
|
constants.erase(constants.begin() + index); |
|
|
|
|
|
constantToIndex.erase(pos); |
|
|
|
|
|
for (auto& entry : constantToIndex) { |
|
|
|
|
|
if(entry.second > index) { |
|
|
|
|
|
entry.second--; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Constant const& Model::getConstant(std::string const& name) const { |
|
|
Constant const& Model::getConstant(std::string const& name) const { |
|
|
auto it = constantToIndex.find(name); |
|
|
auto it = constantToIndex.find(name); |
|
|
STORM_LOG_THROW(it != constantToIndex.end(), storm::exceptions::WrongFormatException, "Unable to retrieve unknown constant '" << name << "'."); |
|
|
STORM_LOG_THROW(it != constantToIndex.end(), storm::exceptions::WrongFormatException, "Unable to retrieve unknown constant '" << name << "'."); |
|
|