#ifndef STORM_MODELS_SPARSE_CTMC_H_ #define STORM_MODELS_SPARSE_CTMC_H_ #include "src/models/sparse/DeterministicModel.h" #include "src/utility/OsDetection.h" namespace storm { namespace models { namespace sparse { /*! * This class represents a continuous-time Markov chain. */ template> class Ctmc : public DeterministicModel { public: /*! * Constructs a model from the given data. * * @param rateMatrix The matrix representing the transitions in the model. * @param stateLabeling The labeling of the states. * @param rewardModels A mapping of reward model names to reward models. * @param optionalChoiceLabeling A vector that represents the labels associated with the choices of each state. */ Ctmc(storm::storage::SparseMatrix const& rateMatrix, storm::models::sparse::StateLabeling const& stateLabeling, std::unordered_map const& rewardModels = std::unordered_map(), boost::optional> const& optionalChoiceLabeling = boost::optional>()); /*! * Constructs a model by moving the given data. * * @param transitionMatrix The matrix representing the transitions in the model. * @param stateLabeling The labeling of the states. * @param rewardModels A mapping of reward model names to reward models. * @param optionalChoiceLabeling A vector that represents the labels associated with the choices of each state. */ Ctmc(storm::storage::SparseMatrix&& rateMatrix, storm::models::sparse::StateLabeling&& stateLabeling, std::unordered_map&& rewardModels = std::unordered_map(), boost::optional>&& optionalChoiceLabeling = boost::optional>()); /*! * Constructs a model from the given data. * * @param rateMatrix The matrix representing the transitions in the model. * @param exitRates The exit rates of all states. * @param stateLabeling The labeling of the states. * @param rewardModels A mapping of reward model names to reward models. * @param optionalChoiceLabeling A vector that represents the labels associated with the choices of each state. */ Ctmc(storm::storage::SparseMatrix const& rateMatrix, std::vector const& exitRates, storm::models::sparse::StateLabeling const& stateLabeling, std::unordered_map const& rewardModels = std::unordered_map(), boost::optional> const& optionalChoiceLabeling = boost::optional>()); Ctmc(Ctmc const& ctmc) = default; Ctmc& operator=(Ctmc const& ctmc) = default; #ifndef WINDOWS Ctmc(Ctmc&& ctmc) = default; Ctmc& operator=(Ctmc&& ctmc) = default; #endif /*! * Retrieves the vector of exit rates of the model. * * @return The exit rate vector. */ std::vector const& getExitRateVector() const; private: /*! * Computes the exit rate vector based on the given rate matrix. * * @param rateMatrix The rate matrix. * @return The exit rate vector. */ static std::vector createExitRateVector(storm::storage::SparseMatrix const& rateMatrix); // A vector containing the exit rates of all states. std::vector exitRates; }; } // namespace sparse } // namespace models } // namespace storm #endif /* STORM_MODELS_SPARSE_CTMC_H_ */