#include "src/storage/prism/menu_games/MenuGame.h" #include "src/exceptions/InvalidOperationException.h" #include "src/exceptions/InvalidArgumentException.h" #include "src/storage/dd/CuddBdd.h" #include "src/storage/dd/CuddAdd.h" #include "src/models/symbolic/StandardRewardModel.h" namespace storm { namespace prism { namespace menu_games { template MenuGame::MenuGame(std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Add transitionMatrix, storm::dd::Bdd bottomStates, std::set const& rowVariables, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::set const& player1Variables, std::set const& player2Variables, std::set const& allNondeterminismVariables, storm::expressions::Variable const& updateVariable, std::map> const& expressionToBddMap) : storm::models::symbolic::StochasticTwoPlayerGame(manager, reachableStates, initialStates, transitionMatrix.sumAbstract({updateVariable}), rowVariables, nullptr, columnVariables, nullptr, rowColumnMetaVariablePairs, player1Variables, player2Variables, allNondeterminismVariables), updateVariable(updateVariable), expressionToBddMap(expressionToBddMap), bottomStates(bottomStates) { // Intentionally left empty. } template storm::dd::Bdd MenuGame::getStates(std::string const& label) const { STORM_LOG_THROW(false, storm::exceptions::InvalidOperationException, "Menu games do not provide labels."); } template storm::dd::Bdd MenuGame::getStates(storm::expressions::Expression const& expression) const { return this->getStates(expression, false); } template storm::dd::Bdd MenuGame::getStates(storm::expressions::Expression const& expression, bool negated) const { auto it = expressionToBddMap.find(expression); STORM_LOG_THROW(it != expressionToBddMap.end(), storm::exceptions::InvalidArgumentException, "The given expression was not used in the abstraction process and can therefore not be retrieved."); if (negated) { return !it->second && this->getReachableStates(); } else { return it->second && this->getReachableStates(); } } template storm::dd::Bdd MenuGame::getBottomStates() const { return bottomStates; } template bool MenuGame::hasLabel(std::string const& label) const { return false; } template class MenuGame; } // namespace menu_games } // namespace prism } // namespace storm