|
|
@ -62,19 +62,19 @@ namespace storm { |
|
|
|
for (auto const& trans : gspn.getImmediateTransitions()) { |
|
|
|
if (ignoreWeights || trans->noWeightAttached()) { |
|
|
|
std::vector<storm::jani::Assignment> assignments; |
|
|
|
for (auto inPlaceIt = trans->getInputPlacesCBegin(); inPlaceIt != trans->getInputPlacesCEnd(); ++inPlaceIt) { |
|
|
|
guard = guard && (vars[(**inPlaceIt).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(**inPlaceIt)); |
|
|
|
assignments.emplace_back( *vars[(**inPlaceIt).getID()], (vars[(**inPlaceIt).getID()]->getExpressionVariable() - trans->getInputArcMultiplicity(**inPlaceIt)) ); |
|
|
|
for (auto const& inPlace : trans->getInputPlaces()) { |
|
|
|
guard = guard && (vars[(*inPlace).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(*inPlace)); |
|
|
|
assignments.emplace_back( *vars[(*inPlace).getID()], (vars[(*inPlace).getID()]->getExpressionVariable() - trans->getInputArcMultiplicity(*inPlace)) ); |
|
|
|
} |
|
|
|
for (auto inhibPlaceIt = trans->getInhibitionPlacesCBegin(); inhibPlaceIt != trans->getInhibitionPlacesCEnd(); ++inhibPlaceIt) { |
|
|
|
guard = guard && (vars[(**inhibPlaceIt).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(**inhibPlaceIt)); |
|
|
|
for (auto const& inhibPlace : trans->getInhibitionPlaces()) { |
|
|
|
guard = guard && (vars[(*inhibPlace).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(*inhibPlace)); |
|
|
|
} |
|
|
|
for (auto outputPlaceIt = trans->getOutputPlacesCBegin(); outputPlaceIt != trans->getOutputPlacesCEnd(); ++outputPlaceIt) { |
|
|
|
assignments.emplace_back( *vars[(**outputPlaceIt).getID()], (vars[(**outputPlaceIt).getID()]->getExpressionVariable() + trans->getOutputArcMultiplicity(**outputPlaceIt)) ); |
|
|
|
for (auto const& outputPlace : trans->getOutputPlaces()) { |
|
|
|
assignments.emplace_back( *vars[(*outputPlace).getID()], (vars[(*outputPlace).getID()]->getExpressionVariable() + trans->getOutputArcMultiplicity(*outputPlace)) ); |
|
|
|
} |
|
|
|
storm::jani::OrderedAssignments oa(assignments); |
|
|
|
storm::jani::EdgeDestination dest(locId, expressionManager->integer(1), oa); |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::silentActionIndex, boost::none, guard, {dest}); |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::SILENT_ACTION_INDEX, boost::none, guard, {dest}); |
|
|
|
automaton.addEdge(e); |
|
|
|
} |
|
|
|
|
|
|
@ -92,11 +92,11 @@ namespace storm { |
|
|
|
continue; |
|
|
|
} |
|
|
|
storm::expressions::Expression destguard = expressionManager->boolean(true); |
|
|
|
for (auto inPlaceIt = trans->getInputPlacesCBegin(); inPlaceIt != trans->getInputPlacesCEnd(); ++inPlaceIt) { |
|
|
|
destguard = destguard && (vars[(**inPlaceIt).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(**inPlaceIt)); |
|
|
|
for (auto const& inPlace : trans->getInputPlaces()) { |
|
|
|
destguard = destguard && (vars[(*inPlace).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(*inPlace)); |
|
|
|
} |
|
|
|
for (auto inhibPlaceIt = trans->getInhibitionPlacesCBegin(); inhibPlaceIt != trans->getInhibitionPlacesCEnd(); ++inhibPlaceIt) { |
|
|
|
destguard = destguard && (vars[(**inhibPlaceIt).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(**inhibPlaceIt)); |
|
|
|
for (auto const& inhibPlace : trans->getInhibitionPlaces()) { |
|
|
|
destguard = destguard && (vars[(*inhibPlace).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(*inhibPlace)); |
|
|
|
} |
|
|
|
totalWeight = totalWeight + storm::expressions::ite(destguard, expressionManager->rational(trans->getWeight()), expressionManager->rational(0.0)); |
|
|
|
|
|
|
@ -109,15 +109,15 @@ namespace storm { |
|
|
|
} |
|
|
|
storm::expressions::Expression destguard = expressionManager->boolean(true); |
|
|
|
std::vector<storm::jani::Assignment> assignments; |
|
|
|
for (auto inPlaceIt = trans->getInputPlacesCBegin(); inPlaceIt != trans->getInputPlacesCEnd(); ++inPlaceIt) { |
|
|
|
destguard = destguard && (vars[(**inPlaceIt).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(**inPlaceIt)); |
|
|
|
assignments.emplace_back( *vars[(**inPlaceIt).getID()], (vars[(**inPlaceIt).getID()]->getExpressionVariable() - trans->getInputArcMultiplicity(**inPlaceIt)) ); |
|
|
|
for (auto const& inPlace : trans->getInputPlaces()) { |
|
|
|
destguard = destguard && (vars[(*inPlace).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(*inPlace)); |
|
|
|
assignments.emplace_back( *vars[(*inPlace).getID()], (vars[(*inPlace).getID()]->getExpressionVariable() - trans->getInputArcMultiplicity(*inPlace)) ); |
|
|
|
} |
|
|
|
for (auto inhibPlaceIt = trans->getInhibitionPlacesCBegin(); inhibPlaceIt != trans->getInhibitionPlacesCEnd(); ++inhibPlaceIt) { |
|
|
|
destguard = destguard && (vars[(**inhibPlaceIt).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(**inhibPlaceIt)); |
|
|
|
for (auto const& inhibPlace : trans->getInhibitionPlaces()) { |
|
|
|
destguard = destguard && (vars[(*inhibPlace).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(*inhibPlace)); |
|
|
|
} |
|
|
|
for (auto outputPlaceIt = trans->getOutputPlacesCBegin(); outputPlaceIt != trans->getOutputPlacesCEnd(); ++outputPlaceIt) { |
|
|
|
assignments.emplace_back( *vars[(**outputPlaceIt).getID()], (vars[(**outputPlaceIt).getID()]->getExpressionVariable() + trans->getOutputArcMultiplicity(**outputPlaceIt)) ); |
|
|
|
for (auto const& outputPlace : trans->getOutputPlaces()) { |
|
|
|
assignments.emplace_back( *vars[(*outputPlace).getID()], (vars[(*outputPlace).getID()]->getExpressionVariable() + trans->getOutputArcMultiplicity(*outputPlace)) ); |
|
|
|
} |
|
|
|
destguard = destguard.simplify(); |
|
|
|
guard = guard || destguard; |
|
|
@ -125,26 +125,26 @@ 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::silentActionIndex, boost::none, guard.simplify(), weightedDestinations); |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::SILENT_ACTION_INDEX, boost::none, guard.simplify(), weightedDestinations); |
|
|
|
automaton.addEdge(e); |
|
|
|
} |
|
|
|
for (auto const& trans : gspn.getTimedTransitions()) { |
|
|
|
storm::expressions::Expression guard = expressionManager->boolean(true); |
|
|
|
|
|
|
|
std::vector<storm::jani::Assignment> assignments; |
|
|
|
for (auto inPlaceIt = trans->getInputPlacesCBegin(); inPlaceIt != trans->getInputPlacesCEnd(); ++inPlaceIt) { |
|
|
|
guard = guard && (vars[(**inPlaceIt).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(**inPlaceIt)); |
|
|
|
assignments.emplace_back( *vars[(**inPlaceIt).getID()], (vars[(**inPlaceIt).getID()]->getExpressionVariable() - trans->getInputArcMultiplicity(**inPlaceIt)) ); |
|
|
|
for (auto const& inPlace : trans->getInputPlaces()) { |
|
|
|
guard = guard && (vars[(*inPlace).getID()]->getExpressionVariable() > trans->getInputArcMultiplicity(*inPlace)); |
|
|
|
assignments.emplace_back( *vars[(*inPlace).getID()], (vars[(*inPlace).getID()]->getExpressionVariable() - trans->getInputArcMultiplicity(*inPlace)) ); |
|
|
|
} |
|
|
|
for (auto inhibPlaceIt = trans->getInhibitionPlacesCBegin(); inhibPlaceIt != trans->getInhibitionPlacesCEnd(); ++inhibPlaceIt) { |
|
|
|
guard = guard && (vars[(**inhibPlaceIt).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(**inhibPlaceIt)); |
|
|
|
for (auto const& inhibPlace : trans->getInhibitionPlaces()) { |
|
|
|
guard = guard && (vars[(*inhibPlace).getID()]->getExpressionVariable() > trans->getInhibitionArcMultiplicity(*inhibPlace)); |
|
|
|
} |
|
|
|
for (auto outputPlaceIt = trans->getOutputPlacesCBegin(); outputPlaceIt != trans->getOutputPlacesCEnd(); ++outputPlaceIt) { |
|
|
|
assignments.emplace_back( *vars[(**outputPlaceIt).getID()], (vars[(**outputPlaceIt).getID()]->getExpressionVariable() + trans->getOutputArcMultiplicity(**outputPlaceIt)) ); |
|
|
|
for (auto const& outputPlace : trans->getOutputPlaces()) { |
|
|
|
assignments.emplace_back( *vars[(*outputPlace).getID()], (vars[(*outputPlace).getID()]->getExpressionVariable() + trans->getOutputArcMultiplicity(*outputPlace)) ); |
|
|
|
} |
|
|
|
storm::jani::OrderedAssignments oa(assignments); |
|
|
|
storm::jani::EdgeDestination dest(locId, expressionManager->integer(1), oa); |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::silentActionIndex, expressionManager->rational(trans->getRate()), guard, {dest}); |
|
|
|
storm::jani::Edge e(locId, storm::jani::Model::SILENT_ACTION_INDEX, expressionManager->rational(trans->getRate()), guard, {dest}); |
|
|
|
automaton.addEdge(e); |
|
|
|
} |
|
|
|
} |
|
|
|