Browse Source

modify the ma builder such that it resprects priorities

Former-commit-id: 2aa01e8e5d
tempestpy_adaptions
ThomasH 9 years ago
parent
commit
7fef54ab10
  1. 12
      src/builder/ExplicitGspnModelBuilder.cpp
  2. 5
      src/builder/ExplicitGspnModelBuilder.h

12
src/builder/ExplicitGspnModelBuilder.cpp

@ -228,8 +228,14 @@ namespace storm {
storm::gspn::Marking const& marking) {
std::vector<std::shared_ptr<storm::gspn::TimedTransition<double>>>result;
uint_fast64_t highestSeenPriority = 0;
for (auto& trans_ptr : gspn.getTimedTransitions()) {
if (trans_ptr->isEnabled(marking)) {
if (trans_ptr->getPriority() > highestSeenPriority) {
highestSeenPriority = trans_ptr->getPriority();
result.clear();
}
result.push_back(trans_ptr);
}
}
@ -242,8 +248,14 @@ namespace storm {
storm::gspn::Marking const& marking) {
std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>>result;
uint_fast64_t highestSeenPriority = 0;
for (auto& trans_ptr : gspn.getImmediateTransitions()) {
if (trans_ptr->isEnabled(marking)) {
if (trans_ptr->getPriority() > highestSeenPriority) {
highestSeenPriority = trans_ptr->getPriority();
result.clear();
}
result.push_back(trans_ptr);
}
}

5
src/builder/ExplicitGspnModelBuilder.h

@ -95,7 +95,8 @@ namespace storm {
void computeCapacities(storm::gspn::GSPN const& gspn);
/*!
* Returns the vector of enabled timed transition.
* Returns the vector of enabled timed transition with the highest priority.
*
*
* @param marking The current marking which is considered.
* @return The vector of enabled timed transitions.
@ -104,7 +105,7 @@ namespace storm {
storm::gspn::Marking const& marking);
/*!
* Returns the vector of active immediate transition
* Returns the vector of active immediate transition with the highest priority.
*
* @param marking The current marking which is considered.
* @return The vector of enabled immediate transitions.
Loading…
Cancel
Save