|
|
@ -1,6 +1,7 @@ |
|
|
|
#include "gtest/gtest.h"
|
|
|
|
#include "storm-config.h"
|
|
|
|
|
|
|
|
#include "src/storage/SymbolicModelDescription.h"
|
|
|
|
#include "src/parser/PrismParser.h"
|
|
|
|
#include "src/models/symbolic/Dtmc.h"
|
|
|
|
#include "src/models/symbolic/Mdp.h"
|
|
|
@ -16,7 +17,8 @@ |
|
|
|
#include "src/storage/dd/DdManager.h"
|
|
|
|
|
|
|
|
TEST(GraphTest, SymbolicProb01_Cudd) { |
|
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm"); |
|
|
|
storm::storage::SymbolicModelDescription modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm"); |
|
|
|
storm::prism::Program program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Dtmc); |
|
|
@ -37,7 +39,8 @@ TEST(GraphTest, SymbolicProb01_Cudd) { |
|
|
|
} |
|
|
|
|
|
|
|
TEST(GraphTest, SymbolicProb01_Sylvan) { |
|
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm"); |
|
|
|
storm::storage::SymbolicModelDescription modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm"); |
|
|
|
storm::prism::Program program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::Sylvan>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::Sylvan>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Dtmc); |
|
|
@ -58,7 +61,8 @@ TEST(GraphTest, SymbolicProb01_Sylvan) { |
|
|
|
} |
|
|
|
|
|
|
|
TEST(GraphTest, SymbolicProb01MinMax_Cudd) { |
|
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/leader3.nm"); |
|
|
|
storm::storage::SymbolicModelDescription modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/leader3.nm"); |
|
|
|
storm::prism::Program program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -75,7 +79,8 @@ TEST(GraphTest, SymbolicProb01MinMax_Cudd) { |
|
|
|
EXPECT_EQ(364ul, statesWithProbability01.second.getNonZeroCount()); |
|
|
|
} |
|
|
|
|
|
|
|
program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/coin2-2.nm"); |
|
|
|
modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/coin2-2.nm"); |
|
|
|
program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -100,7 +105,8 @@ TEST(GraphTest, SymbolicProb01MinMax_Cudd) { |
|
|
|
EXPECT_EQ(35ul, statesWithProbability01.second.getNonZeroCount()); |
|
|
|
} |
|
|
|
|
|
|
|
program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/csma2-2.nm"); |
|
|
|
modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/csma2-2.nm"); |
|
|
|
program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -119,7 +125,8 @@ TEST(GraphTest, SymbolicProb01MinMax_Cudd) { |
|
|
|
} |
|
|
|
|
|
|
|
TEST(GraphTest, SymbolicProb01MinMax_Sylvan) { |
|
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/leader3.nm"); |
|
|
|
storm::storage::SymbolicModelDescription modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/leader3.nm"); |
|
|
|
storm::prism::Program program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::Sylvan>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::Sylvan>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -136,7 +143,8 @@ TEST(GraphTest, SymbolicProb01MinMax_Sylvan) { |
|
|
|
EXPECT_EQ(364ul, statesWithProbability01.second.getNonZeroCount()); |
|
|
|
} |
|
|
|
|
|
|
|
program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/coin2-2.nm"); |
|
|
|
modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/coin2-2.nm"); |
|
|
|
program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::Sylvan>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -161,7 +169,8 @@ TEST(GraphTest, SymbolicProb01MinMax_Sylvan) { |
|
|
|
EXPECT_EQ(35ul, statesWithProbability01.second.getNonZeroCount()); |
|
|
|
} |
|
|
|
|
|
|
|
program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/csma2-2.nm"); |
|
|
|
modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/csma2-2.nm"); |
|
|
|
program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::Sylvan>().build(program); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -180,7 +189,8 @@ TEST(GraphTest, SymbolicProb01MinMax_Sylvan) { |
|
|
|
} |
|
|
|
|
|
|
|
TEST(GraphTest, ExplicitProb01) { |
|
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm"); |
|
|
|
storm::storage::SymbolicModelDescription modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm"); |
|
|
|
storm::prism::Program program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
std::shared_ptr<storm::models::sparse::Model<double>> model = storm::builder::ExplicitModelBuilder<double>(program, storm::generator::NextStateGeneratorOptions(false, true)).build(); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Dtmc); |
|
|
@ -201,7 +211,8 @@ TEST(GraphTest, ExplicitProb01) { |
|
|
|
} |
|
|
|
|
|
|
|
TEST(GraphTest, ExplicitProb01MinMax) { |
|
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/leader3.nm"); |
|
|
|
storm::storage::SymbolicModelDescription modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/leader3.nm"); |
|
|
|
storm::prism::Program program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
std::shared_ptr<storm::models::sparse::Model<double>> model = storm::builder::ExplicitModelBuilder<double>(program, storm::generator::NextStateGeneratorOptions(false, true)).build(); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -216,7 +227,8 @@ TEST(GraphTest, ExplicitProb01MinMax) { |
|
|
|
EXPECT_EQ(0ul, statesWithProbability01.first.getNumberOfSetBits()); |
|
|
|
EXPECT_EQ(364ul, statesWithProbability01.second.getNumberOfSetBits()); |
|
|
|
|
|
|
|
program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/coin2-2.nm"); |
|
|
|
modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/coin2-2.nm"); |
|
|
|
program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
model = storm::builder::ExplicitModelBuilder<double>(program, storm::generator::NextStateGeneratorOptions(false, true)).build(); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -237,7 +249,8 @@ TEST(GraphTest, ExplicitProb01MinMax) { |
|
|
|
EXPECT_EQ(83ul, statesWithProbability01.first.getNumberOfSetBits()); |
|
|
|
EXPECT_EQ(35ul, statesWithProbability01.second.getNumberOfSetBits()); |
|
|
|
|
|
|
|
program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/csma2-2.nm"); |
|
|
|
modelDescription = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/csma2-2.nm"); |
|
|
|
program = modelDescription.preprocess().asPrismProgram(); |
|
|
|
model = storm::builder::ExplicitModelBuilder<double>(program, storm::generator::NextStateGeneratorOptions(false, true)).build(); |
|
|
|
|
|
|
|
ASSERT_TRUE(model->getType() == storm::models::ModelType::Mdp); |
|
|
@ -249,4 +262,4 @@ TEST(GraphTest, ExplicitProb01MinMax) { |
|
|
|
ASSERT_NO_THROW(statesWithProbability01 = storm::utility::graph::performProb01Max(*model->as<storm::models::sparse::Mdp<double>>(), storm::storage::BitVector(model->getNumberOfStates(), true), model->getStates("collision_max_backoff"))); |
|
|
|
EXPECT_EQ(993ul, statesWithProbability01.first.getNumberOfSetBits()); |
|
|
|
EXPECT_EQ(16ul, statesWithProbability01.second.getNumberOfSetBits()); |
|
|
|
} |
|
|
|
} |