#pragma once #include #include #include #include #include "storm/models/ModelType.h" #include "storm/models/sparse/StateLabeling.h" #include "storm/models/sparse/ChoiceLabeling.h" #include "storm/storage/sparse/StateType.h" #include "storm/storage/sparse/StateValuations.h" #include "storm/storage/sparse/ChoiceOrigins.h" #include "storm/storage/SparseMatrix.h" #include "storm/storage/BitVector.h" #include "storm/models/sparse/StandardRewardModel.h" #include "storm/utility/macros.h" #include "storm/exceptions/InvalidOperationException.h" namespace storm { namespace storage { namespace sparse { template> struct ModelComponents { ModelComponents(storm::storage::SparseMatrix const& transitionMatrix, storm::models::sparse::StateLabeling const& stateLabeling = storm::models::sparse::StateLabeling(), std::unordered_map const& rewardModels = std::unordered_map(), bool rateTransitions = false, boost::optional const& markovianStates = boost::none, boost::optional> const& player1Matrix = boost::none, boost::optional> const& playerActionIndices = boost::none) : transitionMatrix(transitionMatrix), stateLabeling(stateLabeling), rewardModels(rewardModels), rateTransitions(rateTransitions), markovianStates(markovianStates), player1Matrix(player1Matrix), playerActionIndices(playerActionIndices) { // Intentionally left empty } ModelComponents(storm::storage::SparseMatrix&& transitionMatrix = storm::storage::SparseMatrix(), storm::models::sparse::StateLabeling&& stateLabeling = storm::models::sparse::StateLabeling(), std::unordered_map&& rewardModels = std::unordered_map(), bool rateTransitions = false, boost::optional&& markovianStates = boost::none, boost::optional>&& player1Matrix = boost::none, boost::optional>&& playerActionIndices = boost::none) : transitionMatrix(std::move(transitionMatrix)), stateLabeling(std::move(stateLabeling)), rewardModels(std::move(rewardModels)), rateTransitions(rateTransitions), markovianStates(std::move(markovianStates)), player1Matrix(std::move(player1Matrix)), playerActionIndices(std::move(playerActionIndices)) { // Intentionally left empty } // General components (applicable for all model types): // The transition matrix. storm::storage::SparseMatrix transitionMatrix; // The state labeling. storm::models::sparse::StateLabeling stateLabeling; // The reward models associated with the model. std::unordered_map rewardModels; // A vector that stores a labeling for each choice. boost::optional choiceLabeling; // stores for each state to which variable valuation it belongs boost::optional stateValuations; // stores for each choice from which parts of the input model description it originates boost::optional> choiceOrigins; // POMDP specific components // The POMDP observations boost::optional> observabilityClasses; boost::optional observationValuations; // Continuous time specific components (CTMCs, Markov Automata): // True iff the transition values (for Markovian choices) are interpreted as rates. bool rateTransitions; // The exit rate for each state. Must be given for CTMCs and MAs, if rateTransitions is false. Otherwise, it is optional. boost::optional> exitRates; // A vector that stores which states are markovian (only for Markov Automata). boost::optional markovianStates; // Stochastic two player game specific components: // The matrix of player 1 choices (needed for stochastic two player games boost::optional> player1Matrix; // Stochastic multiplayer game specific components: // The vector mapping state choices to players boost::optional> playerActionIndices; }; } } }