20 stateToChoicesMapping = other.stateToChoicesMapping;
29 stateToChoicesMapping = std::move(other.stateToChoicesMapping);
34 return stateToChoicesMapping == other.stateToChoicesMapping;
38 return stateToChoicesMapping != other.stateToChoicesMapping;
42 stateToChoicesMapping[state] = choices;
46 stateToChoicesMapping.emplace(state, std::move(choices));
50 return stateToChoicesMapping.size();
54 auto stateChoicePair = stateToChoicesMapping.find(state);
56 STORM_LOG_THROW(stateChoicePair != stateToChoicesMapping.end(), storm::exceptions::InvalidStateException,
57 "Invalid call to MaximalEndComponent::getChoicesForState: cannot retrieve choices for state not contained in MEC.");
59 return stateChoicePair->second;
63 auto stateChoicePair = stateToChoicesMapping.find(state);
65 STORM_LOG_THROW(stateChoicePair != stateToChoicesMapping.end(), storm::exceptions::InvalidStateException,
66 "Invalid call to MaximalEndComponent::getChoicesForState: cannot retrieve choices for state not contained in MEC.");
68 return stateChoicePair->second;
72 auto stateChoicePair = stateToChoicesMapping.find(state);
74 if (stateChoicePair == stateToChoicesMapping.end()) {
82 for (
auto const& stateChoicesPair : stateToChoicesMapping) {
83 if (stateSet.
get(stateChoicesPair.first)) {
91 auto stateChoicePair = stateToChoicesMapping.find(state);
93 STORM_LOG_THROW(stateChoicePair != stateToChoicesMapping.end(), storm::exceptions::InvalidStateException,
94 "Invalid call to MaximalEndComponent::removeState: cannot remove state not contained in MEC.");
96 stateToChoicesMapping.erase(stateChoicePair);
100 auto stateChoicePair = stateToChoicesMapping.find(state);
102 STORM_LOG_THROW(stateChoicePair != stateToChoicesMapping.end(), storm::exceptions::InvalidStateException,
103 "Invalid call to MaximalEndComponent::containsChoice: cannot obtain choices for state not contained in MEC.");
105 return stateChoicePair->second.find(choice) != stateChoicePair->second.end();
110 states.reserve(stateToChoicesMapping.size());
112 for (
auto const& stateChoicesPair : stateToChoicesMapping) {
113 states.insert(stateChoicesPair.first);
121 for (
auto const& stateChoicesPair : component.stateToChoicesMapping) {
122 out <<
"{" << stateChoicesPair.first <<
", " << stateChoicesPair.second <<
"}";
130 return stateToChoicesMapping.begin();
134 return stateToChoicesMapping.end();
138 return stateToChoicesMapping.begin();
142 return stateToChoicesMapping.end();
A bit vector that is internally represented as a vector of 64-bit values.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
iterator end()
Retrieves an iterator that points past the last state and its choices in the MEC.
set_type const & getChoicesForState(uint_fast64_t state) const
Retrieves the choices for the given state that are contained in this MEC under the assumption that th...
set_type getStateSet() const
Retrieves the set of states contained in the MEC.
bool operator!=(MaximalEndComponent const &other) const
map_type::const_iterator const_iterator
storm::storage::FlatSet< sparse::state_type > set_type
void addState(uint_fast64_t state, set_type const &choices)
Adds the given state and the given choices to the MEC.
MaximalEndComponent()
Creates an empty MEC.
bool containsAnyState(storm::storage::BitVector stateSet) const
Retrieves whether at least one of the given states is contained in this MEC.
bool containsState(uint_fast64_t state) const
Retrieves whether the given state is contained in this MEC.
void removeState(uint_fast64_t state)
Removes the given state and all of its choices from the MEC.
iterator begin()
Retrieves an iterator that points to the first state and its choices in the MEC.
MaximalEndComponent & operator=(MaximalEndComponent const &other)
Assigns the contents of the given MEC to the current one via copying.
map_type::iterator iterator
bool containsChoice(uint_fast64_t state, uint_fast64_t choice) const
Retrieves whether the given choice for the given state is contained in the MEC.
bool operator==(MaximalEndComponent const &other) const
#define STORM_LOG_THROW(cond, exception, message)
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
std::ostream & operator<<(std::ostream &out, ParameterRegion< ParametricType > const ®ion)