|
|
@ -81,14 +81,28 @@ namespace storm { |
|
|
|
|
|
|
|
} |
|
|
|
if(!ignoreWeights) { |
|
|
|
|
|
|
|
uint64_t lastPriority; |
|
|
|
storm::expressions::Expression lastPriorityGuard = expressionManager->boolean(false); |
|
|
|
storm::expressions::Expression priorityGuard = expressionManager->boolean(true); |
|
|
|
// TODO here there is something to fix if we add transition partitions. |
|
|
|
|
|
|
|
for (auto const& partition : gspn.getPartitions()) { |
|
|
|
storm::expressions::Expression guard = expressionManager->boolean(false); |
|
|
|
std::vector<storm::jani::EdgeDestination> weightedDestinations; |
|
|
|
|
|
|
|
|
|
|
|
assert(lastPriority <= partition.priority); |
|
|
|
if (lastPriority < partition.priority) { |
|
|
|
priorityGuard = priorityGuard && !lastPriorityGuard; |
|
|
|
lastPriority = partition.priority; |
|
|
|
} else { |
|
|
|
assert(lastPriority == partition.priority); |
|
|
|
} |
|
|
|
|
|
|
|
// Compute enabled weight expression. |
|
|
|
storm::expressions::Expression totalWeight = expressionManager->rational(0.0); |
|
|
|
for (auto const& trans : gspn.getImmediateTransitions()) { |
|
|
|
for (auto const& transId : partition.transitions) { |
|
|
|
auto const& trans = gspn.getImmediateTransitions()[transId]; |
|
|
|
if (trans.noWeightAttached()) { |
|
|
|
continue; |
|
|
|
} |
|
|
@ -104,7 +118,9 @@ namespace storm { |
|
|
|
} |
|
|
|
totalWeight = totalWeight.simplify(); |
|
|
|
|
|
|
|
for (auto const& trans : gspn.getImmediateTransitions()) { |
|
|
|
|
|
|
|
for (auto const& transId : partition.transitions) { |
|
|
|
auto const& trans = gspn.getImmediateTransitions()[transId]; |
|
|
|
if (trans.noWeightAttached()) { |
|
|
|
continue; |
|
|
|
} |
|
|
@ -126,8 +142,13 @@ namespace storm { |
|
|
|
storm::jani::EdgeDestination dest(locId, storm::expressions::ite(destguard, (expressionManager->rational(trans.getWeight()) / totalWeight), expressionManager->rational(0.0)), oa); |
|
|
|
weightedDestinations.push_back(dest); |
|
|
|
} |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::SILENT_ACTION_INDEX, boost::none, guard.simplify(), weightedDestinations); |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::SILENT_ACTION_INDEX, boost::none, (priorityGuard && guard).simplify(), weightedDestinations); |
|
|
|
automaton.addEdge(e); |
|
|
|
lastPriorityGuard = lastPriorityGuard || guard; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
for (auto const& trans : gspn.getTimedTransitions()) { |
|
|
|
storm::expressions::Expression guard = expressionManager->boolean(true); |
|
|
|