Browse Source

added setting to print intermediate results during the computation

main
TimQu 7 years ago
parent
commit
0e70cfc617
  1. 10
      src/storm/environment/modelchecker/MultiObjectiveModelCheckerEnvironment.cpp
  2. 4
      src/storm/environment/modelchecker/MultiObjectiveModelCheckerEnvironment.h
  3. 6
      src/storm/settings/modules/MultiObjectiveSettings.cpp
  4. 7
      src/storm/settings/modules/MultiObjectiveSettings.h

10
src/storm/environment/modelchecker/MultiObjectiveModelCheckerEnvironment.cpp

@ -23,6 +23,8 @@ namespace storm {
if (multiobjectiveSettings.hasSchedulerRestriction()) {
schedulerRestriction = multiobjectiveSettings.getSchedulerRestriction();
}
printResults = multiobjectiveSettings.isPrintResultsSet();
}
MultiObjectiveModelCheckerEnvironment::~MultiObjectiveModelCheckerEnvironment() {
@ -116,4 +118,12 @@ namespace storm {
void MultiObjectiveModelCheckerEnvironment::unsetSchedulerRestriction() {
schedulerRestriction = boost::none;
}
bool MultiObjectiveModelCheckerEnvironment::isPrintResultsSet() const {
return printResults;
}
void MultiObjectiveModelCheckerEnvironment::setPrintResults(bool value) {
printResults = value;
}
}

4
src/storm/environment/modelchecker/MultiObjectiveModelCheckerEnvironment.h

@ -42,12 +42,16 @@ namespace storm {
void setSchedulerRestriction(storm::storage::SchedulerClass const& value);
void unsetSchedulerRestriction();
bool isPrintResultsSet() const;
void setPrintResults(bool value);
private:
storm::modelchecker::multiobjective::MultiObjectiveMethod method;
boost::optional<std::string> plotPathUnderApprox, plotPathOverApprox, plotPathParetoPoints;
storm::RationalNumber precision;
boost::optional<uint64_t> maxSteps;
boost::optional<storm::storage::SchedulerClass> schedulerRestriction;
bool printResults;
};
}

6
src/storm/settings/modules/MultiObjectiveSettings.cpp

@ -17,6 +17,7 @@ namespace storm {
const std::string MultiObjectiveSettings::precisionOptionName = "precision";
const std::string MultiObjectiveSettings::maxStepsOptionName = "maxsteps";
const std::string MultiObjectiveSettings::schedulerRestrictionOptionName = "schedrest";
const std::string MultiObjectiveSettings::printResultsOptionName = "printres";
MultiObjectiveSettings::MultiObjectiveSettings() : ModuleSettings(moduleName) {
std::vector<std::string> methods = {"pcaa", "constraintbased"};
@ -31,6 +32,7 @@ namespace storm {
this->addOption(storm::settings::OptionBuilder(moduleName, schedulerRestrictionOptionName, false, "Restricts the class of considered schedulers to non-randomized schedulers with the provided memory pattern.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("memorypattern", "The Pattern of the memory.").addValidatorString(ArgumentValidatorFactory::createMultipleChoiceValidator(memoryPatterns)).build())
.addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("memorystates", "The Number of memory states (only if supported by the pattern).").setDefaultValueUnsignedInteger(0).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, printResultsOptionName, true, "Prints intermediate results of the computation to standard output.").build();
}
storm::modelchecker::multiobjective::MultiObjectiveMethod MultiObjectiveSettings::getMultiObjectiveMethod() const {
@ -93,6 +95,10 @@ namespace storm {
return result;
}
bool MultiObjectiveSettings::isPrintResultsSet() const {
return this->getOption(printResultsOptionName).getHasOptionBeenSet();
}
bool MultiObjectiveSettings::check() const {
std::shared_ptr<storm::settings::ArgumentValidator<std::string>> validator = ArgumentValidatorFactory::createWritableFileValidator();

7
src/storm/settings/modules/MultiObjectiveSettings.h

@ -69,6 +69,12 @@ namespace storm {
storm::storage::SchedulerClass getSchedulerRestriction() const;
/*!
* Retrieves whether output of intermediate results is enabled.
*/
bool isPrintResultsSet() const;
/*!
* Checks whether the settings are consistent. If they are inconsistent, an exception is thrown.
*
@ -85,6 +91,7 @@ namespace storm {
const static std::string precisionOptionName;
const static std::string maxStepsOptionName;
const static std::string schedulerRestrictionOptionName;
const static std::string printResultsOptionName;
};
} // namespace modules

Loading…
Cancel
Save