19 stateToChoicesMapping = other.stateToChoicesMapping;
28 stateToChoicesMapping = std::move(other.stateToChoicesMapping);
33 return stateToChoicesMapping == other.stateToChoicesMapping;
37 return stateToChoicesMapping != other.stateToChoicesMapping;
41 stateToChoicesMapping[state] = choices;
45 stateToChoicesMapping.emplace(state, std::move(choices));
49 return stateToChoicesMapping.size();
53 auto stateChoicePair = stateToChoicesMapping.find(state);
55 if (stateChoicePair == stateToChoicesMapping.end()) {
56 throw storm::exceptions::InvalidStateException()
57 <<
"Invalid call to MaximalEndComponent::getChoicesForState: cannot retrieve choices for state not contained in MEC.";
60 return stateChoicePair->second;
64 auto stateChoicePair = stateToChoicesMapping.find(state);
66 if (stateChoicePair == stateToChoicesMapping.end()) {
67 throw storm::exceptions::InvalidStateException()
68 <<
"Invalid call to MaximalEndComponent::getChoicesForState: cannot retrieve choices for state not contained in MEC.";
71 return stateChoicePair->second;
75 auto stateChoicePair = stateToChoicesMapping.find(state);
77 if (stateChoicePair == stateToChoicesMapping.end()) {
85 for (
auto const& stateChoicesPair : stateToChoicesMapping) {
86 if (stateSet.
get(stateChoicesPair.first)) {
94 auto stateChoicePair = stateToChoicesMapping.find(state);
96 if (stateChoicePair == stateToChoicesMapping.end()) {
97 throw storm::exceptions::InvalidStateException() <<
"Invalid call to MaximalEndComponent::removeState: cannot remove state not contained in MEC.";
100 stateToChoicesMapping.erase(stateChoicePair);
104 auto stateChoicePair = stateToChoicesMapping.find(state);
106 if (stateChoicePair == stateToChoicesMapping.end()) {
107 throw storm::exceptions::InvalidStateException()
108 <<
"Invalid call to MaximalEndComponent::containsChoice: cannot obtain choices for state not contained in MEC.";
111 return stateChoicePair->second.find(choice) != stateChoicePair->second.end();
116 states.reserve(stateToChoicesMapping.size());
118 for (
auto const& stateChoicesPair : stateToChoicesMapping) {
119 states.insert(stateChoicesPair.first);
127 for (
auto const& stateChoicesPair : component.stateToChoicesMapping) {
128 out <<
"{" << stateChoicesPair.first <<
", " << stateChoicesPair.second <<
"}";
136 return stateToChoicesMapping.begin();
140 return stateToChoicesMapping.end();
144 return stateToChoicesMapping.begin();
148 return stateToChoicesMapping.end();
A bit vector that is internally represented as a vector of 64-bit values.
bool get(uint_fast64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
This class represents a maximal end-component of a nondeterministic model.
iterator end()
Retrieves an iterator that points past the last state and its choices in the MEC.
bool operator!=(MaximalEndComponent const &other)
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.
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.
bool operator==(MaximalEndComponent const &other)
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.
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)