From 693b4d36571a5aabeec2a1578e371629793b2ecb Mon Sep 17 00:00:00 2001 From: sjunges Date: Tue, 20 Sep 2016 11:35:11 +0200 Subject: [PATCH] A little bit more convenience operators Former-commit-id: 4e7a9553debd258ea0d76c963595497ab915081b [formerly a78fadf91cabf4712693bcccb5b0a22601e736a0] Former-commit-id: bd0aff8ca48fb46953c9b5e9365ef04e148889dc --- src/storage/jani/EdgeDestination.cpp | 11 ++++++----- src/storage/jani/EdgeDestination.h | 5 +++-- src/storage/jani/OrderedAssignments.cpp | 4 ++++ src/storage/jani/OrderedAssignments.h | 2 ++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/storage/jani/EdgeDestination.cpp b/src/storage/jani/EdgeDestination.cpp index f34231b14..1136c1318 100644 --- a/src/storage/jani/EdgeDestination.cpp +++ b/src/storage/jani/EdgeDestination.cpp @@ -6,16 +6,17 @@ namespace storm { namespace jani { - EdgeDestination::EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, std::vector const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) { - // Intentionally left empty. - } - - EdgeDestination::EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, OrderedAssignments const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) { // Intentionally left empty. } + EdgeDestination::EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, Assignment const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) { + // Intentionally left empty. + } + EdgeDestination::EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, std::vector const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) { + // Intentionally left empty. + } void EdgeDestination::addAssignment(Assignment const& assignment) { assignments.add(assignment); diff --git a/src/storage/jani/EdgeDestination.h b/src/storage/jani/EdgeDestination.h index b8af1cc90..4071f83d8 100644 --- a/src/storage/jani/EdgeDestination.h +++ b/src/storage/jani/EdgeDestination.h @@ -14,10 +14,11 @@ namespace storm { /*! * Creates a new edge destination. */ - EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, std::vector const& assignments = {}); - EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, OrderedAssignments const& assignments); + EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, Assignment const& assignment); + EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability, std::vector const& assignments = {}); + /*! * Additionally performs the given assignment when choosing this destination. */ diff --git a/src/storage/jani/OrderedAssignments.cpp b/src/storage/jani/OrderedAssignments.cpp index 9d71174f4..933054100 100644 --- a/src/storage/jani/OrderedAssignments.cpp +++ b/src/storage/jani/OrderedAssignments.cpp @@ -12,6 +12,10 @@ namespace storm { } } + OrderedAssignments::OrderedAssignments(Assignment const& assignment) { + add(assignment); + } + bool OrderedAssignments::add(Assignment const& assignment) { // If the element is contained in this set of assignment, nothing needs to be added. if (this->contains(assignment)) { diff --git a/src/storage/jani/OrderedAssignments.h b/src/storage/jani/OrderedAssignments.h index 496912b0e..afbf66cad 100644 --- a/src/storage/jani/OrderedAssignments.h +++ b/src/storage/jani/OrderedAssignments.h @@ -19,6 +19,8 @@ namespace storm { */ OrderedAssignments(std::vector const& assignments = std::vector()); + explicit OrderedAssignments(Assignment const& assignment); + /*! * Adds the given assignment to the set of assignments. *