|
|
@ -1,13 +1,11 @@ |
|
|
|
#include "src/parser/AutoParser.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <cctype>
|
|
|
|
|
|
|
|
#include "src/exceptions/WrongFileFormatException.h"
|
|
|
|
#include "src/models/AbstractModel.h"
|
|
|
|
|
|
|
|
#include "src/parser/DtmcParser.h"
|
|
|
|
//#include "NonDeterministicSparseTransitionParser.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <cctype>
|
|
|
|
|
|
|
|
namespace storm { |
|
|
|
namespace parser { |
|
|
@ -15,15 +13,13 @@ namespace parser { |
|
|
|
AutoParser::AutoParser(std::string const & transitionSystemFile, std::string const & labelingFile, |
|
|
|
std::string const & stateRewardFile, std::string const & transitionRewardFile) |
|
|
|
: model(nullptr) { |
|
|
|
|
|
|
|
storm::models::ModelType type = this->analyzeHint(transitionSystemFile); |
|
|
|
|
|
|
|
if (type == storm::models::Unknown) { |
|
|
|
LOG4CPLUS_ERROR(logger, "Could not determine file type of " << transitionSystemFile << "."); |
|
|
|
LOG4CPLUS_ERROR(logger, "The first line of the file should contain a format hint. Please fix your file and try again."); |
|
|
|
throw storm::exceptions::WrongFileFormatException() << "Could not determine type of file " << transitionSystemFile; |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
LOG4CPLUS_INFO(logger, "Model type seems to be " << type); |
|
|
|
} |
|
|
|
|
|
|
@ -40,14 +36,13 @@ AutoParser::AutoParser(std::string const & transitionSystemFile, std::string con |
|
|
|
break; |
|
|
|
case storm::models::CTMDP: |
|
|
|
break; |
|
|
|
default: ; // Unknown
|
|
|
|
default: ; // Unknown
|
|
|
|
} |
|
|
|
|
|
|
|
if (! this->model) std::cout << "model is still null" << std::endl; |
|
|
|
if (!this->model) std::cout << "model is still null" << std::endl; |
|
|
|
} |
|
|
|
|
|
|
|
storm::models::ModelType AutoParser::analyzeHint(const std::string& filename) { |
|
|
|
|
|
|
|
storm::models::ModelType hintType = storm::models::Unknown; |
|
|
|
// Open file
|
|
|
|
MappedFile file(filename.c_str()); |
|
|
@ -67,5 +62,5 @@ storm::models::ModelType AutoParser::analyzeHint(const std::string& filename) { |
|
|
|
return hintType; |
|
|
|
} |
|
|
|
|
|
|
|
} //namespace parser
|
|
|
|
} //namespace storm
|
|
|
|
} // namespace parser
|
|
|
|
} // namespace storm
|