|
|
@ -8,19 +8,20 @@ TEST(GraphTest, PerformProb01) { |
|
|
|
storm::parser::AutoParser<double> parser(STORM_CPP_BASE_PATH "/examples/dtmc/crowds/crowds20_5.tra", STORM_CPP_BASE_PATH "/examples/dtmc/crowds/crowds20_5.lab", "", ""); |
|
|
|
|
|
|
|
std::shared_ptr<storm::models::Dtmc<double>> dtmc = parser.getModel<storm::models::Dtmc<double>>(); |
|
|
|
storm::storage::BitVector trueStates(dtmc->getNumberOfStates(), true); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing prob01 (3 times) for crowds/crowds20_5..."); |
|
|
|
std::pair<storm::storage::BitVector, storm::storage::BitVector> prob01 = storm::utility::graph::performProb01(*dtmc, storm::storage::BitVector(dtmc->getNumberOfStates(), true), storm::storage::BitVector(dtmc->getLabeledStates("observe0Greater1"))); |
|
|
|
std::pair<storm::storage::BitVector, storm::storage::BitVector> prob01(storm::utility::graph::performProb01(*dtmc, trueStates, storm::storage::BitVector(dtmc->getLabeledStates("observe0Greater1")))); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 1724414u); |
|
|
|
ASSERT_EQ(prob01.second.getNumberOfSetBits(), 46046u); |
|
|
|
|
|
|
|
prob01 = storm::utility::graph::performProb01(*dtmc, storm::storage::BitVector(dtmc->getNumberOfStates(), true), storm::storage::BitVector(dtmc->getLabeledStates("observeIGreater1"))); |
|
|
|
prob01 = storm::utility::graph::performProb01(*dtmc, trueStates, storm::storage::BitVector(dtmc->getLabeledStates("observeIGreater1"))); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 574016u); |
|
|
|
ASSERT_EQ(prob01.second.getNumberOfSetBits(), 825797u); |
|
|
|
|
|
|
|
prob01 = storm::utility::graph::performProb01(*dtmc, storm::storage::BitVector(dtmc->getNumberOfStates(), true), storm::storage::BitVector(dtmc->getLabeledStates("observeOnlyTrueSender"))); |
|
|
|
prob01 = storm::utility::graph::performProb01(*dtmc, trueStates, storm::storage::BitVector(dtmc->getLabeledStates("observeOnlyTrueSender"))); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 1785309u); |
|
|
|
ASSERT_EQ(prob01.second.getNumberOfSetBits(), 40992u); |
|
|
@ -31,9 +32,10 @@ TEST(GraphTest, PerformProb01) { |
|
|
|
storm::parser::AutoParser<double> parser2(STORM_CPP_BASE_PATH "/examples/dtmc/synchronous_leader/leader6_8.tra", STORM_CPP_BASE_PATH "/examples/dtmc/synchronous_leader/leader6_8.lab", "", ""); |
|
|
|
|
|
|
|
std::shared_ptr<storm::models::Dtmc<double>> dtmc2 = parser2.getModel<storm::models::Dtmc<double>>(); |
|
|
|
|
|
|
|
trueStates = storm::storage::BitVector(dtmc2->getNumberOfStates(), true); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing prob01 for synchronous_leader/leader6_8..."); |
|
|
|
prob01 = storm::utility::graph::performProb01(*dtmc2, storm::storage::BitVector(dtmc2->getNumberOfStates(), true), storm::storage::BitVector(dtmc2->getLabeledStates("elected"))); |
|
|
|
prob01 = storm::utility::graph::performProb01(*dtmc2, trueStates, storm::storage::BitVector(dtmc2->getLabeledStates("elected"))); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 0u); |
|
|
@ -45,16 +47,17 @@ TEST(GraphTest, PerformProb01) { |
|
|
|
TEST(GraphTest, PerformProb01MinMax) { |
|
|
|
storm::parser::AutoParser<double> parser(STORM_CPP_BASE_PATH "/examples/mdp/asynchronous_leader/leader7.tra", STORM_CPP_BASE_PATH "/examples/mdp/asynchronous_leader/leader7.lab", "", ""); |
|
|
|
std::shared_ptr<storm::models::Mdp<double>> mdp = parser.getModel<storm::models::Mdp<double>>(); |
|
|
|
storm::storage::BitVector trueStates(mdp->getNumberOfStates(), true); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing prob01min for asynchronous_leader/leader7..."); |
|
|
|
std::pair<storm::storage::BitVector, storm::storage::BitVector> prob01 = storm::utility::graph::performProb01Min(*mdp, storm::storage::BitVector(mdp->getNumberOfStates(), true), mdp->getLabeledStates("elected")); |
|
|
|
std::pair<storm::storage::BitVector, storm::storage::BitVector> prob01(storm::utility::graph::performProb01Min(*mdp, trueStates, mdp->getLabeledStates("elected"))); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 0u); |
|
|
|
ASSERT_EQ(prob01.second.getNumberOfSetBits(), 2095783u); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing prob01max for asynchronous_leader/leader7..."); |
|
|
|
prob01 = storm::utility::graph::performProb01Max(*mdp, storm::storage::BitVector(mdp->getNumberOfStates(), true), mdp->getLabeledStates("elected")); |
|
|
|
prob01 = storm::utility::graph::performProb01Max(*mdp, trueStates, mdp->getLabeledStates("elected")); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 0u); |
|
|
@ -64,16 +67,17 @@ TEST(GraphTest, PerformProb01MinMax) { |
|
|
|
|
|
|
|
storm::parser::AutoParser<double> parser2(STORM_CPP_BASE_PATH "/examples/mdp/consensus/coin4_6.tra", STORM_CPP_BASE_PATH "/examples/mdp/consensus/coin4_6.lab", "", ""); |
|
|
|
std::shared_ptr<storm::models::Mdp<double>> mdp2 = parser2.getModel<storm::models::Mdp<double>>(); |
|
|
|
trueStates = storm::storage::BitVector(mdp2->getNumberOfStates(), true); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing prob01min for consensus/coin4_6..."); |
|
|
|
prob01 = storm::utility::graph::performProb01Min(*mdp2, storm::storage::BitVector(mdp2->getNumberOfStates(), true), mdp2->getLabeledStates("finished")); |
|
|
|
prob01 = storm::utility::graph::performProb01Min(*mdp2, trueStates, mdp2->getLabeledStates("finished")); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 0u); |
|
|
|
ASSERT_EQ(prob01.second.getNumberOfSetBits(), 63616u); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing prob01max for consensus/coin4_6..."); |
|
|
|
prob01 = storm::utility::graph::performProb01Max(*mdp2, storm::storage::BitVector(mdp2->getNumberOfStates(), true), mdp2->getLabeledStates("finished")); |
|
|
|
prob01 = storm::utility::graph::performProb01Max(*mdp2, trueStates, mdp2->getLabeledStates("finished")); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(prob01.first.getNumberOfSetBits(), 0u); |
|
|
@ -87,13 +91,13 @@ TEST(GraphTest, PerformSCCDecompositionAndGetDependencyGraph) { |
|
|
|
std::shared_ptr<storm::models::Dtmc<double>> dtmc = parser.getModel<storm::models::Dtmc<double>>(); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Computing SCC decomposition of crowds/crowds20_5..."); |
|
|
|
std::vector<std::vector<uint_fast64_t>> sccDecomposition = storm::utility::graph::performSccDecomposition(*dtmc); |
|
|
|
std::vector<std::vector<uint_fast64_t>> sccDecomposition(std::move(storm::utility::graph::performSccDecomposition(*dtmc))); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(sccDecomposition.size(), 1290297u); |
|
|
|
|
|
|
|
LOG4CPLUS_WARN(logger, "Extracting SCC dependency graph of crowds/crowds20_5..."); |
|
|
|
storm::storage::SparseMatrix<bool> sccDependencyGraph = dtmc->extractPartitionDependencyGraph(sccDecomposition); |
|
|
|
storm::storage::SparseMatrix<bool> sccDependencyGraph(std::move(dtmc->extractPartitionDependencyGraph(sccDecomposition))); |
|
|
|
LOG4CPLUS_WARN(logger, "Done."); |
|
|
|
|
|
|
|
ASSERT_EQ(sccDependencyGraph.getNonZeroEntryCount(), 1371253u); |
|
|
|