You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.5 KiB

  1. #include "gtest/gtest.h"
  2. #include "storm-config.h"
  3. #include "src/parser/AutoParser.h"
  4. #include "src/storage/MaximalEndComponentDecomposition.h"
  5. #include "src/models/sparse/Mdp.h"
  6. TEST(MaximalEndComponentDecomposition, AsynchronousLeader) {
  7. std::shared_ptr<storm::models::sparse::Model<double>> abstractModel = storm::parser::AutoParser::parseModel(STORM_CPP_BASE_PATH "/examples/mdp/asynchronous_leader/leader7.tra", STORM_CPP_BASE_PATH "/examples/mdp/asynchronous_leader/leader7.lab", "", "");
  8. std::shared_ptr<storm::models::sparse::Mdp<double>> mdp = abstractModel->as<storm::models::sparse::Mdp<double>>();
  9. storm::storage::MaximalEndComponentDecomposition<double> mecDecomposition;
  10. ASSERT_NO_THROW(mecDecomposition = storm::storage::MaximalEndComponentDecomposition<double>(*mdp));
  11. ASSERT_EQ(7, mecDecomposition.size());
  12. mdp = nullptr;
  13. }
  14. TEST(MaximalEndComponentDecomposition, Consensus) {
  15. std::shared_ptr<storm::models::sparse::Model<double>> abstractModel = storm::parser::AutoParser::parseModel(STORM_CPP_BASE_PATH "/examples/mdp/consensus/coin6_4.tra", STORM_CPP_BASE_PATH "/examples/mdp/consensus/coin6_4.lab", "", "");
  16. std::shared_ptr<storm::models::sparse::Mdp<double>> mdp = abstractModel->as<storm::models::sparse::Mdp<double>>();
  17. storm::storage::MaximalEndComponentDecomposition<double> mecDecomposition;
  18. ASSERT_NO_THROW(mecDecomposition = storm::storage::MaximalEndComponentDecomposition<double>(*mdp));
  19. ASSERT_EQ(384, mecDecomposition.size());
  20. mdp = nullptr;
  21. }