Browse Source

build command index to action name mapping

Former-commit-id: a9b6c19e68
tempestpy_adaptions
sjunges 9 years ago
parent
commit
ee0e34146f
  1. 10
      src/storage/prism/Program.cpp
  2. 5
      src/storage/prism/Program.h

10
src/storage/prism/Program.cpp

@ -1066,6 +1066,16 @@ namespace storm {
storm::prism::Module singleModule(newModuleName.str(), allBooleanVariables, allIntegerVariables, newCommands, this->getFilename(), 0);
return Program(manager, this->getModelType(), this->getConstants(), std::vector<storm::prism::BooleanVariable>(), std::vector<storm::prism::IntegerVariable>(), this->getFormulas(), {singleModule}, actionToIndexMap, this->getRewardModels(), false, this->getInitialConstruct(), this->getLabels(), this->getFilename(), 0, true);
}
std::unordered_map<uint_fast64_t, std::string> Program::buildCommandIndexToActionNameMap() const {
std::unordered_map<uint_fast64_t, std::string> res;
for(auto const& m : this->modules) {
for(auto const& c : m.getCommands()) {
res.emplace(c.getGlobalIndex(), c.getActionName());
}
}
return res;
}
Command Program::synchronizeCommands(uint_fast64_t newCommandIndex, uint_fast64_t actionIndex, uint_fast64_t firstUpdateIndex, std::string const& actionName, std::vector<std::reference_wrapper<Command const>> const& commands) const {
// To construct the synchronous product of the commands, we need to store a list of its updates.

5
src/storage/prism/Program.h

@ -443,6 +443,11 @@ namespace storm {
* @return The manager responsible for the expressions of this program.
*/
storm::expressions::ExpressionManager& getManager();
/*!
*
*/
std::unordered_map<uint_fast64_t, std::string> buildCommandIndexToActionNameMap() const;
private:
/*!

Loading…
Cancel
Save