Browse Source

fix in drn parser

tempestpy_adaptions
Sebastian Junges 6 years ago
parent
commit
8ab3ea991d
  1. 1
      CHANGELOG.md
  2. 10
      src/storm-parsers/parser/DirectEncodingParser.cpp

1
CHANGELOG.md

@ -10,6 +10,7 @@ Version 1.2.x
### Version 1.2.4 (2018/08) ### Version 1.2.4 (2018/08)
- New binary `storm-conv` that handles conversions between model files (currently: prism to jani) - New binary `storm-conv` that handles conversions between model files (currently: prism to jani)
- Added support for expected time properties for discrete time models - Added support for expected time properties for discrete time models
- Bug fix in the parser for DRN (MDPs and MAs might have been affected).
- Several bug fixes related to jani - Several bug fixes related to jani
- `storm-gspn`: Improved .pnpro parser - `storm-gspn`: Improved .pnpro parser
- `storm-gspn`: Added support for single/infinite/k-server semantics for GSPNs given in the .pnpro format - `storm-gspn`: Added support for single/infinite/k-server semantics for GSPNs given in the .pnpro format

10
src/storm-parsers/parser/DirectEncodingParser.cpp

@ -126,7 +126,7 @@ namespace storm {
size_t row = 0; size_t row = 0;
size_t state = 0; size_t state = 0;
bool firstState = true; bool firstState = true;
bool firstAction = true;
bool firstActionForState = true;
while (std::getline(file, line)) { while (std::getline(file, line)) {
STORM_LOG_TRACE("Parsing: " << line); STORM_LOG_TRACE("Parsing: " << line);
if (boost::starts_with(line, "state ")) { if (boost::starts_with(line, "state ")) {
@ -135,7 +135,9 @@ namespace storm {
firstState = false; firstState = false;
} else { } else {
++state; ++state;
++row;
} }
firstActionForState = true;
STORM_LOG_TRACE("New state " << state); STORM_LOG_TRACE("New state " << state);
// Parse state id // Parse state id
@ -209,8 +211,8 @@ namespace storm {
} else if (boost::starts_with(line, "\taction ")) { } else if (boost::starts_with(line, "\taction ")) {
// New action // New action
if (firstAction) {
firstAction = false;
if (firstActionForState) {
firstActionForState = false;
} else { } else {
++row; ++row;
} }
@ -232,7 +234,7 @@ namespace storm {
} else { } else {
// New transition // New transition
size_t posColon = line.find(":"); size_t posColon = line.find(":");
STORM_LOG_ASSERT(posColon != std::string::npos, "':' not found.");
STORM_LOG_THROW(posColon != std::string::npos, storm::exceptions::WrongFormatException, "':' not found.");
size_t target = NumberParser<size_t>::parse(line.substr(2, posColon-3)); size_t target = NumberParser<size_t>::parse(line.substr(2, posColon-3));
std::string valueStr = line.substr(posColon+2); std::string valueStr = line.substr(posColon+2);
ValueType value = valueParser.parseValue(valueStr); ValueType value = valueParser.parseValue(valueStr);

Loading…
Cancel
Save