1#include "storm-config.h"
22class GBGmmxxDoubleGmresEnvironment {
25 static const bool isExact =
false;
26 static storm::Environment createEnvironment() {
27 storm::Environment env;
38class GBEigenDoubleDGmresEnvironment {
41 static const bool isExact =
false;
42 static storm::Environment createEnvironment() {
43 storm::Environment env;
55class GBEigenRationalLUEnvironment {
57 typedef storm::RationalNumber ValueType;
58 static const bool isExact =
true;
59 static storm::Environment createEnvironment() {
60 storm::Environment env;
68class GBNativeSorEnvironment {
70 typedef double ValueType;
71 static const bool isExact =
false;
72 static storm::Environment createEnvironment() {
73 storm::Environment env;
84class GBNativeWalkerChaeEnvironment {
86 typedef double ValueType;
87 static const bool isExact =
false;
88 static storm::Environment createEnvironment() {
89 storm::Environment env;
101class DistrGmmxxDoubleGmresEnvironment {
104 static const bool isExact =
false;
105 static storm::Environment createEnvironment() {
106 storm::Environment env;
118class DistrEigenRationalLUEnvironment {
120 typedef storm::RationalNumber ValueType;
121 static const bool isExact =
true;
122 static storm::Environment createEnvironment() {
123 storm::Environment env;
131class DistrNativeWalkerChaeEnvironment {
133 typedef double ValueType;
134 static const bool isExact =
false;
135 static storm::Environment createEnvironment() {
136 storm::Environment env;
147class ValueIterationEnvironment {
149 typedef double ValueType;
150 static const bool isExact =
false;
151 static storm::Environment createEnvironment() {
152 storm::Environment env;
159template<
typename TestType>
160class LraDtmcPrctlModelCheckerTest :
public ::testing::Test {
162 typedef typename TestType::ValueType ValueType;
163 LraDtmcPrctlModelCheckerTest() : _environment(TestType::createEnvironment()) {}
164 storm::Environment
const& env()
const {
167 ValueType
parseNumber(std::string
const& input)
const {
170 ValueType precision()
const {
175 storm::Environment _environment;
178typedef ::testing::Types<
180 GBGmmxxDoubleGmresEnvironment, GBEigenDoubleDGmresEnvironment, DistrGmmxxDoubleGmresEnvironment,
182 GBEigenRationalLUEnvironment, GBNativeSorEnvironment, GBNativeWalkerChaeEnvironment, DistrEigenRationalLUEnvironment, DistrNativeWalkerChaeEnvironment,
183 ValueIterationEnvironment>
188TYPED_TEST(LraDtmcPrctlModelCheckerTest, LRASingleBscc) {
189 typedef typename TestFixture::ValueType
ValueType;
192 std::shared_ptr<storm::models::sparse::Dtmc<ValueType>> dtmc;
205 ap.addLabelToState(
"a", 1);
213 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
216 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[0], this->precision());
217 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[1], this->precision());
229 ap.addLabelToState(
"a", 1);
237 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
240 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[0], this->precision());
241 EXPECT_NEAR(this->
parseNumber(
"0.5"), quantitativeResult1[1], this->precision());
253 ap.addLabelToState(
"a", 2);
261 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
264 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[0], this->precision());
265 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[1], this->precision());
266 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[2], this->precision());
270TYPED_TEST(LraDtmcPrctlModelCheckerTest, LRA) {
271 typedef typename TestFixture::ValueType
ValueType;
274 std::shared_ptr<storm::models::sparse::Dtmc<ValueType>> dtmc;
312 ap.addLabelToState(
"a", 1);
313 ap.addLabelToState(
"a", 4);
314 ap.addLabelToState(
"a", 5);
315 ap.addLabelToState(
"a", 7);
316 ap.addLabelToState(
"a", 11);
317 ap.addLabelToState(
"a", 13);
318 ap.addLabelToState(
"a", 14);
326 std::unique_ptr<storm::modelchecker::CheckResult> result = checker.check(this->env(), *formula);
329 EXPECT_NEAR(this->
parseNumber(
"1/10"), quantitativeResult1[0], this->precision());
330 EXPECT_NEAR(this->
parseNumber(
"0"), quantitativeResult1[3], this->precision());
331 EXPECT_NEAR(this->
parseNumber(
"1/3"), quantitativeResult1[6], this->precision());
332 EXPECT_NEAR(this->
parseNumber(
"0"), quantitativeResult1[9], this->precision());
333 EXPECT_NEAR(this->
parseNumber(
"1/10"), quantitativeResult1[12], this->precision());
334 EXPECT_NEAR(this->
parseNumber(
"79/300"), quantitativeResult1[13], this->precision());
335 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