Browse Source

changed format of player parsing exceptions

tempestpy_adaptions
Stefan Pranger 4 years ago
parent
commit
e63faa485f
  1. 8
      src/storm-parsers/parser/PrismParser.cpp

8
src/storm-parsers/parser/PrismParser.cpp

@ -795,12 +795,12 @@ namespace storm {
if (moduleIndexPair != globalProgramInformation.moduleToIndexMap.end()) { if (moduleIndexPair != globalProgramInformation.moduleToIndexMap.end()) {
controlledModuleIndices.insert(std::pair<std::string, uint_fast64_t>(moduleIndexPair->first, moduleIndexPair->second)); controlledModuleIndices.insert(std::pair<std::string, uint_fast64_t>(moduleIndexPair->first, moduleIndexPair->second));
if (std::find(globalProgramInformation.playerControlledModules.begin(), globalProgramInformation.playerControlledModules.end(), moduleName) != globalProgramInformation.playerControlledModules.end()) { if (std::find(globalProgramInformation.playerControlledModules.begin(), globalProgramInformation.playerControlledModules.end(), moduleName) != globalProgramInformation.playerControlledModules.end()) {
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player " << playerName << ": Module '" << moduleName << "' already controlled by another player.");
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player '" << playerName << "': Module '" << moduleName << "' already controlled by another player.");
} else { } else {
globalProgramInformation.playerControlledModules.push_back(moduleName); globalProgramInformation.playerControlledModules.push_back(moduleName);
} }
} else { } else {
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player " << playerName << ": No module named '" << moduleName << "' present.");
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player '" << playerName << "': No module named '" << moduleName << "' present.");
} }
} }
for(std::string actionName : actionNames) { for(std::string actionName : actionNames) {
@ -808,12 +808,12 @@ namespace storm {
if (actionIndexPair != globalProgramInformation.actionIndices.end()) { if (actionIndexPair != globalProgramInformation.actionIndices.end()) {
controlledActionIndices.insert(std::pair<std::string, uint_fast64_t>(actionIndexPair->first, actionIndexPair->second)); controlledActionIndices.insert(std::pair<std::string, uint_fast64_t>(actionIndexPair->first, actionIndexPair->second));
if (std::find(globalProgramInformation.playerControlledCommands.begin(), globalProgramInformation.playerControlledCommands.end(), actionName) != globalProgramInformation.playerControlledCommands.end()) { if (std::find(globalProgramInformation.playerControlledCommands.begin(), globalProgramInformation.playerControlledCommands.end(), actionName) != globalProgramInformation.playerControlledCommands.end()) {
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player " << playerName << ": Command '" << actionName << "' already controlled by another player.");
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player '" << playerName << "': Command '" << actionName << "' already controlled by another player.");
} else { } else {
globalProgramInformation.playerControlledCommands.push_back(actionName); globalProgramInformation.playerControlledCommands.push_back(actionName);
} }
} else { } else {
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player " << playerName << ": No action named '" << actionName << "' present.");
STORM_LOG_THROW(false, storm::exceptions::WrongFormatException, "Parsing error in " << this->getFilename() << " for player '" << playerName << "': No action named '" << actionName << "' present.");
} }
} }
return storm::prism::Player(playerName, controlledModuleIndices, controlledActionIndices); return storm::prism::Player(playerName, controlledModuleIndices, controlledActionIndices);

Loading…
Cancel
Save