/* * File: ApproximationModel.h * Author: tim * * Created on August 7, 2015, 9:29 AM */ #ifndef STORM_MODELCHECKER_REGION_APPROXIMATIONMODEL_H #define STORM_MODELCHECKER_REGION_APPROXIMATIONMODEL_H #include "src/modelchecker/reachability/SparseDtmcRegionModelChecker.h" namespace storm { namespace modelchecker { template class SparseDtmcRegionModelChecker; template class SparseDtmcRegionModelChecker::ApproximationModel{ public: typedef typename SparseDtmcRegionModelChecker::VariableType VariableType; typedef typename SparseDtmcRegionModelChecker::CoefficientType CoefficientType; ApproximationModel(storm::models::sparse::Dtmc const& parametricModel); virtual ~ApproximationModel(); /*! * returns the underlying model */ std::shared_ptr> const& getModel() const; /*! * Instantiates the underlying model according to the given region */ void instantiate(ParameterRegion const& region); /*! * Returns the approximated reachability probabilities for every state. * Undefined behavior if model has not been instantiated first! * @param optimalityType Use MAXIMIZE to get upper bounds or MINIMIZE to get lower bounds */ std::vector const& computeReachabilityProbabilities(storm::logic::OptimalityType const& optimalityType); private: enum class TypeOfBound { LOWER, UPPER }; //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>> mapping; //Vector has one entry for //(every distinct, non-constant function that occurs somewhere in the model) x (the required combinations of lower and upper bounds of the region) //The second entry represents a substitution as an index in the substitutions vector //The third entry should contain the result when evaluating the function in the first entry, regarding the substitution given by the second entry. std::vector> evaluationTable; //Vector has one entry for every required substitution (=replacement of parameters with lower/upper bounds of region) std::vector> substitutions; //The Model with which we work std::shared_ptr> model; // comparators that can be used to compare constants. storm::utility::ConstantsComparator parametricTypeComparator; storm::utility::ConstantsComparator constantTypeComparator; }; } } #endif /* STORM_MODELCHECKER_REGION_APPROXIMATIONMODEL_H */