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.
85 lines
2.8 KiB
85 lines
2.8 KiB
#include "ChoiceLabeling.h"
|
|
|
|
|
|
|
|
#include "storm/exceptions/OutOfRangeException.h"
|
|
#include "storm/exceptions/InvalidArgumentException.h"
|
|
|
|
|
|
namespace storm {
|
|
namespace models {
|
|
namespace sparse {
|
|
ChoiceLabeling::ChoiceLabeling(uint_fast64_t choiceCount) : ItemLabeling(choiceCount) {
|
|
// Intentionally left empty.
|
|
}
|
|
|
|
ChoiceLabeling::ChoiceLabeling(ItemLabeling const& itemLab) : ItemLabeling(itemLab) {
|
|
// Intentionally left empty.
|
|
}
|
|
|
|
ChoiceLabeling::ChoiceLabeling(ItemLabeling const&& itemLab) : ItemLabeling(itemLab) {
|
|
// Intentionally left empty.
|
|
}
|
|
|
|
|
|
bool ChoiceLabeling::operator==(ChoiceLabeling const& other) const {
|
|
if (itemCount != other.itemCount) {
|
|
return false;
|
|
}
|
|
if (this->getNumberOfLabels() != other.getNumberOfLabels()) {
|
|
return false;
|
|
}
|
|
for (auto const& labelIndexPair : this->nameToLabelingIndexMap) {
|
|
if (!other.containsLabel(labelIndexPair.first)) {
|
|
return false;
|
|
}
|
|
if (labelings[labelIndexPair.second] != other.getChoices(labelIndexPair.first)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
ChoiceLabeling ChoiceLabeling::getSubLabeling(storm::storage::BitVector const& choices) const {
|
|
return ChoiceLabeling(ItemLabeling::getSubLabeling(choices));
|
|
}
|
|
|
|
|
|
|
|
std::set<std::string> ChoiceLabeling::getLabelsOfChoice(uint64_t choice) const {
|
|
return this->getLabelsOfItem(choice);
|
|
}
|
|
|
|
|
|
void ChoiceLabeling::addLabelToChoice(std::string const& label,uint64_t choice) {
|
|
this->addLabelToChoice(label, choice);
|
|
}
|
|
|
|
bool ChoiceLabeling::getChoiceHasLabel(std::string const& label, uint64_t choice) const {
|
|
return this->getItemHasLabel(label, choice);
|
|
}
|
|
|
|
|
|
storm::storage::BitVector const& ChoiceLabeling::getChoices(std::string const& label) const {
|
|
return this->getItems(label);
|
|
}
|
|
|
|
void ChoiceLabeling::setChoices(std::string const& label, storage::BitVector const& labeling) {
|
|
this->setItems(label, labeling);
|
|
}
|
|
|
|
void ChoiceLabeling::setChoices(std::string const& label, storage::BitVector&& labeling) {
|
|
this->setItems(label, labeling);
|
|
}
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& out, ChoiceLabeling const& labeling) {
|
|
labeling.printLabelingInformationToStream(out);
|
|
return out;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|