From 4b20a724dc4921e4e0cc871057d2432350d75574 Mon Sep 17 00:00:00 2001 From: sjunges Date: Wed, 3 Aug 2016 10:42:31 +0200 Subject: [PATCH] weight zero is no weight is now more explicit Former-commit-id: e7494eb7bdba9d43f17d6ab2b5a40ccd7592103e --- src/builder/ExplicitGspnModelBuilder.cpp | 2 +- src/storage/gspn/ImmediateTransition.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/builder/ExplicitGspnModelBuilder.cpp b/src/builder/ExplicitGspnModelBuilder.cpp index ac82e5498..e42a32e5b 100644 --- a/src/builder/ExplicitGspnModelBuilder.cpp +++ b/src/builder/ExplicitGspnModelBuilder.cpp @@ -183,7 +183,7 @@ namespace storm { std::vector>> weightedTransitions; for (auto& trans : enabledImmediateTransitions) { - if (trans->getWeight() == 0) { + if (trans->noWeightAttached()) { decltype(weightedTransitions) singleton; singleton.push_back(trans); result.push_back(singleton); diff --git a/src/storage/gspn/ImmediateTransition.h b/src/storage/gspn/ImmediateTransition.h index ea79d57bf..cf4839181 100644 --- a/src/storage/gspn/ImmediateTransition.h +++ b/src/storage/gspn/ImmediateTransition.h @@ -2,6 +2,7 @@ #define STORM_STORAGE_GSPN_IMMEDIATETRANSITION_H_ #include "src/storage/gspn/Transition.h" +#include "src/utility/constants.h" namespace storm { namespace gspn { @@ -25,8 +26,15 @@ namespace storm { WeightType getWeight() const { return this->weight; } + + /** + * True iff no weight is attached. + */ + bool noWeightAttached() { + return storm::utility::isZero(weight); + } private: - // the weight of the transition + // the weight of the transition. Must be positive, if zero, then no weight is attached. WeightType weight; }; }