Storm 1.13.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
IOSettings.cpp
Go to the documentation of this file.
2
11
15
16namespace storm {
17namespace settings {
18namespace modules {
19
20const std::string IOSettings::moduleName = "io";
21const std::string IOSettings::exportDotOptionName = "exportdot";
22const std::string IOSettings::exportDotMaxWidthOptionName = "dot-maxwidth";
23const std::string IOSettings::exportBuildOptionName = "exportbuild";
24const std::string IOSettings::exportExplicitOptionName = "exportexplicit";
25const std::string IOSettings::exportDdOptionName = "exportdd";
26const std::string IOSettings::exportJaniDotOptionName = "exportjanidot";
27const std::string IOSettings::exportCdfOptionName = "exportcdf";
28const std::string IOSettings::exportCdfOptionShortName = "cdf";
29const std::string IOSettings::exportSchedulerOptionName = "exportscheduler";
30const std::string IOSettings::exportCheckResultOptionName = "exportresult";
31const std::string IOSettings::exportCompressionOptionName = "compression";
32const std::string IOSettings::exportDigitsOptionName = "digits";
33const std::string IOSettings::explicitOptionName = "explicit";
34const std::string IOSettings::explicitOptionShortName = "exp";
35const std::string IOSettings::explicitDrnOptionName = "explicit-drn";
36const std::string IOSettings::explicitDrnOptionShortName = "drn";
37const std::string IOSettings::explicitUmbOptionName = "explicit-umb";
38const std::string IOSettings::explicitUmbOptionShortName = "umb";
39const std::string IOSettings::explicitImcaOptionName = "explicit-imca";
40const std::string IOSettings::explicitImcaOptionShortName = "imca";
41const std::string IOSettings::prismInputOptionName = "prism";
42const std::string IOSettings::janiInputOptionName = "jani";
43const std::string IOSettings::prismToJaniOptionName = "prism2jani";
44
45const std::string IOSettings::transitionRewardsOptionName = "transrew";
46const std::string IOSettings::stateRewardsOptionName = "staterew";
47const std::string IOSettings::choiceLabelingOptionName = "choicelab";
48const std::string IOSettings::constantsOptionName = "constants";
49const std::string IOSettings::constantsOptionShortName = "const";
50
51const std::string IOSettings::janiPropertyOptionName = "janiproperty";
52const std::string IOSettings::janiPropertyOptionShortName = "jprop";
53const std::string IOSettings::propertyOptionName = "prop";
54const std::string IOSettings::propertyOptionShortName = "prop";
55const std::string IOSettings::steadyStateDistrOptionName = "steadystate";
56const std::string IOSettings::expectedVisitingTimesOptionName = "expvisittimes";
57
58const std::string IOSettings::qvbsInputOptionName = "qvbs";
59const std::string IOSettings::qvbsInputOptionShortName = "qvbs";
60const std::string IOSettings::qvbsRootOptionName = "qvbsroot";
61const std::string IOSettings::propertiesAsMultiOptionName = "propsasmulti";
62
63const std::string IOSettings::uncertaintyResolutionModeName = "uncertainty-resolution";
64
65std::string preventDRNPlaceholderOptionName = "no-drn-placeholders";
66
68 this->addOption(
69 storm::settings::OptionBuilder(moduleName, exportDotOptionName, false,
70 "If given, the loaded model will be written to the specified file in the dot format.")
71 .setIsAdvanced()
72 .addArgument(
73 storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file to which the model is to be written.").build())
74 .build());
76 moduleName, exportDotMaxWidthOptionName, false,
77 "The maximal width for labels in the dot format. For longer lines a linebreak is inserted. Value 0 represents no linebreaks.")
78 .setIsAdvanced()
80 "width", "The maximal line width for the dot format. Default is 0 meaning no linebreaks.")
81 .setDefaultValueUnsignedInteger(0)
82 .build())
83 .build());
84 std::vector<std::string> exportFormats({"auto", "dot", "drdd", "drn", "json", "umb"});
85 this->addOption(
86 storm::settings::OptionBuilder(moduleName, exportBuildOptionName, false, "Exports the built model to a file.")
87 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("file", "The output file.").build())
88 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("format", "The output format. 'auto' detects from the file extension.")
89 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(exportFormats))
90 .setDefaultValueString("auto")
91 .makeOptional()
92 .build())
93 .build());
94
95 std::vector<std::string> compressionModes({"default", "none", "gzip", "xz"});
96 this->addOption(storm::settings::OptionBuilder(moduleName, exportCompressionOptionName, false, "Configures compression of exported files (if supported).")
97 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "The preferred compression mode.")
98 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(compressionModes))
99 .setDefaultValueString("default")
100 .build())
101 .build());
102
103 this->addOption(storm::settings::OptionBuilder(moduleName, exportDigitsOptionName, false, "Sets number of output digits of export (if supported).")
104 .setIsAdvanced()
105 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("num", "Number of digits.").build())
106 .build());
107
108 this->addOption(
109 storm::settings::OptionBuilder(moduleName, exportJaniDotOptionName, false,
110 "If given, the loaded jani model will be written to the specified file in the dot format.")
111 .setIsAdvanced()
112 .addArgument(
113 storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file to which the model is to be written.").build())
114 .build());
115 this->addOption(storm::settings::OptionBuilder(moduleName, exportCdfOptionName, false,
116 "Exports the cumulative density function for reward bounded properties into a .csv file.")
117 .setIsAdvanced()
118 .setShortName(exportCdfOptionShortName)
120 "directory", "A path to an existing directory where the cdf files will be stored.")
121 .build())
122 .build());
123 this->addOption(
124 storm::settings::OptionBuilder(moduleName, exportSchedulerOptionName, false,
125 "Exports the choices of an optimal scheduler to the given file (if supported by engine).")
126 .setIsAdvanced()
127 .addArgument(
128 storm::settings::ArgumentBuilder::createStringArgument("filename", "The output file. Use file extension '.json' to export in json.").build())
129 .build());
130 this->addOption(storm::settings::OptionBuilder(moduleName, exportCheckResultOptionName, false,
131 "Exports the result to a given file (if supported by engine). The export will be in json.")
132 .setIsAdvanced()
133 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The output file.").build())
134 .build());
135 this->addOption(
136 storm::settings::OptionBuilder(moduleName, exportExplicitOptionName, "",
137 "If given, the loaded model will be written to the specified file in the drn format.")
138 .setIsAdvanced()
139 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the file to which the model is to be writen.").build())
140 .build());
141 this->addOption(storm::settings::OptionBuilder(moduleName, preventDRNPlaceholderOptionName, true, "If given, the exported DRN contains no placeholders")
142 .setIsAdvanced()
143 .build());
144 this->addOption(
145 storm::settings::OptionBuilder(moduleName, exportDdOptionName, "",
146 "If given, the loaded model will be written to the specified file in the drdd format.")
147 .setIsAdvanced()
148 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the file to which the model is to be writen.").build())
149 .build());
150 this->addOption(storm::settings::OptionBuilder(moduleName, explicitOptionName, false, "Parses the model given in an explicit (sparse) representation.")
151 .setShortName(explicitOptionShortName)
152 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("transition filename",
153 "The name of the file from which to read the transitions.")
155 .build())
156 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("labeling filename",
157 "The name of the file from which to read the state labeling.")
159 .build())
160 .build());
161 this->addOption(
162 storm::settings::OptionBuilder(moduleName, explicitUmbOptionName, false, "Parses the model given in the UMB format. The file can be compressed.")
163 .setShortName(explicitUmbOptionShortName)
164 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("umb location", "The location of the umb encoding.").build())
165 .build());
166 this->addOption(storm::settings::OptionBuilder(moduleName, explicitDrnOptionName, false, "Parses the model given in the DRN format.")
167 .setShortName(explicitDrnOptionShortName)
168 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("drn filename", "The name of the DRN file containing the model.")
170 .build())
171 .build());
172 this->addOption(storm::settings::OptionBuilder(moduleName, explicitImcaOptionName, false, "Parses the model given in the IMCA format.")
173 .setShortName(explicitImcaOptionShortName)
174 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("imca filename", "The name of the imca file containing the model.")
176 .build())
177 .build());
178 this->addOption(
179 storm::settings::OptionBuilder(moduleName, prismInputOptionName, false, "Parses the model given in the PRISM format.")
180 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the PRISM input.")
182 .build())
183 .build());
184 this->addOption(
185 storm::settings::OptionBuilder(moduleName, janiInputOptionName, false, "Parses the model given in the JANI format.")
186 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the JANI input.")
188 .build())
189 .build());
190 this->addOption(storm::settings::OptionBuilder(moduleName, prismToJaniOptionName, false, "If set, the input PRISM model is transformed to JANI.")
191 .setIsAdvanced()
192 .build());
193 this->addOption(
194 storm::settings::OptionBuilder(moduleName, propertyOptionName, false, "Specifies the properties to be checked on the model.")
195 .setShortName(propertyOptionShortName)
196 .addArgument(
197 storm::settings::ArgumentBuilder::createStringArgument("property or filename", "The formula or the file containing the formulas.").build())
198 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filter", "The names of the properties to check.")
199 .setDefaultValueString("all")
200 .makeOptional()
201 .build())
202 .build());
203
204 this->addOption(storm::settings::OptionBuilder(moduleName, transitionRewardsOptionName, false,
205 "If given, the transition rewards are read from this file and added to the explicit model. Note that this "
206 "requires the model to be given as an explicit model (i.e., via --" +
207 explicitOptionName + ").")
208 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the transition rewards.")
210 .build())
211 .build());
212 this->addOption(storm::settings::OptionBuilder(moduleName, stateRewardsOptionName, false,
213 "If given, the state rewards are read from this file and added to the explicit model. Note that this "
214 "requires the model to be given as an explicit model (i.e., via --" +
215 explicitOptionName + ").")
216 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the state rewards.")
218 .build())
219 .build());
220 this->addOption(storm::settings::OptionBuilder(moduleName, choiceLabelingOptionName, false,
221 "If given, the choice labels are read from this file and added to the explicit model. Note that this "
222 "requires the model to be given as an explicit model (i.e., via --" +
223 explicitOptionName + ").")
224 .setIsAdvanced()
225 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the choice labels.")
227 .build())
228 .build());
229 this->addOption(
231 moduleName, constantsOptionName, false,
232 "Specifies the constant replacements to use in symbolic models. Note that this requires the model to be given as an symbolic model (i.e., via --" +
233 prismInputOptionName + " or --" + janiInputOptionName + ").")
234 .setShortName(constantsOptionShortName)
235 .addArgument(
236 storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of constants and their value, e.g. a=1,b=2,c=3.")
237 .setDefaultValueString("")
238 .build())
239 .build());
240 this->addOption(storm::settings::OptionBuilder(moduleName, janiPropertyOptionName, false,
241 "Specifies the properties from the jani model (given by --" + janiInputOptionName + ") to be checked.")
242 .setShortName(janiPropertyOptionShortName)
243 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of properties to be checked")
244 .setDefaultValueString("")
245 .makeOptional()
246 .build())
247 .build());
248 std::vector<std::string> steadyStateDistrAlgorithms({"auto", "eqsys", "evt", "classic"});
249 this->addOption(
250 storm::settings::OptionBuilder(moduleName, steadyStateDistrOptionName, false,
251 "Computes the steady state distribution. Result can be exported using --" + exportCheckResultOptionName + ".")
252 .addArgument(
253 storm::settings::ArgumentBuilder::createStringArgument("algorithm", "The used algorithm. 'auto' chooses according to accuracy requirements.")
254 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(steadyStateDistrAlgorithms))
255 .setDefaultValueString("auto")
256 .makeOptional()
257 .build())
258 .build());
259 this->addOption(storm::settings::OptionBuilder(moduleName, expectedVisitingTimesOptionName, false,
260 "Computes the expected number of times each state is visited (DTMC) or the expected time spend in each "
261 "state (CTMC). Result can be exported using --" +
262 exportCheckResultOptionName + ".")
263 .build());
264
265 this->addOption(storm::settings::OptionBuilder(moduleName, qvbsInputOptionName, false, "Selects a model from the Quantitative Verification Benchmark Set.")
266 .setShortName(qvbsInputOptionShortName)
267 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("model", "The short model name as in the benchmark set.").build())
268 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("instance-index", "The selected instance of this model.")
269 .setDefaultValueUnsignedInteger(0)
270 .makeOptional()
271 .build())
273 "filter", "The comma separated list of property names to check. Omit to check all, \"\" to check none.")
274 .setDefaultValueString("")
275 .makeOptional()
276 .build())
277 .build());
278
279 this->addOption(storm::settings::OptionBuilder(moduleName, propertiesAsMultiOptionName, false,
280 "If set, the selected properties are interpreted as a multi-objective formula.")
281 .setIsAdvanced()
282 .build());
283
284 std::vector<std::string> uncertaintyResolutionModes = {"minimize", "maximize", "robust", "cooperative", "min", "max"};
285 this->addOption(storm::settings::OptionBuilder(moduleName, uncertaintyResolutionModeName, false, "Mode to resolve the uncertainty (intervals)")
286 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "Mode to resolve the uncertainty (intervals) by nature.")
287 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(uncertaintyResolutionModes))
288 .build())
289 .build());
290
291#ifdef STORM_HAVE_QVBS
292 std::string qvbsRootDefault = STORM_QVBS_ROOT;
293#else
294 std::string qvbsRootDefault = "";
295#endif
296 this->addOption(storm::settings::OptionBuilder(moduleName, qvbsRootOptionName, false,
297 "Specifies the root directory of the Quantitative Verification Benchmark Set. Default can be set in CMAKE.")
298 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("path", "The path.").setDefaultValueString(qvbsRootDefault).build())
299 .build());
300}
301
303 return this->getOption(exportDotOptionName).getHasOptionBeenSet();
304}
305
307 return this->getOption(exportDotOptionName).getArgumentByName("filename").getValueAsString();
308}
309
311 return this->getOption(exportDotMaxWidthOptionName).getArgumentByName("width").getValueAsUnsignedInteger();
312}
313
315 return this->getOption(exportBuildOptionName).getHasOptionBeenSet();
316}
317
319 return this->getOption(exportBuildOptionName).getArgumentByName("file").getValueAsString();
320}
321
323 auto format = this->getOption(exportBuildOptionName).getArgumentByName("format").getValueAsString();
324 if (format == "auto") {
326 } else {
328 }
329}
330
332 return this->getOption(exportCompressionOptionName).getHasOptionBeenSet();
333}
334
336 auto mode = this->getOption(exportCompressionOptionName).getArgumentByName("mode").getValueAsString();
338}
339
341 return this->getOption(exportDigitsOptionName).getHasOptionBeenSet();
342}
343
344std::size_t IOSettings::getExportDigits() const {
345 return this->getOption(exportDigitsOptionName).getArgumentByName("num").getValueAsUnsignedInteger();
346}
347
349 return this->getOption(exportJaniDotOptionName).getHasOptionBeenSet();
350}
351
353 return this->getOption(exportJaniDotOptionName).getArgumentByName("filename").getValueAsString();
354}
355
357 return this->getOption(exportExplicitOptionName).getHasOptionBeenSet();
358}
359
361 return this->getOption(exportExplicitOptionName).getArgumentByName("filename").getValueAsString();
362}
363
365 return this->getOption(preventDRNPlaceholderOptionName).getHasOptionBeenSet();
366}
367
369 return this->getOption(exportDdOptionName).getHasOptionBeenSet();
370}
371
373 return this->getOption(exportDdOptionName).getArgumentByName("filename").getValueAsString();
374}
375
377 return this->getOption(exportCdfOptionName).getHasOptionBeenSet();
378}
379
381 std::string result = this->getOption(exportCdfOptionName).getArgumentByName("directory").getValueAsString();
382 if (result.back() != '/') {
383 result.push_back('/');
384 }
385 return result;
386}
387
389 return this->getOption(exportSchedulerOptionName).getHasOptionBeenSet();
390}
391
393 return this->getOption(exportSchedulerOptionName).getArgumentByName("filename").getValueAsString();
394}
395
397 return this->getOption(exportCheckResultOptionName).getHasOptionBeenSet();
398}
399
401 return this->getOption(exportCheckResultOptionName).getArgumentByName("filename").getValueAsString();
402}
403
405 return this->getOption(explicitOptionName).getHasOptionBeenSet();
406}
407
409 return this->getOption(explicitOptionName).getArgumentByName("transition filename").getValueAsString();
410}
411
413 return this->getOption(explicitOptionName).getArgumentByName("labeling filename").getValueAsString();
414}
415
417 return this->getOption(explicitDrnOptionName).getHasOptionBeenSet();
418}
419
421 return this->getOption(explicitDrnOptionName).getArgumentByName("drn filename").getValueAsString();
422}
423
425 return this->getOption(explicitUmbOptionName).getHasOptionBeenSet();
426}
427
429 return this->getOption(explicitUmbOptionName).getArgumentByName("umb location").getValueAsString();
430}
431
433 return this->getOption(explicitImcaOptionName).getHasOptionBeenSet();
434}
435
437 return this->getOption(explicitImcaOptionName).getArgumentByName("imca filename").getValueAsString();
438}
439
441 return this->getOption(prismInputOptionName).getHasOptionBeenSet();
442}
443
447
449 return this->getOption(prismToJaniOptionName).getHasOptionBeenSet();
450}
451
453 return this->getOption(prismInputOptionName).getArgumentByName("filename").getValueAsString();
454}
455
457 return this->getOption(janiInputOptionName).getHasOptionBeenSet();
458}
459
461 return this->getOption(janiInputOptionName).getArgumentByName("filename").getValueAsString();
462}
463
465 return this->getOption(transitionRewardsOptionName).getHasOptionBeenSet();
466}
467
469 return this->getOption(transitionRewardsOptionName).getArgumentByName("filename").getValueAsString();
470}
471
473 return this->getOption(stateRewardsOptionName).getHasOptionBeenSet();
474}
475
477 return this->getOption(stateRewardsOptionName).getArgumentByName("filename").getValueAsString();
478}
479
481 return this->getOption(choiceLabelingOptionName).getHasOptionBeenSet();
482}
483
485 return this->getOption(choiceLabelingOptionName).getArgumentByName("filename").getValueAsString();
486}
487
489 return this->getOption(constantsOptionName).getHasOptionBeenSet();
490}
491
493 return this->getOption(constantsOptionName).getArgumentByName("values").getValueAsString();
494}
495
497 return this->getOption(janiPropertyOptionName).getHasOptionBeenSet();
498}
499
501 return this->getOption(janiPropertyOptionName).getHasOptionBeenSet() &&
502 (this->getOption(janiPropertyOptionName).getArgumentByName("values").getValueAsString() != "");
503}
504
505std::vector<std::string> IOSettings::getSelectedJaniProperties() const {
506 return storm::parser::parseCommaSeperatedValues(this->getOption(janiPropertyOptionName).getArgumentByName("values").getValueAsString());
507}
508
510 return this->getOption(propertyOptionName).getHasOptionBeenSet();
511}
512
513std::string IOSettings::getProperty() const {
514 return this->getOption(propertyOptionName).getArgumentByName("property or filename").getValueAsString();
515}
516
517std::string IOSettings::getPropertyFilter() const {
518 return this->getOption(propertyOptionName).getArgumentByName("filter").getValueAsString();
519}
520
522 return this->getOption(steadyStateDistrOptionName).getHasOptionBeenSet();
523}
524
526 auto alg = this->getOption(steadyStateDistrOptionName).getArgumentByName("algorithm").getValueAsString();
527 if (alg == "auto") {
529 } else if (alg == "eqsys") {
531 } else if (alg == "classic") {
533 } else {
534 STORM_LOG_ASSERT(alg == "evt", "Unexpected algorithm type.");
536 }
537}
538
540 return this->getOption(expectedVisitingTimesOptionName).getHasOptionBeenSet();
541}
542
544 return this->getOption(qvbsInputOptionName).getHasOptionBeenSet();
545}
546
547std::string IOSettings::getQvbsModelName() const {
548 return this->getOption(qvbsInputOptionName).getArgumentByName("model").getValueAsString();
549}
550
552 return this->getOption(qvbsInputOptionName).getArgumentByName("instance-index").getValueAsUnsignedInteger();
553}
554
555boost::optional<std::vector<std::string>> IOSettings::getQvbsPropertyFilter() const {
556 std::string listAsString = this->getOption(qvbsInputOptionName).getArgumentByName("filter").getValueAsString();
557 if (listAsString == "") {
558 if (this->getOption(qvbsInputOptionName).getArgumentByName("filter").wasSetFromDefaultValue()) {
559 return boost::none;
560 } else {
561 return std::vector<std::string>();
562 }
563 } else {
564 return storm::parser::parseCommaSeperatedValues(listAsString);
565 }
566}
567
568std::string IOSettings::getQvbsRoot() const {
569 auto const& path = this->getOption(qvbsRootOptionName).getArgumentByName("path");
570#ifndef STORM_HAVE_QVBS
571 STORM_LOG_THROW(this->getOption(qvbsRootOptionName).getHasOptionBeenSet(), storm::exceptions::InvalidSettingsException,
572 "QVBS Root is not specified. Either use the --" + qvbsRootOptionName + " option or specify it within CMAKE.");
573#endif
574 return path.getValueAsString();
575}
576
578 return this->getOption(propertiesAsMultiOptionName).getHasOptionBeenSet();
579}
580
582 std::string uncertaintyResolutionModeString = this->getOption(uncertaintyResolutionModeName).getArgumentByName("mode").getValueAsString();
583
584 if (uncertaintyResolutionModeString == "minimize" || uncertaintyResolutionModeString == "min") {
585 return UncertaintyResolutionModeSetting::Minimize;
586 } else if (uncertaintyResolutionModeString == "maximize" || uncertaintyResolutionModeString == "max") {
587 return UncertaintyResolutionModeSetting::Maximize;
588 } else if (uncertaintyResolutionModeString == "robust") {
589 return UncertaintyResolutionModeSetting::Robust;
590 } else if (uncertaintyResolutionModeString == "cooperative") {
591 return UncertaintyResolutionModeSetting::Cooperative;
592 } else if (uncertaintyResolutionModeString == "both") {
593 STORM_LOG_ASSERT(false, "Uncertainty resolution mode 'both' not yet implemented.");
594 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Uncertainty resolution mode 'both' not yet implemented.");
595 }
596 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown nature resolution mode '" << uncertaintyResolutionModeString << "'.");
597}
598
600 return this->getOption(uncertaintyResolutionModeName).getHasOptionBeenSet();
601}
602
604 STORM_LOG_WARN_COND(!isExportDdSet(), "Option '--" << moduleName << ":" << exportDdOptionName << "' is depreciated. Use '--" << moduleName << ":"
605 << exportBuildOptionName << "' instead.");
606 STORM_LOG_WARN_COND(!isExportDotSet(), "Option '--" << moduleName << ":" << exportDotOptionName << "' is depreciated. Use '--" << moduleName << ":"
607 << exportBuildOptionName << "' instead.");
608 STORM_LOG_WARN_COND(!isExportExplicitSet(), "Option '--" << moduleName << ":" << exportExplicitOptionName << "' is depreciated. Use '--" << moduleName
609 << ":" << exportBuildOptionName << "' instead.");
610}
611
612bool IOSettings::check() const {
613 // Ensure that at most one symbolic input model is given.
614 uint64_t numSymbolicInputs = isJaniInputSet() ? 1 : 0;
615 numSymbolicInputs += isPrismInputSet() ? 1 : 0;
616 numSymbolicInputs += isQvbsInputSet() ? 1 : 0;
617 STORM_LOG_THROW(numSymbolicInputs <= 1, storm::exceptions::InvalidSettingsException, "Multiple symbolic input models.");
618 STORM_LOG_THROW(!isExportJaniDotSet() || isJaniInputSet() || isQvbsInputSet(), storm::exceptions::InvalidSettingsException,
619 "Jani-to-dot export is only available for jani models");
620
621 // Ensure that not two explicit input models were given.
622 uint64_t numExplicitInputs = isExplicitSet() ? 1 : 0;
623 numExplicitInputs += isExplicitDRNSet() ? 1 : 0;
624 numExplicitInputs += isExplicitIMCASet() ? 1 : 0;
625 STORM_LOG_THROW(numExplicitInputs <= 1, storm::exceptions::InvalidSettingsException, "Multiple explicit input models");
626
627 // Ensure that the model was given either symbolically or explicitly.
628 STORM_LOG_THROW(numSymbolicInputs + numExplicitInputs <= 1, storm::exceptions::InvalidSettingsException,
629 "The model may be either given in an explicit or a symbolic format (PRISM or JANI), but not both.");
630
631 // Make sure PRISM-to-JANI conversion is only set if the actual input is in PRISM format.
632 STORM_LOG_THROW(!isPrismToJaniSet() || isPrismInputSet(), storm::exceptions::InvalidSettingsException,
633 "For the transformation from PRISM to JANI, the input model must be given in the prism format.");
634
635 return true;
636}
637
638} // namespace modules
639} // namespace settings
640} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual uint_fast64_t getValueAsUnsignedInteger() const =0
Retrieves the value of this argument as an unsigned integer.
static ArgumentBuilder createUnsignedIntegerArgument(std::string const &name, std::string const &description)
Creates an unsigned integer argument with the given parameters.
static ArgumentBuilder createStringArgument(std::string const &name, std::string const &description)
Creates a string argument with the given parameters.
static std::shared_ptr< ArgumentValidator< std::string > > createMultipleChoiceValidator(std::vector< std::string > const &choices)
static std::shared_ptr< ArgumentValidator< std::string > > createExistingFileValidator()
This class provides the interface to create an option...
ArgumentBase const & getArgumentByName(std::string const &argumentName) const
Returns a reference to the argument with the specified long name.
Definition Option.cpp:79
bool getHasOptionBeenSet() const
Retrieves whether the option has been set.
Definition Option.cpp:125
bool isJaniPropertiesSet() const
Retrieves whether the jani-property option was set.
UncertaintyResolutionModeSetting getUncertaintyResolutionMode() const
Retrieves the mode deciding how the uncertainty should be resolved.
bool isExportExplicitSet() const
Retrieves whether the export-to-explicit option was set.
std::string getExportExplicitFilename() const
Retrieves the name in which to write the model in explicit format, if the option was set.
std::string getExportBuildFilename() const
Retrieves the name in which to write the model in json format, if export-to-json option was set.
bool isExportCdfSet() const
Retrieves whether the cumulative density function for reward bounded properties should be exported.
static const std::string moduleName
Definition IOSettings.h:431
std::string getExplicitIMCAFilename() const
Retrieves the name of the file that contains the model in the IMCA format.
bool areJaniPropertiesSelected() const
Retrieves whether one or more jani-properties have been selected.
std::string getExportJaniDotFilename() const
Retrieves the name in which to write the jani model in dot format, if the export-to-jani-dot option w...
bool isExportCheckResultSet() const
Retrieves whether the check result should be exported.
std::string getChoiceLabelingFilename() const
Retrieves the name of the file that contains the choice labeling if the model was given using the exp...
bool isStateRewardsSet() const
Retrieves whether the state reward option was set.
bool isExportDdSet() const
Retrieves whether the export-to-dd option was set.
std::string getExportSchedulerFilename() const
Retrieves a filename to which an optimal scheduler will be exported.
std::string getExportCdfDirectory() const
Retrieves a path to a directory in which the cdf files will be stored.
bool isPrismToJaniSet() const
Retrieves whether the option to convert PRISM to JANI input was set.
size_t getExportDotMaxWidth() const
Retrieves the maximal width for labels in the dot format.
std::string getProperty() const
Retrieves the property specified with the property option.
std::string getJaniInputFilename() const
Retrieves the name of the file that contains the JANI model specification if the model was given usin...
bool isExportDotSet() const
Retrieves whether the export-to-dot option was set.
bool isChoiceLabelingSet() const
Retrieves whether the choice labeling option was set.
bool isPrismOrJaniInputSet() const
Retrieves whether the JANI or PRISM input option was set.
std::string getPropertyFilter() const
Retrieves the property filter.
bool isExportBuildSet() const
Retrieves whether the exportbuild option was set.
std::string getPrismInputFilename() const
Retrieves the name of the file that contains the PRISM model specification if the model was given usi...
bool isQvbsInputSet() const
Retrieves whether the input model is to be read from the quantitative verification benchmark set (QVB...
bool isComputeSteadyStateDistributionSet() const
Retrieves whether the steady-state distribution is to be computed.
std::string getConstantDefinitionString() const
Retrieves the string that defines the constants of a symbolic model (given via the symbolic option).
bool isExplicitDRNSet() const
Retrieves whether the explicit option with DRN was set.
std::string getExplicitDRNFilename() const
Retrieves the name of the file that contains the model in the DRN format.
bool isExportDigitsSet() const
Retrieves whether the number of digits for exporting floating point numbers was set.
std::string getLabelingFilename() const
Retrieves the name of the file that contains the state labeling if the model was given using the expl...
void finalize() override
Prepares the modules for further usage, should be called at the end of the initialization,...
boost::optional< std::vector< std::string > > getQvbsPropertyFilter() const
Retrieves the selected property names.
bool isExportSchedulerSet() const
Retrieves whether an optimal scheduler is to be exported.
bool isConstantsSet() const
Retrieves whether the constants option was set.
std::string getStateRewardsFilename() const
Retrieves the name of the file that contains the state rewards if the model was given using the expli...
bool isExplicitUmbSet() const
Retrieves whether the explicit option with UMB was set.
std::string getTransitionRewardsFilename() const
Retrieves the name of the file that contains the transition rewards if the model was given using the ...
bool check() const override
Checks whether the settings are consistent.
bool isPropertySet() const
Retrieves whether the property option was set.
std::string getQvbsModelName() const
Retrieves the specified model (short-)name of the QVBS.
std::vector< std::string > getSelectedJaniProperties() const
storm::io::CompressionMode getCompressionMode() const
Retrieves the preferred compression mode.
IOSettings()
Creates a new set of IO settings.
std::string getExportCheckResultFilename() const
Retrieves a filename to which the check result should be exported.
storm::SteadyStateDistributionAlgorithm getSteadyStateDistributionAlgorithm() const
std::string getTransitionFilename() const
Retrieves the name of the file that contains the transitions if the model was given using the explici...
bool isJaniInputSet() const
Retrieves whether the JANI input option was set.
size_t getExportDigits() const
Retrieves the number of digits for exporting floating point numbers.
uint64_t getQvbsInstanceIndex() const
Retrieves the selected model instance (file + open parameters of the model).
bool isExplicitIMCASet() const
Retrieves whether the explicit option with IMCA was set.
bool isExplicitExportPlaceholdersDisabled() const
Retrieves whether we prevent the usage of placeholders in the explicit DRN format.
std::string getExportDotFilename() const
Retrieves the name in which to write the model in dot format, if the export-to-dot option was set.
storm::io::ModelExportFormat getExportBuildFormat() const
Retrieves the specified export format for the exportbuild option.
bool isPropertiesAsMultiSet() const
Retrieves whether the input properties are to be interpreted as a single multi-objective formula.
bool isCompressionSet() const
Retrieves whether a preferred compression mode has been set.
std::string getQvbsRoot() const
Retrieves the specified root directory of qvbs.
bool isPrismInputSet() const
Retrieves whether the PRISM language option was set.
bool isComputeExpectedVisitingTimesSet() const
Retrieves whether the expected visiting times are to be computed.
bool isTransitionRewardsSet() const
Retrieves whether the transition reward option was set.
std::string getExplicitUmbFilename() const
Retrieves the name of the file that contains the model in the UMB format.
bool isExplicitSet() const
Retrieves whether the explicit option was set.
std::string getExportDdFilename() const
Retrieves the name in which to write the model in dd format, if the option was set.
bool isExportJaniDotSet() const
Retrieves whether the export-to-dot option for jani was set.
ModuleSettings(std::string const &moduleName)
Constructs a new settings object.
void addOption(std::shared_ptr< Option > const &option)
Adds and registers the given option.
Option & getOption(std::string const &longName)
Retrieves the option with the given long name.
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:38
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
CompressionMode getCompressionModeFromString(std::string const &input)
ModelExportFormat getModelExportFormatFromString(std::string const &input)
ModelExportFormat getModelExportFormatFromFileExtension(std::string const &filename)
std::vector< std::string > parseCommaSeperatedValues(std::string const &input)
Given a string separated by commas, returns the values.
Definition CSVParser.cpp:11
std::string preventDRNPlaceholderOptionName
solver::UncertaintyResolutionModeSetting UncertaintyResolutionModeSetting