Storm 1.11.1.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::explicitImcaOptionName = "explicit-imca";
38const std::string IOSettings::explicitImcaOptionShortName = "imca";
39const std::string IOSettings::prismInputOptionName = "prism";
40const std::string IOSettings::janiInputOptionName = "jani";
41const std::string IOSettings::prismToJaniOptionName = "prism2jani";
42
43const std::string IOSettings::transitionRewardsOptionName = "transrew";
44const std::string IOSettings::stateRewardsOptionName = "staterew";
45const std::string IOSettings::choiceLabelingOptionName = "choicelab";
46const std::string IOSettings::constantsOptionName = "constants";
47const std::string IOSettings::constantsOptionShortName = "const";
48
49const std::string IOSettings::janiPropertyOptionName = "janiproperty";
50const std::string IOSettings::janiPropertyOptionShortName = "jprop";
51const std::string IOSettings::propertyOptionName = "prop";
52const std::string IOSettings::propertyOptionShortName = "prop";
53const std::string IOSettings::steadyStateDistrOptionName = "steadystate";
54const std::string IOSettings::expectedVisitingTimesOptionName = "expvisittimes";
55
56const std::string IOSettings::qvbsInputOptionName = "qvbs";
57const std::string IOSettings::qvbsInputOptionShortName = "qvbs";
58const std::string IOSettings::qvbsRootOptionName = "qvbsroot";
59const std::string IOSettings::propertiesAsMultiOptionName = "propsasmulti";
60
61const std::string IOSettings::uncertaintyResolutionModeName = "uncertainty-resolution";
62
63std::string preventDRNPlaceholderOptionName = "no-drn-placeholders";
64
66 this->addOption(
67 storm::settings::OptionBuilder(moduleName, exportDotOptionName, false,
68 "If given, the loaded model will be written to the specified file in the dot format.")
69 .setIsAdvanced()
70 .addArgument(
71 storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file to which the model is to be written.").build())
72 .build());
74 moduleName, exportDotMaxWidthOptionName, false,
75 "The maximal width for labels in the dot format. For longer lines a linebreak is inserted. Value 0 represents no linebreaks.")
76 .setIsAdvanced()
78 "width", "The maximal line width for the dot format. Default is 0 meaning no linebreaks.")
79 .setDefaultValueUnsignedInteger(0)
80 .build())
81 .build());
82 std::vector<std::string> exportFormats({"auto", "dot", "drdd", "drn", "json"});
83 this->addOption(
84 storm::settings::OptionBuilder(moduleName, exportBuildOptionName, false, "Exports the built model to a file.")
85 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("file", "The output file.").build())
86 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("format", "The output format. 'auto' detects from the file extension.")
87 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(exportFormats))
88 .setDefaultValueString("auto")
89 .makeOptional()
90 .build())
91 .build());
92
93 std::vector<std::string> compressionModes({"default", "none", "gzip", "xz"});
94 this->addOption(storm::settings::OptionBuilder(moduleName, exportCompressionOptionName, false, "Configures compression of exported files (if supported).")
95 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "The preferred compression mode.")
96 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(compressionModes))
97 .setDefaultValueString("default")
98 .build())
99 .build());
100
101 this->addOption(storm::settings::OptionBuilder(moduleName, exportDigitsOptionName, false, "Sets number of output digits of export (if supported).")
102 .setIsAdvanced()
103 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("num", "Number of digits.").build())
104 .build());
105
106 this->addOption(
107 storm::settings::OptionBuilder(moduleName, exportJaniDotOptionName, false,
108 "If given, the loaded jani model will be written to the specified file in the dot format.")
109 .setIsAdvanced()
110 .addArgument(
111 storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file to which the model is to be written.").build())
112 .build());
113 this->addOption(storm::settings::OptionBuilder(moduleName, exportCdfOptionName, false,
114 "Exports the cumulative density function for reward bounded properties into a .csv file.")
115 .setIsAdvanced()
116 .setShortName(exportCdfOptionShortName)
118 "directory", "A path to an existing directory where the cdf files will be stored.")
119 .build())
120 .build());
121 this->addOption(
122 storm::settings::OptionBuilder(moduleName, exportSchedulerOptionName, false,
123 "Exports the choices of an optimal scheduler to the given file (if supported by engine).")
124 .setIsAdvanced()
125 .addArgument(
126 storm::settings::ArgumentBuilder::createStringArgument("filename", "The output file. Use file extension '.json' to export in json.").build())
127 .build());
128 this->addOption(storm::settings::OptionBuilder(moduleName, exportCheckResultOptionName, false,
129 "Exports the result to a given file (if supported by engine). The export will be in json.")
130 .setIsAdvanced()
131 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The output file.").build())
132 .build());
133 this->addOption(
134 storm::settings::OptionBuilder(moduleName, exportExplicitOptionName, "",
135 "If given, the loaded model will be written to the specified file in the drn format.")
136 .setIsAdvanced()
137 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the file to which the model is to be writen.").build())
138 .build());
139 this->addOption(storm::settings::OptionBuilder(moduleName, preventDRNPlaceholderOptionName, true, "If given, the exported DRN contains no placeholders")
140 .setIsAdvanced()
141 .build());
142 this->addOption(
143 storm::settings::OptionBuilder(moduleName, exportDdOptionName, "",
144 "If given, the loaded model will be written to the specified file in the drdd format.")
145 .setIsAdvanced()
146 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "the name of the file to which the model is to be writen.").build())
147 .build());
148 this->addOption(storm::settings::OptionBuilder(moduleName, explicitOptionName, false, "Parses the model given in an explicit (sparse) representation.")
149 .setShortName(explicitOptionShortName)
150 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("transition filename",
151 "The name of the file from which to read the transitions.")
153 .build())
154 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("labeling filename",
155 "The name of the file from which to read the state labeling.")
157 .build())
158 .build());
159 this->addOption(storm::settings::OptionBuilder(moduleName, explicitDrnOptionName, false, "Parses the model given in the DRN format.")
160 .setShortName(explicitDrnOptionShortName)
161 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("drn filename", "The name of the DRN file containing the model.")
163 .build())
164 .build());
165 this->addOption(storm::settings::OptionBuilder(moduleName, explicitImcaOptionName, false, "Parses the model given in the IMCA format.")
166 .setShortName(explicitImcaOptionShortName)
167 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("imca filename", "The name of the imca file containing the model.")
169 .build())
170 .build());
171 this->addOption(
172 storm::settings::OptionBuilder(moduleName, prismInputOptionName, false, "Parses the model given in the PRISM format.")
173 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the PRISM input.")
175 .build())
176 .build());
177 this->addOption(
178 storm::settings::OptionBuilder(moduleName, janiInputOptionName, false, "Parses the model given in the JANI format.")
179 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The name of the file from which to read the JANI input.")
181 .build())
182 .build());
183 this->addOption(storm::settings::OptionBuilder(moduleName, prismToJaniOptionName, false, "If set, the input PRISM model is transformed to JANI.")
184 .setIsAdvanced()
185 .build());
186 this->addOption(
187 storm::settings::OptionBuilder(moduleName, propertyOptionName, false, "Specifies the properties to be checked on the model.")
188 .setShortName(propertyOptionShortName)
189 .addArgument(
190 storm::settings::ArgumentBuilder::createStringArgument("property or filename", "The formula or the file containing the formulas.").build())
191 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filter", "The names of the properties to check.")
192 .setDefaultValueString("all")
193 .makeOptional()
194 .build())
195 .build());
196
197 this->addOption(storm::settings::OptionBuilder(moduleName, transitionRewardsOptionName, false,
198 "If given, the transition rewards are read from this file and added to the explicit model. Note that this "
199 "requires the model to be given as an explicit model (i.e., via --" +
200 explicitOptionName + ").")
201 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the transition rewards.")
203 .build())
204 .build());
205 this->addOption(storm::settings::OptionBuilder(moduleName, stateRewardsOptionName, false,
206 "If given, the state rewards are read from this file and added to the explicit model. Note that this "
207 "requires the model to be given as an explicit model (i.e., via --" +
208 explicitOptionName + ").")
209 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the state rewards.")
211 .build())
212 .build());
213 this->addOption(storm::settings::OptionBuilder(moduleName, choiceLabelingOptionName, false,
214 "If given, the choice labels are read from this file and added to the explicit model. Note that this "
215 "requires the model to be given as an explicit model (i.e., via --" +
216 explicitOptionName + ").")
217 .setIsAdvanced()
218 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "The file from which to read the choice labels.")
220 .build())
221 .build());
222 this->addOption(
224 moduleName, constantsOptionName, false,
225 "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 --" +
226 prismInputOptionName + " or --" + janiInputOptionName + ").")
227 .setShortName(constantsOptionShortName)
228 .addArgument(
229 storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of constants and their value, e.g. a=1,b=2,c=3.")
230 .setDefaultValueString("")
231 .build())
232 .build());
233 this->addOption(storm::settings::OptionBuilder(moduleName, janiPropertyOptionName, false,
234 "Specifies the properties from the jani model (given by --" + janiInputOptionName + ") to be checked.")
235 .setShortName(janiPropertyOptionShortName)
236 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("values", "A comma separated list of properties to be checked")
237 .setDefaultValueString("")
238 .makeOptional()
239 .build())
240 .build());
241 std::vector<std::string> steadyStateDistrAlgorithms({"auto", "eqsys", "evt", "classic"});
242 this->addOption(
243 storm::settings::OptionBuilder(moduleName, steadyStateDistrOptionName, false,
244 "Computes the steady state distribution. Result can be exported using --" + exportCheckResultOptionName + ".")
245 .addArgument(
246 storm::settings::ArgumentBuilder::createStringArgument("algorithm", "The used algorithm. 'auto' chooses according to accuracy requirements.")
247 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(steadyStateDistrAlgorithms))
248 .setDefaultValueString("auto")
249 .makeOptional()
250 .build())
251 .build());
252 this->addOption(storm::settings::OptionBuilder(moduleName, expectedVisitingTimesOptionName, false,
253 "Computes the expected number of times each state is visited (DTMC) or the expected time spend in each "
254 "state (CTMC). Result can be exported using --" +
255 exportCheckResultOptionName + ".")
256 .build());
257
258 this->addOption(storm::settings::OptionBuilder(moduleName, qvbsInputOptionName, false, "Selects a model from the Quantitative Verification Benchmark Set.")
259 .setShortName(qvbsInputOptionShortName)
260 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("model", "The short model name as in the benchmark set.").build())
261 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("instance-index", "The selected instance of this model.")
262 .setDefaultValueUnsignedInteger(0)
263 .makeOptional()
264 .build())
266 "filter", "The comma separated list of property names to check. Omit to check all, \"\" to check none.")
267 .setDefaultValueString("")
268 .makeOptional()
269 .build())
270 .build());
271
272 this->addOption(storm::settings::OptionBuilder(moduleName, propertiesAsMultiOptionName, false,
273 "If set, the selected properties are interpreted as a multi-objective formula.")
274 .setIsAdvanced()
275 .build());
276
277 std::vector<std::string> uncertaintyResolutionModes = {"minimize", "maximize", "robust", "cooperative", "min", "max"};
278 this->addOption(storm::settings::OptionBuilder(moduleName, uncertaintyResolutionModeName, false, "Mode to resolve the uncertainty (intervals)")
279 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("mode", "Mode to resolve the uncertainty (intervals) by nature.")
280 .addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(uncertaintyResolutionModes))
281 .build())
282 .build());
283
284#ifdef STORM_HAVE_QVBS
285 std::string qvbsRootDefault = STORM_QVBS_ROOT;
286#else
287 std::string qvbsRootDefault = "";
288#endif
289 this->addOption(storm::settings::OptionBuilder(moduleName, qvbsRootOptionName, false,
290 "Specifies the root directory of the Quantitative Verification Benchmark Set. Default can be set in CMAKE.")
291 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("path", "The path.").setDefaultValueString(qvbsRootDefault).build())
292 .build());
293}
294
296 return this->getOption(exportDotOptionName).getHasOptionBeenSet();
297}
298
300 return this->getOption(exportDotOptionName).getArgumentByName("filename").getValueAsString();
301}
302
304 return this->getOption(exportDotMaxWidthOptionName).getArgumentByName("width").getValueAsUnsignedInteger();
305}
306
308 return this->getOption(exportBuildOptionName).getHasOptionBeenSet();
309}
310
312 return this->getOption(exportBuildOptionName).getArgumentByName("file").getValueAsString();
313}
314
316 auto format = this->getOption(exportBuildOptionName).getArgumentByName("format").getValueAsString();
317 if (format == "auto") {
319 } else {
321 }
322}
323
325 return this->getOption(exportCompressionOptionName).getHasOptionBeenSet();
326}
327
329 auto mode = this->getOption(exportCompressionOptionName).getArgumentByName("mode").getValueAsString();
331}
332
334 return this->getOption(exportDigitsOptionName).getHasOptionBeenSet();
335}
336
337std::size_t IOSettings::getExportDigits() const {
338 return this->getOption(exportDigitsOptionName).getArgumentByName("num").getValueAsUnsignedInteger();
339}
340
342 return this->getOption(exportJaniDotOptionName).getHasOptionBeenSet();
343}
344
346 return this->getOption(exportJaniDotOptionName).getArgumentByName("filename").getValueAsString();
347}
348
350 return this->getOption(exportExplicitOptionName).getHasOptionBeenSet();
351}
352
354 return this->getOption(exportExplicitOptionName).getArgumentByName("filename").getValueAsString();
355}
356
358 return this->getOption(preventDRNPlaceholderOptionName).getHasOptionBeenSet();
359}
360
362 return this->getOption(exportDdOptionName).getHasOptionBeenSet();
363}
364
366 return this->getOption(exportDdOptionName).getArgumentByName("filename").getValueAsString();
367}
368
370 return this->getOption(exportCdfOptionName).getHasOptionBeenSet();
371}
372
374 std::string result = this->getOption(exportCdfOptionName).getArgumentByName("directory").getValueAsString();
375 if (result.back() != '/') {
376 result.push_back('/');
377 }
378 return result;
379}
380
382 return this->getOption(exportSchedulerOptionName).getHasOptionBeenSet();
383}
384
386 return this->getOption(exportSchedulerOptionName).getArgumentByName("filename").getValueAsString();
387}
388
390 return this->getOption(exportCheckResultOptionName).getHasOptionBeenSet();
391}
392
394 return this->getOption(exportCheckResultOptionName).getArgumentByName("filename").getValueAsString();
395}
396
398 return this->getOption(explicitOptionName).getHasOptionBeenSet();
399}
400
402 return this->getOption(explicitOptionName).getArgumentByName("transition filename").getValueAsString();
403}
404
406 return this->getOption(explicitOptionName).getArgumentByName("labeling filename").getValueAsString();
407}
408
410 return this->getOption(explicitDrnOptionName).getHasOptionBeenSet();
411}
412
414 return this->getOption(explicitDrnOptionName).getArgumentByName("drn filename").getValueAsString();
415}
416
418 return this->getOption(explicitImcaOptionName).getHasOptionBeenSet();
419}
420
422 return this->getOption(explicitImcaOptionName).getArgumentByName("imca filename").getValueAsString();
423}
424
426 return this->getOption(prismInputOptionName).getHasOptionBeenSet();
427}
428
432
434 return this->getOption(prismToJaniOptionName).getHasOptionBeenSet();
435}
436
438 return this->getOption(prismInputOptionName).getArgumentByName("filename").getValueAsString();
439}
440
442 return this->getOption(janiInputOptionName).getHasOptionBeenSet();
443}
444
446 return this->getOption(janiInputOptionName).getArgumentByName("filename").getValueAsString();
447}
448
450 return this->getOption(transitionRewardsOptionName).getHasOptionBeenSet();
451}
452
454 return this->getOption(transitionRewardsOptionName).getArgumentByName("filename").getValueAsString();
455}
456
458 return this->getOption(stateRewardsOptionName).getHasOptionBeenSet();
459}
460
462 return this->getOption(stateRewardsOptionName).getArgumentByName("filename").getValueAsString();
463}
464
466 return this->getOption(choiceLabelingOptionName).getHasOptionBeenSet();
467}
468
470 return this->getOption(choiceLabelingOptionName).getArgumentByName("filename").getValueAsString();
471}
472
474 return this->getOption(constantsOptionName).getHasOptionBeenSet();
475}
476
478 return this->getOption(constantsOptionName).getArgumentByName("values").getValueAsString();
479}
480
482 return this->getOption(janiPropertyOptionName).getHasOptionBeenSet();
483}
484
486 return this->getOption(janiPropertyOptionName).getHasOptionBeenSet() &&
487 (this->getOption(janiPropertyOptionName).getArgumentByName("values").getValueAsString() != "");
488}
489
490std::vector<std::string> IOSettings::getSelectedJaniProperties() const {
491 return storm::parser::parseCommaSeperatedValues(this->getOption(janiPropertyOptionName).getArgumentByName("values").getValueAsString());
492}
493
495 return this->getOption(propertyOptionName).getHasOptionBeenSet();
496}
497
498std::string IOSettings::getProperty() const {
499 return this->getOption(propertyOptionName).getArgumentByName("property or filename").getValueAsString();
500}
501
502std::string IOSettings::getPropertyFilter() const {
503 return this->getOption(propertyOptionName).getArgumentByName("filter").getValueAsString();
504}
505
507 return this->getOption(steadyStateDistrOptionName).getHasOptionBeenSet();
508}
509
511 auto alg = this->getOption(steadyStateDistrOptionName).getArgumentByName("algorithm").getValueAsString();
512 if (alg == "auto") {
514 } else if (alg == "eqsys") {
516 } else if (alg == "classic") {
518 } else {
519 STORM_LOG_ASSERT(alg == "evt", "Unexpected algorithm type.");
521 }
522}
523
525 return this->getOption(expectedVisitingTimesOptionName).getHasOptionBeenSet();
526}
527
529 return this->getOption(qvbsInputOptionName).getHasOptionBeenSet();
530}
531
532std::string IOSettings::getQvbsModelName() const {
533 return this->getOption(qvbsInputOptionName).getArgumentByName("model").getValueAsString();
534}
535
537 return this->getOption(qvbsInputOptionName).getArgumentByName("instance-index").getValueAsUnsignedInteger();
538}
539
540boost::optional<std::vector<std::string>> IOSettings::getQvbsPropertyFilter() const {
541 std::string listAsString = this->getOption(qvbsInputOptionName).getArgumentByName("filter").getValueAsString();
542 if (listAsString == "") {
543 if (this->getOption(qvbsInputOptionName).getArgumentByName("filter").wasSetFromDefaultValue()) {
544 return boost::none;
545 } else {
546 return std::vector<std::string>();
547 }
548 } else {
549 return storm::parser::parseCommaSeperatedValues(listAsString);
550 }
551}
552
553std::string IOSettings::getQvbsRoot() const {
554 auto const& path = this->getOption(qvbsRootOptionName).getArgumentByName("path");
555#ifndef STORM_HAVE_QVBS
556 STORM_LOG_THROW(this->getOption(qvbsRootOptionName).getHasOptionBeenSet(), storm::exceptions::InvalidSettingsException,
557 "QVBS Root is not specified. Either use the --" + qvbsRootOptionName + " option or specify it within CMAKE.");
558#endif
559 return path.getValueAsString();
560}
561
563 return this->getOption(propertiesAsMultiOptionName).getHasOptionBeenSet();
564}
565
567 std::string uncertaintyResolutionModeString = this->getOption(uncertaintyResolutionModeName).getArgumentByName("mode").getValueAsString();
568
569 if (uncertaintyResolutionModeString == "minimize" || uncertaintyResolutionModeString == "min") {
570 return UncertaintyResolutionModeSetting::Minimize;
571 } else if (uncertaintyResolutionModeString == "maximize" || uncertaintyResolutionModeString == "max") {
572 return UncertaintyResolutionModeSetting::Maximize;
573 } else if (uncertaintyResolutionModeString == "robust") {
574 return UncertaintyResolutionModeSetting::Robust;
575 } else if (uncertaintyResolutionModeString == "cooperative") {
576 return UncertaintyResolutionModeSetting::Cooperative;
577 } else if (uncertaintyResolutionModeString == "both") {
578 STORM_LOG_ASSERT(false, "Uncertainty resolution mode 'both' not yet implemented.");
579 STORM_LOG_THROW(false, storm::exceptions::NotImplementedException, "Uncertainty resolution mode 'both' not yet implemented.");
580 }
581 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown nature resolution mode '" << uncertaintyResolutionModeString << "'.");
582}
583
585 return this->getOption(uncertaintyResolutionModeName).getHasOptionBeenSet();
586}
587
589 STORM_LOG_WARN_COND(!isExportDdSet(), "Option '--" << moduleName << ":" << exportDdOptionName << "' is depreciated. Use '--" << moduleName << ":"
590 << exportBuildOptionName << "' instead.");
591 STORM_LOG_WARN_COND(!isExportDotSet(), "Option '--" << moduleName << ":" << exportDotOptionName << "' is depreciated. Use '--" << moduleName << ":"
592 << exportBuildOptionName << "' instead.");
593 STORM_LOG_WARN_COND(!isExportExplicitSet(), "Option '--" << moduleName << ":" << exportExplicitOptionName << "' is depreciated. Use '--" << moduleName
594 << ":" << exportBuildOptionName << "' instead.");
595}
596
597bool IOSettings::check() const {
598 // Ensure that at most one symbolic input model is given.
599 uint64_t numSymbolicInputs = isJaniInputSet() ? 1 : 0;
600 numSymbolicInputs += isPrismInputSet() ? 1 : 0;
601 numSymbolicInputs += isQvbsInputSet() ? 1 : 0;
602 STORM_LOG_THROW(numSymbolicInputs <= 1, storm::exceptions::InvalidSettingsException, "Multiple symbolic input models.");
603 STORM_LOG_THROW(!isExportJaniDotSet() || isJaniInputSet() || isQvbsInputSet(), storm::exceptions::InvalidSettingsException,
604 "Jani-to-dot export is only available for jani models");
605
606 // Ensure that not two explicit input models were given.
607 uint64_t numExplicitInputs = isExplicitSet() ? 1 : 0;
608 numExplicitInputs += isExplicitDRNSet() ? 1 : 0;
609 numExplicitInputs += isExplicitIMCASet() ? 1 : 0;
610 STORM_LOG_THROW(numExplicitInputs <= 1, storm::exceptions::InvalidSettingsException, "Multiple explicit input models");
611
612 // Ensure that the model was given either symbolically or explicitly.
613 STORM_LOG_THROW(numSymbolicInputs + numExplicitInputs <= 1, storm::exceptions::InvalidSettingsException,
614 "The model may be either given in an explicit or a symbolic format (PRISM or JANI), but not both.");
615
616 // Make sure PRISM-to-JANI conversion is only set if the actual input is in PRISM format.
617 STORM_LOG_THROW(!isPrismToJaniSet() || isPrismInputSet(), storm::exceptions::InvalidSettingsException,
618 "For the transformation from PRISM to JANI, the input model must be given in the prism format.");
619
620 return true;
621}
622
623} // namespace modules
624} // namespace settings
625} // 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:417
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...
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.
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.
This is the base class of the settings for a particular module.
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