Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
StateLabeling.cpp
Go to the documentation of this file.
2
5
6namespace storm {
7namespace models {
8namespace sparse {
9StateLabeling::StateLabeling(uint_fast64_t stateCount) : ItemLabeling(stateCount) {
10 // Intentionally left empty.
11}
12
14 // Intentionally left empty.
15}
16
18 // Intentionally left empty.
19}
20
22 return true;
23}
24
25bool StateLabeling::operator==(StateLabeling const& other) const {
26 if (itemCount != other.itemCount) {
27 return false;
28 }
29 if (this->getNumberOfLabels() != other.getNumberOfLabels()) {
30 return false;
31 }
32 for (auto const& labelIndexPair : this->nameToLabelingIndexMap) {
33 if (!other.containsLabel(labelIndexPair.first)) {
34 return false;
35 }
36 if (labelings[labelIndexPair.second] != other.getStates(labelIndexPair.first)) {
37 return false;
38 }
39 }
40 return true;
41}
42
46
50
52 ItemLabeling::addLabelToItem(label, state);
53}
54
58
59bool StateLabeling::getStateHasLabel(std::string const& label, storm::storage::sparse::state_type state) const {
60 return ItemLabeling::getItemHasLabel(label, state);
61}
62
63storm::storage::BitVector const& StateLabeling::getStates(std::string const& label) const {
64 return ItemLabeling::getItems(label);
65}
66
67void StateLabeling::setStates(std::string const& label, storage::BitVector const& labeling) {
68 ItemLabeling::setItems(label, labeling);
69}
70
71void StateLabeling::setStates(std::string const& label, storage::BitVector&& labeling) {
72 ItemLabeling::setItems(label, labeling);
73}
74
75std::ostream& operator<<(std::ostream& out, StateLabeling const& labeling) {
77 return out;
78}
79
80} // namespace sparse
81} // namespace models
82} // namespace storm
A base class managing the labeling of items with a number of (atomic) labels.
virtual std::set< std::string > getLabelsOfItem(uint64_t item) const
Retrieves the set of labels attached to the given item.
virtual void setItems(std::string const &label, storage::BitVector const &labeling)
Sets the labeling of items associated with the given label.
virtual bool getItemHasLabel(std::string const &label, uint64_t item) const
Checks whether a given item is labeled with the given label.
ItemLabeling getSubLabeling(storm::storage::BitVector const &items) const
Retrieves the sub labeling that represents the same labeling as the current one for all selected item...
bool containsLabel(std::string const &label) const
Checks whether a label is registered within this labeling.
std::unordered_map< std::string, uint64_t > nameToLabelingIndexMap
virtual storm::storage::BitVector const & getItems(std::string const &label) const
Returns the labeling of items associated with the given label.
virtual void addLabelToItem(std::string const &label, uint64_t item)
Adds a label to a given item.
void printLabelingInformationToStream(std::ostream &out=std::cout) const
Prints information about the labeling to the specified stream.
std::vector< storm::storage::BitVector > labelings
virtual void removeLabelFromItem(std::string const &label, uint64_t item)
Removes a label from a given item.
std::size_t getNumberOfLabels() const
Returns the number of labels managed by this object.
This class manages the labeling of the state space with a number of (atomic) labels.
bool operator==(StateLabeling const &other) const
Checks whether the two labelings are equal.
bool getStateHasLabel(std::string const &label, storm::storage::sparse::state_type state) const
Checks whether a given state is labeled with the given label.
virtual bool isStateLabeling() const override
StateLabeling(uint_fast64_t stateCount=0)
Constructs an empty labeling for the given number of states.
storm::storage::BitVector const & getStates(std::string const &label) const
Returns the labeling of states associated with the given label.
void addLabelToState(std::string const &label, storm::storage::sparse::state_type state)
Adds a label to a given state.
void removeLabelFromState(std::string const &label, storm::storage::sparse::state_type state)
Removes a label from a given state.
void setStates(std::string const &label, storage::BitVector const &labeling)
Sets the labeling of states associated with the given label.
std::set< std::string > getLabelsOfState(storm::storage::sparse::state_type state) const
Retrieves the set of labels attached to the given state.
StateLabeling getSubLabeling(storm::storage::BitVector const &states) const
Retrieves the sub labeling that represents the same labeling as the current one for all selected stat...
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
std::ostream & operator<<(std::ostream &out, ChoiceLabeling const &labeling)
LabParser.cpp.
Definition cli.cpp:18