Browse Source

hasMultipleLevel for orderedassignments

Former-commit-id: d1a94d6931 [formerly e19b59fdac]
Former-commit-id: 9c79f94cdf
tempestpy_adaptions
sjunges 8 years ago
parent
commit
cd338eb8e3
  1. 13
      src/storage/jani/OrderedAssignments.cpp
  2. 9
      src/storage/jani/OrderedAssignments.h

13
src/storage/jani/OrderedAssignments.cpp

@ -65,6 +65,19 @@ namespace storm {
return true;
}
bool OrderedAssignments::hasMultipleLevels() const {
if(allAssignments.empty()) {
return false;
}
uint64_t firstLevel = allAssignments.front()->getLevel();
for(auto const& assignment : allAssignments) {
if(assignment->getLevel() != firstLevel) {
return true;
}
}
return false;
}
bool OrderedAssignments::contains(Assignment const& assignment) const {
auto it = lowerBound(assignment, allAssignments);
if (it != allAssignments.end() && assignment == **it) {

9
src/storage/jani/OrderedAssignments.h

@ -32,7 +32,14 @@ namespace storm {
* @return True if the assignment was found and removed.
*/
bool remove(Assignment const& assignment);
/*!
* Checks whether the assignments have several levels.
*
* @return True if more than one level occurs in the assignment set.
*/
bool hasMultipleLevels() const;
/*!
* Retrieves whether the given assignment is contained in this set of assignments.
*/

Loading…
Cancel
Save