Browse Source

build command index to action name mapping

Former-commit-id: a9b6c19e68
main
sjunges 10 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

@ -1067,6 +1067,16 @@ namespace storm {
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); 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 { 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. // To construct the synchronous product of the commands, we need to store a list of its updates.
std::vector<storm::prism::Update> newUpdates; std::vector<storm::prism::Update> newUpdates;

5
src/storage/prism/Program.h

@ -444,6 +444,11 @@ namespace storm {
*/ */
storm::expressions::ExpressionManager& getManager(); storm::expressions::ExpressionManager& getManager();
/*!
*
*/
std::unordered_map<uint_fast64_t, std::string> buildCommandIndexToActionNameMap() const;
private: private:
/*! /*!
* This function builds a command that corresponds to the synchronization of the given list of commands. * This function builds a command that corresponds to the synchronization of the given list of commands.

Loading…
Cancel
Save