Browse Source

- Removed "test-prctl" option

- Some restructuring in storm.cpp
main
Lanchid 12 years ago
parent
commit
5279466644
  1. 52
      src/storm.cpp
  2. 1
      src/utility/Settings.cpp

52
src/storm.cpp

@ -110,10 +110,6 @@ bool parseOptions(const int argc, const char* argv[]) {
std::cout << storm::settings::help; std::cout << storm::settings::help;
return false; return false;
} }
if (s->isSet("test-prctl")) {
storm::parser::PrctlParser parser(s->getString("test-prctl").c_str());
return false;
}
if (s->isSet("verbose")) { if (s->isSet("verbose")) {
logger.getAppender("mainConsoleAppender")->setThreshold(log4cplus::INFO_LOG_LEVEL); logger.getAppender("mainConsoleAppender")->setThreshold(log4cplus::INFO_LOG_LEVEL);
@ -210,7 +206,7 @@ void checkMdp(std::shared_ptr<storm::models::Mdp<double>> mdp) {
} }
if(s->isSet("csl")) { if(s->isSet("csl")) {
LOG4CPLUS_ERROR(logger, "CSL properties cannot be checked on DTMCs.");
LOG4CPLUS_ERROR(logger, "CSL properties cannot be checked on MDPs.");
} }
} }
@ -239,15 +235,36 @@ void checkDtmc(std::shared_ptr<storm::models::Dtmc<double>> dtmc) {
} }
/*! /*!
* Simple testing procedure.
* Main entry point.
*/ */
void check_main() {
int main(const int argc, const char* argv[]) {
// Catch segfaults and display a backtrace.
installSignalHandler();
printHeader(argc, argv);
initializeLogger();
setUp();
try {
LOG4CPLUS_INFO(logger, "StoRM was invoked.");
// Parse options
if (!parseOptions(argc, argv)) {
// If false is returned, the program execution is stopped here
// E.g. if the user asked to see the help text
return 0;
}
// Now, the settings are receivd and the model is parsed.
storm::settings::Settings* s = storm::settings::instance(); storm::settings::Settings* s = storm::settings::instance();
storm::parser::AutoParser<double> parser(s->getString("trafile"), s->getString("labfile"), s->getString("staterew"), s->getString("transrew")); storm::parser::AutoParser<double> parser(s->getString("trafile"), s->getString("labfile"), s->getString("staterew"), s->getString("transrew"));
LOG4CPLUS_DEBUG(logger, s->getString("matrixlib")); LOG4CPLUS_DEBUG(logger, s->getString("matrixlib"));
// Depending on the model type, the respective model checking procedure is chosen.
switch (parser.getType()) { switch (parser.getType()) {
case storm::models::DTMC: case storm::models::DTMC:
LOG4CPLUS_INFO(logger, "Model was detected as DTMC"); LOG4CPLUS_INFO(logger, "Model was detected as DTMC");
@ -267,27 +284,6 @@ void check_main() {
LOG4CPLUS_ERROR(logger, "The model type could not be determined correctly."); LOG4CPLUS_ERROR(logger, "The model type could not be determined correctly.");
break; break;
} }
}
/*!
* Main entry point.
*/
int main(const int argc, const char* argv[]) {
// Catch segfaults and display a backtrace.
installSignalHandler();
printHeader(argc, argv);
initializeLogger();
if (!parseOptions(argc, argv)) {
return 0;
}
setUp();
try {
LOG4CPLUS_INFO(logger, "StoRM was invoked.");
check_main();
cleanUp(); cleanUp();

1
src/utility/Settings.cpp

@ -134,7 +134,6 @@ void Settings::initDescriptions() {
("debug", "be very verbose, intended for debugging") ("debug", "be very verbose, intended for debugging")
("logfile,l", bpo::value<std::string>(), "name of the log file") ("logfile,l", bpo::value<std::string>(), "name of the log file")
("configfile,c", bpo::value<std::string>(), "name of config file") ("configfile,c", bpo::value<std::string>(), "name of config file")
("test-prctl", bpo::value<std::string>(), "name of prctl file")
("trafile", bpo::value<std::string>()->required(), "name of the .tra file") ("trafile", bpo::value<std::string>()->required(), "name of the .tra file")
("labfile", bpo::value<std::string>()->required(), "name of the .lab file") ("labfile", bpo::value<std::string>()->required(), "name of the .lab file")
("prctl", bpo::value<std::string>(), "text file containing prctl formulas") ("prctl", bpo::value<std::string>(), "text file containing prctl formulas")

Loading…
Cancel
Save