/* * File: SamplingModel.h * Author: tim * * Created on August 7, 2015, 9:31 AM */ #ifndef STORM_MODELCHECKER_REGION_SAMPLINGMODEL_H #define STORM_MODELCHECKER_REGION_SAMPLINGMODEL_H #include "src/modelchecker/region/SparseDtmcRegionModelChecker.h" #include "src/models/sparse/Dtmc.h" namespace storm { namespace modelchecker{ template class SparseDtmcRegionModelChecker; template class SparseDtmcRegionModelChecker::SamplingModel { public: typedef typename SparseDtmcRegionModelChecker::VariableType VariableType; typedef typename SparseDtmcRegionModelChecker::CoefficientType CoefficientType; SamplingModel(storm::models::sparse::Dtmc const& parametricModel, bool computeRewards); virtual ~SamplingModel(); /*! * returns the underlying model */ std::shared_ptr> const& getModel() const; /*! * Instantiates the underlying model according to the given point */ void instantiate(std::mapconst& point); /*! * Returns the reachability probabilities for every state according to the current instantiation. * Undefined behavior if model has not been instantiated first! */ std::vector const& computeValues(); private: //Vector has one entry for every (non-constant) matrix entry. //pair.first points to an entry in the evaluation table, //pair.second is an iterator to the corresponding matrix entry std::vector::iterator>> probabilityMapping; std::vector> stateRewardMapping; //Vector has one entry for every distinct, non-constant function that occurs somewhere in the model. //The second entry should contain the result when evaluating the function in the first entry. std::vector> evaluationTable; //The model with which we work std::shared_ptr> model; bool computeRewards; // comparators that can be used to compare constants. storm::utility::ConstantsComparator parametricTypeComparator; storm::utility::ConstantsComparator constantTypeComparator; }; } } #endif /* STORM_MODELCHECKER_REGION_SAMPLINGMODEL_H */