25 std::stringstream info;
27 auto optionalPrint = [&info](std::string
const& label,
auto const& value) {
29 info <<
"\t* " << label <<
": " << value.value() <<
"\n";
32 if (
index.modelData) {
33 auto const& md =
index.modelData.value();
34 if (md.authors && !md.authors->empty()) {
35 info <<
"\t* Authors: " << boost::join(md.authors.value(),
"; ") <<
"\n";
37 optionalPrint(
"Description", md.description);
38 optionalPrint(
"Comment", md.comment);
39 optionalPrint(
"DOI", md.doi);
40 optionalPrint(
"URL", md.url);
43 auto const& fd =
index.fileData.value();
45 info <<
"\t* Created with tool: " << fd.tool.value();
47 info <<
" v" << fd.toolVersion.value();
51 if (fd.creationDate) {
52 info <<
"\t* Creation date: " << fd.creationDateAsString() <<
"\n";
55 info <<
"\t* Parameters:\n" <<
storm::dumpJson(fd.parameters.value()) <<
"\n";
106 if (v.isType<storm::RationalNumber>()) {
114 if (v.
isType<storm::RationalNumber>()) {
116 v.template set<uint64_t>(std::move(values));
119 v.template set<uint64_t>(std::move(values));
125 encodeForSize(v, size.value());
129 if (
index.transitionSystem.branchProbabilityType.has_value()) {
132 if (
index.transitionSystem.exitRateType.has_value()) {
135 if (
index.transitionSystem.observationProbabilityType.has_value()) {
144 for (
auto& [annotationName, annotationValues] :
annotation) {
146 uint64_t valueSize{0}, probSize{0};
147 boost::pfr::for_each_field(annotationValues, [&valueSize, &probSize, &getSize](
auto& entity) {
148 if (entity.has_value()) {
149 valueSize = std::max(valueSize, getSize(entity->values));
150 probSize = std::max(probSize, getSize(entity->probabilities));
154 if (valueSize > 0 || probSize > 0) {
156 "There are annotation files stored for annotations/" << annotationType <<
"/" << annotationName
157 <<
", but no corresponding entry in the index.");
158 auto& indexAnnotation =
index.annotation(annotationType)->at(annotationName);
160 indexAnnotation.type.size = valueSize;
161 boost::pfr::for_each_field(annotationValues, [&valueSize, &encodeForSize](
auto& entity) {
162 if (entity.has_value()) {
163 encodeForSize(entity->values, valueSize);
168 STORM_LOG_ASSERT(indexAnnotation.probabilityType.has_value(),
"Found annotation probabilities but no type in index.");
169 indexAnnotation.probabilityType.value().size = probSize;
170 boost::pfr::for_each_field(annotationValues, [&probSize, &encodeForSize](
auto& entity) {
171 if (entity.has_value()) {
172 encodeForSize(entity->probabilities, probSize);
185 std::vector<storm::RationalNumber> values(valueView.begin(), valueView.end());
186 v.template set<storm::RationalNumber>(std::move(values));
189 std::vector<storm::RationalInterval> values(valueView.begin(), valueView.end());
190 v.template set<storm::RationalInterval>(std::move(values));
194 if (
index.transitionSystem.branchProbabilityType.has_value()) {
197 if (
index.transitionSystem.exitRateType.has_value()) {
200 if (
index.transitionSystem.observationProbabilityType.has_value()) {
210 for (
auto& [annotationName, annotationValues] :
annotation) {
212 "There are annotation files stored for annotations/" << annotationType <<
"/" << annotationName
213 <<
", but no corresponding entry in the index.");
214 auto const& annotationIndex =
index.annotation(annotationType)->at(annotationName);
215 boost::pfr::for_each_field(annotationValues, [&annotationIndex, &decode](
auto& entity) {
216 if (entity.has_value()) {
217 decode(entity->values, annotationIndex.type);
218 decode(entity->probabilities, annotationIndex.probabilityType.value());