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.

59 lines
2.2 KiB

  1. #ifndef STORM_STORAGE_MAXIMALENDCOMPONENT_H_
  2. #define STORM_STORAGE_MAXIMALENDCOMPONENT_H_
  3. #include <unordered_map>
  4. #include <vector>
  5. namespace storm {
  6. namespace storage {
  7. /*!
  8. * This class represents a maximal end-component of a nondeterministic model.
  9. */
  10. class MaximalEndComponent {
  11. public:
  12. /*!
  13. * Creates an empty MEC.
  14. */
  15. MaximalEndComponent();
  16. MaximalEndComponent(MaximalEndComponent const& other);
  17. MaximalEndComponent& operator=(MaximalEndComponent const& other);
  18. MaximalEndComponent(MaximalEndComponent&& other);
  19. MaximalEndComponent& operator=(MaximalEndComponent&& other);
  20. /*!
  21. * Adds the given state and the given choices to the MEC.
  22. *
  23. * @param state The state for which to add the choices.
  24. * @param choices The choices to add for the state.
  25. */
  26. void addState(uint_fast64_t state, std::vector<uint_fast64_t> const& choices);
  27. /*!
  28. * Retrieves the choices for the given state that are contained in this MEC under the
  29. * assumption that the state is in the MEC.
  30. *
  31. * @param state The state for which to retrieve the choices.
  32. * @return A list of choices of the state in the MEC.
  33. */
  34. std::vector<uint_fast64_t> const& getChoicesForState(uint_fast64_t state) const;
  35. /*!
  36. * Retrieves whether the given state is contained in this MEC.
  37. *
  38. * @param state The state for which to query membership in the MEC.
  39. * @return True if the given state is contained in the MEC.
  40. */
  41. bool containsState(uint_fast64_t state) const;
  42. private:
  43. // This stores the mapping from states contained in the MEC to the choices in this MEC.
  44. std::unordered_map<uint_fast64_t, std::vector<uint_fast64_t>> stateToChoicesMapping;
  45. };
  46. }
  47. }
  48. #endif /* STORM_STORAGE_MAXIMALENDCOMPONENT_H_ */