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.

28 lines
1.6 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. #include "src/models/sparse/StandardRewardModel.h"
  7. TEST(MaximalEndComponentDecomposition, AsynchronousLeader) {
  8. 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", "", "");
  9. std::shared_ptr<storm::models::sparse::Mdp<double>> mdp = abstractModel->as<storm::models::sparse::Mdp<double>>();
  10. storm::storage::MaximalEndComponentDecomposition<double> mecDecomposition;
  11. ASSERT_NO_THROW(mecDecomposition = storm::storage::MaximalEndComponentDecomposition<double>(*mdp));
  12. ASSERT_EQ(7ul, mecDecomposition.size());
  13. mdp = nullptr;
  14. }
  15. TEST(MaximalEndComponentDecomposition, Consensus) {
  16. 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", "", "");
  17. std::shared_ptr<storm::models::sparse::Mdp<double>> mdp = abstractModel->as<storm::models::sparse::Mdp<double>>();
  18. storm::storage::MaximalEndComponentDecomposition<double> mecDecomposition;
  19. ASSERT_NO_THROW(mecDecomposition = storm::storage::MaximalEndComponentDecomposition<double>(*mdp));
  20. ASSERT_EQ(384ul, mecDecomposition.size());
  21. mdp = nullptr;
  22. }