14 std::vector<EdgeIndexSet>
const& identifierToEdgeIndexSetMapping)
15 :
ChoiceOrigins(indexToIdentifierMapping), model(janiModel), identifierToEdgeIndexSet(identifierToEdgeIndexSetMapping) {
17 "The given edge set for the choices without origin is non-empty");
25 return identifierToEdgeIndexSet.size();
33 return identifierToEdgeIndexSet[this->
getIdentifier(choiceIndex)];
36std::shared_ptr<ChoiceOrigins> JaniChoiceOrigins::cloneWithNewIndexToIdentifierMapping(std::vector<uint_fast64_t>&& indexToIdentifierMapping)
const {
37 auto result = std::make_shared<JaniChoiceOrigins>(this->model, std::move(indexToIdentifierMapping), std::move(identifierToEdgeIndexSet));
42void JaniChoiceOrigins::computeIdentifierInfos()
const {
46 for (
auto const& edgeSet : identifierToEdgeIndexSet) {
49 for (
auto const& edgeIndex : edgeSet) {
50 auto autAndEdgeOffset = model->decodeAutomatonAndEdgeIndices(edgeIndex);
51 ss << model->getAutomaton(autAndEdgeOffset.first).getEdge(autAndEdgeOffset.second).toString();
59void JaniChoiceOrigins::computeIdentifierJson()
const {
62 for (
auto const& set : identifierToEdgeIndexSet) {
65 setJson =
"No origin";
68 std::vector<Json> edgesJson;
69 for (
auto const& edgeIndex : set) {
70 auto autAndEdgeOffset = model->decodeAutomatonAndEdgeIndices(edgeIndex);
71 auto const& automaton = model->getAutomaton(autAndEdgeOffset.first);
72 auto const& edge = automaton.getEdge(autAndEdgeOffset.second);
74 setJson[
"action-label"] = model->getAction(edge.getActionIndex()).getName();
78 edgesJson.back()[
"automaton"] = automaton.getName();
80 setJson[
"transitions"] = std::move(edgesJson);
static ExportJsonType getEdgeAsJson(storm::jani::Model const &janiModel, uint64_t automatonIndex, uint64_t edgeIndex, bool commentExpressions=true)
This class represents the origin of the choices of a model in terms of the input model specification ...
std::vector< Json > identifierToJson
uint_fast64_t getIdentifier(uint_fast64_t choiceIndex) const
std::vector< std::string > identifierToInfo
static uint_fast64_t getIdentifierForChoicesWithNoOrigin()
storm::json< storm::RationalNumber > Json
storm::jani::Model const & getModel() const
Retrieves the associated JANI model.
virtual bool isJaniChoiceOrigins() const override
std::size_t hash() const override
JaniChoiceOrigins(std::shared_ptr< storm::jani::Model const > const &janiModel, std::vector< uint_fast64_t > const &indexToIdentifierMapping, std::vector< EdgeIndexSet > const &identifierToEdgeIndexSetMapping)
Creates a new representation of the choice indices to their origin in the Jani specification.
storm::storage::FlatSet< uint_fast64_t > EdgeIndexSet
virtual uint_fast64_t getNumberOfIdentifiers() const override
EdgeIndexSet const & getEdgeIndexSet(uint_fast64_t choiceIndex) const
#define STORM_LOG_THROW(cond, exception, message)