Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
IOSettings.cpp
Go to the documentation of this file.
2
10
14
15namespace storm {
16namespace settings {
17namespace modules {
18
19const std::string IOSettings::moduleName = "io";
20const std::string IOSettings::exportDotOptionName = "exportdot";
21const std::string IOSettings::exportDotMaxWidthOptionName = "dot-maxwidth";
22const std::string IOSettings::exportBuildOptionName = "exportbuild";
23const std::string IOSettings::exportExplicitOptionName = "exportexplicit";
24const std::string IOSettings::exportDdOptionName = "exportdd";
25const std::string IOSettings::exportJaniDotOptionName = "exportjanidot";
26const std::string IOSettings::exportCdfOptionName = "exportcdf";
27const std::string IOSettings::exportCdfOptionShortName = "cdf";
28const std::string IOSettings::exportSchedulerOptionName = "exportscheduler";
29const std::string IOSettings::exportCheckResultOptionName = "exportresult";
30const std::string IOSettings::exportCompressionOptionName = "compression";
31const std::string IOSettings::exportDigitsOptionName = "digits";
32const std::string IOSettings::explicitOptionName = "explicit";
33const std::string IOSettings::explicitOptionShortName = "exp";
34const std::string IOSettings::explicitDrnOptionName = "explicit-drn";
35const std::string IOSettings::explicitDrnOptionShortName = "drn";
36const std::string IOSettings::explicitUmbOptionName = "explicit-umb";
37const std::string IOSettings::explicitUmbOptionShortName = "umb";
38const std::string IOSettings::explicitImcaOptionName = "explicit-imca";
39const std::string IOSettings::explicitImcaOptionShortName = "imca";
40const std::string IOSettings::prismInputOptionName = "prism";
41const std::string IOSettings::janiInputOptionName = "jani";
42const std::string IOSettings::prismToJaniOptionName = "prism2jani";
43
44const std::string IOSettings::transitionRewardsOptionName = "transrew";
45const std::string IOSettings::stateRewardsOptionName = "staterew";
46const std::string IOSettings::choiceLabelingOptionName = "choicelab";
47const std::string IOSettings::constantsOptionName = "constants";
48const std::string IOSettings::constantsOptionShortName = "const";
49
50const std::string IOSettings::janiPropertyOptionName = "janiproperty";
51const std::string IOSettings::janiPropertyOptionShortName = "jprop";
52const std::string IOSettings::propertyOptionName = "prop";
53const std::string IOSettings::propertyOptionShortName = "prop";
54const std::string IOSettings::steadyStateDistrOptionName = "steadystate";
55const std::string IOSettings::expectedVisitingTimesOptionName = "expvisittimes";
56
57const std::string IOSettings::qvbsInputOptionName = "qvbs";
58const std::string IOSettings::qvbsInputOptionShortName = "qvbs";
59const std::string IOSettings::qvbsRootOptionName = "qvbsroot";
60const std::string IOSettings::propertiesAsMultiOptionName = "propsasmulti";
61
62const std::string IOSettings::uncertaintyResolutionModeName = "uncertainty-resolution";
63
64const std::string preventDRNPlaceholderOptionName = "no-drn-placeholders";
65
67 this->addOption(
68 storm::settings::OptionBuilder(moduleName, exportDotOptionName, false,
69 "If given, the loaded model will be written to the specified file in the dot format.")
70 .setIsAdvanced()
71 .addArgument(
72 storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file to which the model is to be written.").build())
73 .build());
75 moduleName, exportDotMaxWidthOptionName, false,
76 "The maximal width for labels in the dot format. For longer lines a linebreak is inserted. Value 0 represents no linebreaks.")
77 .setIsAdvanced()
79 "width", "The maximal line width for the dot format. Default is 0 meaning no linebreaks.")
80 .setDefaultValueUnsignedInteger(0)
81 .build())
82 .build());
83 std::vector<std::string> exportFormats({"auto", "dot", "drdd", "drn", "json", "umb"});
84 this->addOption(
85 storm::settings::OptionBuilder(moduleName, exportBuildOptionName, false, "Exports the built model to a file.")
86 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("file", "The output file.").build())
87 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("format", "The output format. 'auto' detects from the file extension.")
88 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(exportFormats))
89 .setDefaultValueString("auto")
90 .makeOptional()
91 .build())
92 .build());
93
94 std::vector<std::string> compressionModes({"default", "none", "gzip", "xz"});
95 this->addOption(storm::settings::OptionBuilder(moduleName, exportCompressionOptionName, false, "Configures compression of exported files (if supported).")
96 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "The preferred compression mode.")
97 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(compressionModes))
98 .setDefaultValueString("default")
99 .build())
100 .build());
101
102 this->addOption(storm::settings::OptionBuilder(moduleName, exportDigitsOptionName, false, "Sets number of output digits of export (if supported).")
103 .setIsAdvanced()
104 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("num", "Number of digits.").build())
105 .build());
106
107 this->addOption(
108 storm::settings::OptionBuilder(moduleName, exportJaniDotOptionName, false,
109 "If given, the loaded jani model will be written to the specified file in the dot format.")
110 .setIsAdvanced()
111 .addArgument(
112 storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file to which the model is to be written.").build())
113 .build());
114 this->addOption(storm::settings::OptionBuilder(moduleName, exportCdfOptionName, false,
115 "Exports the cumulative density function for reward bounded properties into a .csv file.")
116 .setIsAdvanced()
117 .setShortName(exportCdfOptionShortName)
119 "directory", "A path to an existing directory where the cdf files will be stored.")
120 .build())
121 .build());
122 this->addOption(
123 storm::settings::OptionBuilder(moduleName, exportSchedulerOptionName, false,
124 "Exports the choices of an optimal scheduler to the given file (if supported by engine).")
125 .setIsAdvanced()
126 .addArgument(
127 storm::settings::ArgumentBuilder::createStringArgument("filename", "The output file. Use file extension '.json' to export in json.").build())
128 .build());
129 this->addOption(storm::settings::OptionBuilder(moduleName, exportCheckResultOptionName, false,
130 "Exports the result to a given file (if supported by engine). The export will be in json.")
131 .setIsAdvanced()
132 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The output file.").build())
133 .build());
134 this->addOption(
135 storm::settings::OptionBuilder(moduleName, exportExplicitOptionName, false,
136 "If given, the loaded model will be written to the specified file in the drn format.")
137 .setIsAdvanced()
138 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the file to which the model is to be writen.").build())
139 .build());
140 this->addOption(storm::settings::OptionBuilder(moduleName, preventDRNPlaceholderOptionName, true, "If given, the exported DRN contains no placeholders")
141 .setIsAdvanced()
142 .build());
143 this->addOption(
144 storm::settings::OptionBuilder(moduleName, exportDdOptionName, false,
145 "If given, the loaded model will be written to the specified file in the drdd format.")
146 .setIsAdvanced()
147 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the file to which the model is to be writen.").build())
148 .build());
149 this->addOption(storm::settings::OptionBuilder(moduleName, explicitOptionName, false, "Parses the model given in an explicit (sparse) representation.")
150 .setShortName(explicitOptionShortName)
151 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("transition filename",
152 "The name of the file from which to read the transitions.")
154 .build())
155 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("labeling filename",
156 "The name of the file from which to read the state labeling.")
158 .build())
159 .build());
160 this->addOption(
161 storm::settings::OptionBuilder(moduleName, explicitUmbOptionName, false, "Parses the model given in the UMB format. The file can be compressed.")
162 .setShortName(explicitUmbOptionShortName)
163 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("umb location", "The location of the umb encoding.").build())
164 .build());
165 this->addOption(storm::settings::OptionBuilder(moduleName, explicitDrnOptionName, false, "Parses the model given in the DRN format.")
166 .setShortName(explicitDrnOptionShortName)
167 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("drn filename", "The name of the DRN file containing the model.")
169 .build())
170 .build());
171 this->addOption(storm::settings::OptionBuilder(moduleName, explicitImcaOptionName, false, "Parses the model given in the IMCA format.")
172 .setShortName(explicitImcaOptionShortName)
173 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("imca filename", "The name of the imca file containing the model.")
175 .build())
176 .build());
177 this->addOption(
178 storm::settings::OptionBuilder(moduleName, prismInputOptionName, false, "Parses the model given in the PRISM format.")
179 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the PRISM input.")
181 .build())
182 .build());
183 this->addOption(
184 storm::settings::OptionBuilder(moduleName, janiInputOptionName, false, "Parses the model given in the JANI format.")
185 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the JANI input.")
187 .build())
188 .build());
189 this->addOption(storm::settings::OptionBuilder(moduleName, prismToJaniOptionName, false, "If set, the input PRISM model is transformed to JANI.")
190 .setIsAdvanced()
191 .build());
192 this->addOption(
193 storm::settings::OptionBuilder(moduleName, propertyOptionName, false, "Specifies the properties to be checked on the model.")
194 .setShortName(propertyOptionShortName)
195 .addArgument(
196 storm::settings::ArgumentBuilder::createStringArgument("property or filename", "The formula or the file containing the formulas.").build())
197 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filter", "The names of the properties to check.")
198 .setDefaultValueString("all")
199 .makeOptional()
200 .build())
201 .build());
202
203 this->addOption(storm::settings::OptionBuilder(moduleName, transitionRewardsOptionName, false,
204 "If given, the transition rewards are read from this file and added to the explicit model. Note that this "
205 "requires the model to be given as an explicit model (i.e., via --" +
206 explicitOptionName + ").")
207 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the transition rewards.")
209 .build())
210 .build());
211 this->addOption(storm::settings::OptionBuilder(moduleName, stateRewardsOptionName, false,
212 "If given, the state rewards are read from this file and added to the explicit model. Note that this "
213 "requires the model to be given as an explicit model (i.e., via --" +
214 explicitOptionName + ").")
215 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the state rewards.")
217 .build())
218 .build());
219 this->addOption(storm::settings::OptionBuilder(moduleName, choiceLabelingOptionName, false,
220 "If given, the choice labels are read from this file and added to the explicit model. Note that this "
221 "requires the model to be given as an explicit model (i.e., via --" +
222 explicitOptionName + ").")
223 .setIsAdvanced()
224 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the choice labels.")
226 .build())
227 .build());
228 this->addOption(
230 moduleName, constantsOptionName, false,
231 "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 --" +
232 prismInputOptionName + " or --" + janiInputOptionName + ").")
233 .setShortName(constantsOptionShortName)
234 .addArgument(
235 storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of constants and their value, e.g. a=1,b=2,c=3.")
236 .setDefaultValueString("")
237 .build())
238 .build());
239 this->addOption(storm::settings::OptionBuilder(moduleName, janiPropertyOptionName, false,
240 "Specifies the properties from the jani model (given by --" + janiInputOptionName + ") to be checked.")
241 .setShortName(janiPropertyOptionShortName)
242 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of properties to be checked")
243 .setDefaultValueString("")
244 .makeOptional()
245 .build())
246 .build());
247 std::vector<std::string> steadyStateDistrAlgorithms({"auto", "eqsys", "evt", "classic"});
248 this->addOption(
249 storm::settings::OptionBuilder(moduleName, steadyStateDistrOptionName, false,
250 "Computes the steady state distribution. Result can be exported using --" + exportCheckResultOptionName + ".")
251 .addArgument(
252 storm::settings::ArgumentBuilder::createStringArgument("algorithm", "The used algorithm. 'auto' chooses according to accuracy requirements.")
253 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(steadyStateDistrAlgorithms))
254 .setDefaultValueString("auto")
255 .makeOptional()
256 .build())
257 .build());
258 this->addOption(storm::settings::OptionBuilder(moduleName, expectedVisitingTimesOptionName, false,
259 "Computes the expected number of times each state is visited (DTMC) or the expected time spend in each "
260 "state (CTMC). Result can be exported using --" +
261 exportCheckResultOptionName + ".")
262 .build());
263
264 this->addOption(storm::settings::OptionBuilder(moduleName, qvbsInputOptionName, false, "Selects a model from the Quantitative Verification Benchmark Set.")
265 .setShortName(qvbsInputOptionShortName)
266 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("model", "The short model name as in the benchmark set.").build())
267 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("instance-index", "The selected instance of this model.")
268 .setDefaultValueUnsignedInteger(0)
269 .makeOptional()
270 .build())
272 "filter", "The comma separated list of property names to check. Omit to check all, \"\" to check none.")
273 .setDefaultValueString("")
274 .makeOptional()
275 .build())
276 .build());
277
278 this->addOption(storm::settings::OptionBuilder(moduleName, propertiesAsMultiOptionName, false,
279 "If set, the selected properties are interpreted as a multi-objective formula.")
280 .setIsAdvanced()
281 .build());
282
283 std::vector<std::string> uncertaintyResolutionModes = {"minimize", "maximize", "robust", "cooperative", "min", "max"};
284 this->addOption(storm::settings::OptionBuilder(moduleName, uncertaintyResolutionModeName, false, "Mode to resolve the uncertainty (intervals)")
285 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "Mode to resolve the uncertainty (intervals) by nature.")
286 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(uncertaintyResolutionModes))
287 .build())
288 .build());
289
290#ifdef STORM_HAVE_QVBS
291 std::string qvbsRootDefault = STORM_QVBS_ROOT;
292#else
293 std::string qvbsRootDefault = "";
294#endif
295 this->addOption(storm::settings::OptionBuilder(moduleName, qvbsRootOptionName, false,
296 "Specifies the root directory of the Quantitative Verification Benchmark Set. Default can be set in CMAKE.")
297 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("path", "The path.").setDefaultValueString(qvbsRootDefault).build())
298 .build());
299}
300
302 return this->getOption(exportDotOptionName).getHasOptionBeenSet();
303}
304
306 return this->getOption(exportDotOptionName).getArgumentByName("filename").getValueAsString();
307}
308
310 return this->getOption(exportDotMaxWidthOptionName).getArgumentByName("width").getValueAsUnsignedInteger();
311}
312
314 return this->getOption(exportBuildOptionName).getHasOptionBeenSet();
315}
316
318 return this->getOption(exportBuildOptionName).getArgumentByName("file").getValueAsString();
319}
320
322 auto format = this->getOption(exportBuildOptionName).getArgumentByName("format").getValueAsString();
323 if (format == "auto") {
325 } else {
327 }
328}
329
331 return this->getOption(exportCompressionOptionName).getHasOptionBeenSet();
332}
333
335 auto mode = this->getOption(exportCompressionOptionName).getArgumentByName("mode").getValueAsString();
337}
338
340 return this->getOption(exportDigitsOptionName).getHasOptionBeenSet();
341}
342
343std::size_t IOSettings::getExportDigits() const {
344 return this->getOption(exportDigitsOptionName).getArgumentByName("num").getValueAsUnsignedInteger();
345}
346
348 return this->getOption(exportJaniDotOptionName).getHasOptionBeenSet();
349}
350
352 return this->getOption(exportJaniDotOptionName).getArgumentByName("filename").getValueAsString();
353}
354
356 return this->getOption(exportExplicitOptionName).getHasOptionBeenSet();
357}
358
360 return this->getOption(exportExplicitOptionName).getArgumentByName("filename").getValueAsString();
361}
362
364 return this->getOption(preventDRNPlaceholderOptionName).getHasOptionBeenSet();
365}
366
368 return this->getOption(exportDdOptionName).getHasOptionBeenSet();
369}
370
372 return this->getOption(exportDdOptionName).getArgumentByName("filename").getValueAsString();
373}
374
376 return this->getOption(exportCdfOptionName).getHasOptionBeenSet();
377}
378
380 std::string result = this->getOption(exportCdfOptionName).getArgumentByName("directory").getValueAsString();
381 if (result.back() != '/') {
382 result.push_back('/');
383 }
384 return result;
385}
386
388 return this->getOption(exportSchedulerOptionName).getHasOptionBeenSet();
389}
390
392 return this->getOption(exportSchedulerOptionName).getArgumentByName("filename").getValueAsString();
393}
394
396 return this->getOption(exportCheckResultOptionName).getHasOptionBeenSet();
397}
398
400 return this->getOption(exportCheckResultOptionName).getArgumentByName("filename").getValueAsString();
401}
402
404 return this->getOption(explicitOptionName).getHasOptionBeenSet();
405}
406
408 return this->getOption(explicitOptionName).getArgumentByName("transition filename").getValueAsString();
409}
410
412 return this->getOption(explicitOptionName).getArgumentByName("labeling filename").getValueAsString();
413}
414
416 return this->getOption(explicitDrnOptionName).getHasOptionBeenSet();
417}
418
420 return this->getOption(explicitDrnOptionName).getArgumentByName("drn filename").getValueAsString();
421}
422
424 return this->getOption(explicitUmbOptionName).getHasOptionBeenSet();
425}
426
428 return this->getOption(explicitUmbOptionName).getArgumentByName("umb location").getValueAsString();
429}
430
432 return this->getOption(explicitImcaOptionName).getHasOptionBeenSet();
433}
434
436 return this->getOption(explicitImcaOptionName).getArgumentByName("imca filename").getValueAsString();
437}
438
440 return this->getOption(prismInputOptionName).getHasOptionBeenSet();
441}
442
446
448 return this->getOption(prismToJaniOptionName).getHasOptionBeenSet();
449}
450
452 return this->getOption(prismInputOptionName).getArgumentByName("filename").getValueAsString();
453}
454
456 return this->getOption(janiInputOptionName).getHasOptionBeenSet();
457}
458
460 return this->getOption(janiInputOptionName).getArgumentByName("filename").getValueAsString();
461}
462
464 return this->getOption(transitionRewardsOptionName).getHasOptionBeenSet();
465}
466
468 return this->getOption(transitionRewardsOptionName).getArgumentByName("filename").getValueAsString();
469}
470
472 return this->getOption(stateRewardsOptionName).getHasOptionBeenSet();
473}
474
476 return this->getOption(stateRewardsOptionName).getArgumentByName("filename").getValueAsString();
477}
478
480 return this->getOption(choiceLabelingOptionName).getHasOptionBeenSet();
481}
482
484 return this->getOption(choiceLabelingOptionName).getArgumentByName("filename").getValueAsString();
485}
486
488 return this->getOption(constantsOptionName).getHasOptionBeenSet();
489}
490
492 return this->getOption(constantsOptionName).getArgumentByName("values").getValueAsString();
493}
494
496 return this->getOption(janiPropertyOptionName).getHasOptionBeenSet();
497}
498
500 return this->getOption(janiPropertyOptionName).getHasOptionBeenSet() &&
501 (this->getOption(janiPropertyOptionName).getArgumentByName("values").getValueAsString() != "");
502}
503
504std::vector<std::string> IOSettings::getSelectedJaniProperties() const {
505 return storm::parser::parseCommaSeperatedValues(this->getOption(janiPropertyOptionName).getArgumentByName("values").getValueAsString());
506}
507
509 return this->getOption(propertyOptionName).getHasOptionBeenSet();
510}
511
512std::string IOSettings::getProperty() const {
513 return this->getOption(propertyOptionName).getArgumentByName("property or filename").getValueAsString();
514}
515
516std::string IOSettings::getPropertyFilter() const {
517 return this->getOption(propertyOptionName).getArgumentByName("filter").getValueAsString();
518}
519
521 return this->getOption(steadyStateDistrOptionName).getHasOptionBeenSet();
522}
523
525 auto alg = this->getOption(steadyStateDistrOptionName).getArgumentByName("algorithm").getValueAsString();
526 if (alg == "auto") {
528 } else if (alg == "eqsys") {
530 } else if (alg == "classic") {
532 } else {
533 STORM_LOG_ASSERT(alg == "evt", "Unexpected algorithm type.");
535 }
536}
537
539 return this->getOption(expectedVisitingTimesOptionName).getHasOptionBeenSet();
540}
541
543 return this->getOption(qvbsInputOptionName).getHasOptionBeenSet();
544}
545
546std::string IOSettings::getQvbsModelName() const {
547 return this->getOption(qvbsInputOptionName).getArgumentByName("model").getValueAsString();
548}
549
551 return this->getOption(qvbsInputOptionName).getArgumentByName("instance-index").getValueAsUnsignedInteger();
552}
553
554boost::optional<std::vector<std::string>> IOSettings::getQvbsPropertyFilter() const {
555 std::string listAsString = this->getOption(qvbsInputOptionName).getArgumentByName("filter").getValueAsString();
556 if (listAsString == "") {
557 if (this->getOption(qvbsInputOptionName).getArgumentByName("filter").wasSetFromDefaultValue()) {
558 return boost::none;
559 } else {
560 return std::vector<std::string>();
561 }
562 } else {
563 return storm::parser::parseCommaSeperatedValues(listAsString);
564 }
565}
566
567std::string IOSettings::getQvbsRoot() const {
568 auto const& path = this->getOption(qvbsRootOptionName).getArgumentByName("path");
569#ifndef STORM_HAVE_QVBS
570 STORM_LOG_THROW(this->getOption(qvbsRootOptionName).getHasOptionBeenSet(), storm::exceptions::InvalidSettingsException,
571 "QVBS Root is not specified. Either use the --" + qvbsRootOptionName + " option or specify it within CMAKE.");
572#endif
573 return path.getValueAsString();
574}
575
577 return this->getOption(propertiesAsMultiOptionName).getHasOptionBeenSet();
578}
579
581 std::string uncertaintyResolutionModeString = this->getOption(uncertaintyResolutionModeName).getArgumentByName("mode").getValueAsString();
582
583 if (uncertaintyResolutionModeString == "minimize" || uncertaintyResolutionModeString == "min") {
584 return UncertaintyResolutionModeSetting::Minimize;
585 } else if (uncertaintyResolutionModeString == "maximize" || uncertaintyResolutionModeString == "max") {
586 return UncertaintyResolutionModeSetting::Maximize;
587 } else if (uncertaintyResolutionModeString == "robust") {
588 return UncertaintyResolutionModeSetting::Robust;
589 } else if (uncertaintyResolutionModeString == "cooperative") {
590 return UncertaintyResolutionModeSetting::Cooperative;
591 } else if (uncertaintyResolutionModeString == "both") {
592 STORM_LOG_ASSERT(false, "Uncertainty resolution mode 'both' not yet implemented.");
593 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Uncertainty resolution mode 'both' not yet implemented.");
594 }
595 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown nature resolution mode '" << uncertaintyResolutionModeString << "'.");
596}
597
599 return this->getOption(uncertaintyResolutionModeName).getHasOptionBeenSet();
600}
601
603 STORM_LOG_WARN_COND(!isExportDdSet(), "Option '--" << moduleName << ":" << exportDdOptionName << "' is depreciated. Use '--" << moduleName << ":"
604 << exportBuildOptionName << "' instead.");
605 STORM_LOG_WARN_COND(!isExportDotSet(), "Option '--" << moduleName << ":" << exportDotOptionName << "' is depreciated. Use '--" << moduleName << ":"
606 << exportBuildOptionName << "' instead.");
607 STORM_LOG_WARN_COND(!isExportExplicitSet(), "Option '--" << moduleName << ":" << exportExplicitOptionName << "' is depreciated. Use '--" << moduleName
608 << ":" << exportBuildOptionName << "' instead.");
609}
610
611bool IOSettings::check() const {
612 // Ensure that at most one symbolic input model is given.
613 uint64_t numSymbolicInputs = isJaniInputSet() ? 1 : 0;
614 numSymbolicInputs += isPrismInputSet() ? 1 : 0;
615 numSymbolicInputs += isQvbsInputSet() ? 1 : 0;
616 STORM_LOG_THROW(numSymbolicInputs <= 1, storm::exceptions::InvalidSettingsException, "Multiple symbolic input models.");
617 STORM_LOG_THROW(!isExportJaniDotSet() || isJaniInputSet() || isQvbsInputSet(), storm::exceptions::InvalidSettingsException,
618 "Jani-to-dot export is only available for jani models.");
619
620 // Ensure that not two explicit input models were given.
621 uint64_t numExplicitInputs = isExplicitSet() ? 1 : 0;
622 numExplicitInputs += isExplicitDRNSet() ? 1 : 0;
623 numExplicitInputs += isExplicitIMCASet() ? 1 : 0;
624 STORM_LOG_THROW(numExplicitInputs <= 1, storm::exceptions::InvalidSettingsException, "Multiple explicit input models.");
625
626 // Ensure that the model was given either symbolically or explicitly.
627 STORM_LOG_THROW(numSymbolicInputs + numExplicitInputs <= 1, storm::exceptions::InvalidSettingsException,
628 "The model may be either given in an explicit or a symbolic format (PRISM or JANI), but not both.");
629
630 // Make sure PRISM-to-JANI conversion is only set if the actual input is in PRISM format.
631 STORM_LOG_THROW(!isPrismToJaniSet() || isPrismInputSet(), storm::exceptions::InvalidSettingsException,
632 "For the transformation from PRISM to JANI, the input model must be given in the prism format.");
633
634 return true;
635}
636
637} // namespace modules
638} // namespace settings
639} // 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:430
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:9
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:36
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:28
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
const std::string preventDRNPlaceholderOptionName
solver::UncertaintyResolutionModeSetting UncertaintyResolutionModeSetting