Browse Source

A little bit more convenience operators

Former-commit-id: 4e7a9553de [formerly a78fadf91c]
Former-commit-id: bd0aff8ca4
tempestpy_adaptions
sjunges 8 years ago
parent
commit
693b4d3657
  1. 9
      src/storage/jani/EdgeDestination.cpp
  2. 5
      src/storage/jani/EdgeDestination.h
  3. 4
      src/storage/jani/OrderedAssignments.cpp
  4. 2
      src/storage/jani/OrderedAssignments.h

9
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<Assignment> const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) {
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, OrderedAssignments const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) {
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<Assignment> const& assignments) : locationIndex(locationIndex), probability(probability), assignments(assignments) {
// Intentionally left empty.
}
void EdgeDestination::addAssignment(Assignment const& assignment) {
assignments.add(assignment);

5
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<Assignment> 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<Assignment> const& assignments = {});
/*!
* Additionally performs the given assignment when choosing this destination.
*/

4
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)) {

2
src/storage/jani/OrderedAssignments.h

@ -19,6 +19,8 @@ namespace storm {
*/
OrderedAssignments(std::vector<Assignment> const& assignments = std::vector<Assignment>());
explicit OrderedAssignments(Assignment const& assignment);
/*!
* Adds the given assignment to the set of assignments.
*

Loading…
Cancel
Save