#ifndef STORM_MODELS_SYMBOLIC_CTMC_H_ #define STORM_MODELS_SYMBOLIC_CTMC_H_ #include "storm/models/symbolic/DeterministicModel.h" #include "storm/utility/OsDetection.h" namespace storm { namespace models { namespace symbolic { /*! * This class represents a continuous-time Markov chain. */ template class Ctmc : public DeterministicModel { public: typedef typename DeterministicModel::RewardModelType RewardModelType; Ctmc(Ctmc const& other) = default; Ctmc& operator=(Ctmc const& other) = default; #ifndef WINDOWS Ctmc(Ctmc&& other) = default; Ctmc& operator=(Ctmc&& other) = default; #endif /*! * Constructs a model from the given data. * * @param manager The manager responsible for the decision diagrams. * @param reachableStates A DD representing the reachable states. * @param initialStates A DD representing the initial states of the model. * @param deadlockStates A DD representing the deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param rowVariables The set of row meta variables used in the DDs. * @param rowExpressionAdapter An object that can be used to translate expressions in terms of the row * meta variables. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param labelToExpressionMap A mapping from label names to their defining expressions. * @param rewardModels The reward models associated with the model. */ Ctmc(std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, std::set const& rowVariables, std::shared_ptr> rowExpressionAdapter, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::map labelToExpressionMap = std::map(), std::unordered_map const& rewardModels = std::unordered_map()); /*! * Constructs a model from the given data. * * @param manager The manager responsible for the decision diagrams. * @param reachableStates A DD representing the reachable states. * @param initialStates A DD representing the initial states of the model. * @param deadlockStates A DD representing the deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param exitRateVector The vector specifying the exit rates for the states. * @param rowVariables The set of row meta variables used in the DDs. * @param rowExpressionAdapter An object that can be used to translate expressions in terms of the row * meta variables. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param labelToExpressionMap A mapping from label names to their defining expressions. * @param rewardModels The reward models associated with the model. */ Ctmc(std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, boost::optional> exitRateVector, std::set const& rowVariables, std::shared_ptr> rowExpressionAdapter, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::map labelToExpressionMap = std::map(), std::unordered_map const& rewardModels = std::unordered_map()); /*! * Constructs a model from the given data. * * @param manager The manager responsible for the decision diagrams. * @param reachableStates A DD representing the reachable states. * @param initialStates A DD representing the initial states of the model. * @param deadlockStates A DD representing the deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param rowVariables The set of row meta variables used in the DDs. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param labelToBddMap A mapping from label names to their defining BDDs. * @param rewardModels The reward models associated with the model. */ Ctmc(std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, std::set const& rowVariables, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::map> labelToBddMap = std::map>(), std::unordered_map const& rewardModels = std::unordered_map()); /*! * Constructs a model from the given data. * * @param manager The manager responsible for the decision diagrams. * @param reachableStates A DD representing the reachable states. * @param initialStates A DD representing the initial states of the model. * @param deadlockStates A DD representing the deadlock states of the model. * @param transitionMatrix The matrix representing the transitions in the model. * @param exitRateVector The vector specifying the exit rates for the states. * @param rowVariables The set of row meta variables used in the DDs. * @param columVariables The set of column meta variables used in the DDs. * @param rowColumnMetaVariablePairs All pairs of row/column meta variables. * @param labelToBddMap A mapping from label names to their defining BDDs. * @param rewardModels The reward models associated with the model. */ Ctmc(std::shared_ptr> manager, storm::dd::Bdd reachableStates, storm::dd::Bdd initialStates, storm::dd::Bdd deadlockStates, storm::dd::Add transitionMatrix, boost::optional> exitRateVector, std::set const& rowVariables, std::set const& columnVariables, std::vector> const& rowColumnMetaVariablePairs, std::map> labelToBddMap = std::map>(), std::unordered_map const& rewardModels = std::unordered_map()); /*! * Retrieves the exit rate vector of the CTMC. * * @return The exit rate vector. */ storm::dd::Add const& getExitRateVector() const; virtual void reduceToStateBasedRewards() override; /*! * @return the probabilistic transition matrix P * @note getTransitionMatrix() retrieves the exit rate matrix R, where R(s,s') = r(s) * P(s,s') */ storm::dd::Add computeProbabilityMatrix() const; template std::shared_ptr> toValueType() const; private: mutable boost::optional> exitRates; }; } // namespace symbolic } // namespace models } // namespace storm #endif /* STORM_MODELS_SYMBOLIC_CTMC_H_ */