Browse Source

weight zero is no weight is now more explicit

Former-commit-id: e7494eb7bd
main
sjunges 9 years ago
parent
commit
4b20a724dc
  1. 2
      src/builder/ExplicitGspnModelBuilder.cpp
  2. 10
      src/storage/gspn/ImmediateTransition.h

2
src/builder/ExplicitGspnModelBuilder.cpp

@ -183,7 +183,7 @@ namespace storm {
std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>> weightedTransitions; std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>> weightedTransitions;
for (auto& trans : enabledImmediateTransitions) { for (auto& trans : enabledImmediateTransitions) {
if (trans->getWeight() == 0) {
if (trans->noWeightAttached()) {
decltype(weightedTransitions) singleton; decltype(weightedTransitions) singleton;
singleton.push_back(trans); singleton.push_back(trans);
result.push_back(singleton); result.push_back(singleton);

10
src/storage/gspn/ImmediateTransition.h

@ -2,6 +2,7 @@
#define STORM_STORAGE_GSPN_IMMEDIATETRANSITION_H_ #define STORM_STORAGE_GSPN_IMMEDIATETRANSITION_H_
#include "src/storage/gspn/Transition.h" #include "src/storage/gspn/Transition.h"
#include "src/utility/constants.h"
namespace storm { namespace storm {
namespace gspn { namespace gspn {
@ -25,8 +26,15 @@ namespace storm {
WeightType getWeight() const { WeightType getWeight() const {
return this->weight; return this->weight;
} }
/**
* True iff no weight is attached.
*/
bool noWeightAttached() {
return storm::utility::isZero(weight);
}
private: private:
// the weight of the transition
// the weight of the transition. Must be positive, if zero, then no weight is attached.
WeightType weight; WeightType weight;
}; };
} }

Loading…
Cancel
Save