1#include "storm-config.h"
23class GBGmmxxDoubleGmresEnvironment {
26 static const bool isExact =
false;
27 static storm::Environment createEnvironment() {
28 storm::Environment env;
39class GBEigenDoubleDGmresEnvironment {
42 static const bool isExact =
false;
43 static storm::Environment createEnvironment() {
44 storm::Environment env;
56class GBEigenRationalLUEnvironment {
58 typedef storm::RationalNumber ValueType;
59 static const bool isExact =
true;
60 static storm::Environment createEnvironment() {
61 storm::Environment env;
69class GBNativeSorEnvironment {
71 typedef double ValueType;
72 static const bool isExact =
false;
73 static storm::Environment createEnvironment() {
74 storm::Environment env;
85class GBNativeWalkerChaeEnvironment {
87 typedef double ValueType;
88 static const bool isExact =
false;
89 static storm::Environment createEnvironment() {
90 storm::Environment env;
102class DistrGmmxxDoubleGmresEnvironment {
105 static const bool isExact =
false;
106 static storm::Environment createEnvironment() {
107 storm::Environment env;
119class DistrEigenRationalLUEnvironment {
121 typedef storm::RationalNumber ValueType;
122 static const bool isExact =
true;
123 static storm::Environment createEnvironment() {
124 storm::Environment env;
132class DistrNativeWalkerChaeEnvironment {
134 typedef double ValueType;
135 static const bool isExact =
false;
136 static storm::Environment createEnvironment() {
137 storm::Environment env;
148class ValueIterationEnvironment {
150 typedef double ValueType;
151 static const bool isExact =
false;
152 static storm::Environment createEnvironment() {
153 storm::Environment env;
160template<
typename TestType>
161class LraDtmcPrctlModelCheckerTest :
public ::testing::Test {
163 typedef typename TestType::ValueType ValueType;
164 LraDtmcPrctlModelCheckerTest() : _environment(TestType::createEnvironment()) {}
165 storm::Environment
const& env()
const {
168 ValueType
parseNumber(std::string
const& input)
const {
171 ValueType precision()
const {
176 storm::Environment _environment;
179typedef ::testing::Types<
181 GBGmmxxDoubleGmresEnvironment, GBEigenDoubleDGmresEnvironment, DistrGmmxxDoubleGmresEnvironment,
183 GBEigenRationalLUEnvironment, GBNativeSorEnvironment, GBNativeWalkerChaeEnvironment, DistrEigenRationalLUEnvironment, DistrNativeWalkerChaeEnvironment,
184 ValueIterationEnvironment>
189TYPED_TEST(LraDtmcPrctlModelCheckerTest, LRASingleBscc) {
190 typedef typename TestFixture::ValueType
ValueType;
193 std::shared_ptr<storm::models::sparse::Dtmc<ValueType>> dtmc;
206 ap.addLabelToState(
"a", 1);
214 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
217 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[0], this->precision());
218 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[1], this->precision());
230 ap.addLabelToState(
"a", 1);
238 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
241 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[0], this->precision());
242 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[1], this->precision());
254 ap.addLabelToState(
"a", 2);
262 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
265 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[0], this->precision());
266 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[1], this->precision());
267 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[2], this->precision());
271TYPED_TEST(LraDtmcPrctlModelCheckerTest, LRA) {
272 typedef typename TestFixture::ValueType
ValueType;
275 std::shared_ptr<storm::models::sparse::Dtmc<ValueType>> dtmc;
313 ap.addLabelToState(
"a", 1);
314 ap.addLabelToState(
"a", 4);
315 ap.addLabelToState(
"a", 5);
316 ap.addLabelToState(
"a", 7);
317 ap.addLabelToState(
"a", 11);
318 ap.addLabelToState(
"a", 13);
319 ap.addLabelToState(
"a", 14);
327 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
330 EXPECT_NEAR(this->
parseNumber(
"1/10"), quantitativeResult1[0], this->precision());
331 EXPECT_NEAR(this->
parseNumber(
"0"), quantitativeResult1[3], this->precision());
332 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[6], this->precision());
333 EXPECT_NEAR(this->
parseNumber(
"0"), quantitativeResult1[9], this->precision());
334 EXPECT_NEAR(this->
parseNumber(
"1/10"), quantitativeResult1[12], this->precision());
335 EXPECT_NEAR(this->
parseNumber(
"79/300"), quantitativeResult1[13], this->precision());
336 EXPECT_NEAR(this->
parseNumber(
"1/10"), quantitativeResult1[14], this->precision());
void setPrecision(storm::RationalNumber value)
void setPreconditioner(storm::solver::EigenLinearEquationSolverPreconditioner value)
void setMethod(storm::solver::EigenLinearEquationSolverMethod value)
SolverEnvironment & solver()
void setMethod(storm::solver::GmmxxLinearEquationSolverMethod value)
void setPrecision(storm::RationalNumber value)
void setPreconditioner(storm::solver::GmmxxLinearEquationSolverPreconditioner value)
void setDetLraMethod(storm::solver::LraMethod value, bool isSetFromDefault=false)
void setPrecision(storm::RationalNumber value)
void setSorOmega(storm::RationalNumber const &value)
void setMaximalNumberOfIterations(uint64_t value)
void setMethod(storm::solver::NativeLinearEquationSolverMethod value)
void setPrecision(storm::RationalNumber value)
void setLinearEquationSolverType(storm::solver::EquationSolverType const &value, bool isSetFromDefault=false)
EigenSolverEnvironment & eigen()
NativeSolverEnvironment & native()
GmmxxSolverEnvironment & gmmxx()
LongRunAverageSolverEnvironment & lra()
ExplicitQuantitativeCheckResult< ValueType > & asExplicitQuantitativeCheckResult()
This class represents a discrete-time Markov chain.
This class manages the labeling of the state space with a number of (atomic) labels.
A class that can be used to build a sparse matrix by adding value by value.
void addNextValue(index_type row, index_type column, value_type const &value)
Sets the matrix entry at the given row and column to the given value.
SparseMatrix< value_type > build(index_type overriddenRowCount=0, index_type overriddenColumnCount=0, index_type overriddenRowGroupCount=0)
A class that holds a possibly non-square matrix in the compressed row storage format.
SFTBDDChecker::ValueType ValueType
NumberType parseNumber(std::string const &value)
Parse number from string.
TargetType convertNumber(SourceType const &number)
TYPED_TEST(GraphTestAR, SymbolicProb01StochasticGameDieSmall)
TYPED_TEST_SUITE(GraphTestAR, TestingTypes,)
::testing::Types< Cudd, Sylvan > TestingTypes