|
@ -188,6 +188,7 @@ namespace storm { |
|
|
std::pair<bool, bool> timed(false, defaultTransitionType); |
|
|
std::pair<bool, bool> timed(false, defaultTransitionType); |
|
|
std::pair<bool, std::string> value(false, defaultTransitionValue); |
|
|
std::pair<bool, std::string> value(false, defaultTransitionValue); |
|
|
std::string id; |
|
|
std::string id; |
|
|
|
|
|
uint_fast64_t priority; |
|
|
|
|
|
|
|
|
// parse attributes
|
|
|
// parse attributes
|
|
|
for (uint_fast64_t i = 0; i < node->getAttributes()->getLength(); ++i) { |
|
|
for (uint_fast64_t i = 0; i < node->getAttributes()->getLength(); ++i) { |
|
@ -212,6 +213,8 @@ namespace storm { |
|
|
} else if (name.compare("timed") == 0) { |
|
|
} else if (name.compare("timed") == 0) { |
|
|
timed.first = true; |
|
|
timed.first = true; |
|
|
timed.second = traverseTransitionType(child); |
|
|
timed.second = traverseTransitionType(child); |
|
|
|
|
|
} else if (name.compare("priority") == 0) { |
|
|
|
|
|
priority = traversePriority(child); |
|
|
} else if (std::all_of(name.begin(), name.end(), isspace)) { |
|
|
} else if (std::all_of(name.begin(), name.end(), isspace)) { |
|
|
// ignore node (contains only whitespace)
|
|
|
// ignore node (contains only whitespace)
|
|
|
} else if (name.compare("graphics") == 0 || |
|
|
} else if (name.compare("graphics") == 0 || |
|
@ -235,6 +238,7 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
transition.setRate(std::stod(value.second)); |
|
|
transition.setRate(std::stod(value.second)); |
|
|
transition.setName(id); |
|
|
transition.setName(id); |
|
|
|
|
|
transition.setPriority(priority); |
|
|
gspn.addTimedTransition(transition); |
|
|
gspn.addTimedTransition(transition); |
|
|
} else { |
|
|
} else { |
|
|
storm::gspn::ImmediateTransition<storm::gspn::GSPN::WeightType> transition; |
|
|
storm::gspn::ImmediateTransition<storm::gspn::GSPN::WeightType> transition; |
|
@ -243,6 +247,7 @@ namespace storm { |
|
|
} |
|
|
} |
|
|
transition.setWeight(std::stod(value.second)); |
|
|
transition.setWeight(std::stod(value.second)); |
|
|
transition.setName(id); |
|
|
transition.setName(id); |
|
|
|
|
|
transition.setPriority(priority); |
|
|
gspn.addImmediateTransition(transition); |
|
|
gspn.addImmediateTransition(transition); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -469,6 +474,28 @@ namespace storm { |
|
|
return defaultArcType; |
|
|
return defaultArcType; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uint_fast64_t GspnParser::traversePriority(xercesc::DOMNode const* const node) { |
|
|
|
|
|
uint_fast64_t result = defaultPriority; |
|
|
|
|
|
for (uint_fast64_t i = 0; i < node->getChildNodes()->getLength(); ++i) { |
|
|
|
|
|
auto child = node->getChildNodes()->item(i); |
|
|
|
|
|
auto name = getName(child); |
|
|
|
|
|
if (name.compare("text") == 0) { |
|
|
|
|
|
result = std::stoull(getName(child->getFirstChild())); |
|
|
|
|
|
} else if (name.compare("value") == 0) { |
|
|
|
|
|
auto value = getName(child->getFirstChild()); |
|
|
|
|
|
value = value.substr(std::string("Default,").length()); |
|
|
|
|
|
result = std::stoull(value); |
|
|
|
|
|
} else if (std::all_of(name.begin(), name.end(), isspace)) { |
|
|
|
|
|
// ignore node (contains only whitespace)
|
|
|
|
|
|
} else if (name.compare("graphics") == 0) { |
|
|
|
|
|
// ignore these tags
|
|
|
|
|
|
} else { |
|
|
|
|
|
STORM_PRINT_AND_LOG("unknown child (node=priority): " + name + "\n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
std::string GspnParser::XMLtoString(const XMLCh *xmlString) { |
|
|
std::string GspnParser::XMLtoString(const XMLCh *xmlString) { |
|
|
char* tmp = xercesc::XMLString::transcode(xmlString); |
|
|
char* tmp = xercesc::XMLString::transcode(xmlString); |
|
|
auto result = std::string(tmp); |
|
|
auto result = std::string(tmp); |
|
|