Browse Source

towards more helpful output when POMDP is not canonical

tempestpy_adaptions
Sebastian Junges 5 years ago
parent
commit
e4a4214fc4
  1. 20
      src/storm-pomdp/transformer/MakePOMDPCanonic.cpp

20
src/storm-pomdp/transformer/MakePOMDPCanonic.cpp

@ -175,7 +175,15 @@ namespace storm {
if (moreActionObservations.get(observation)) {
// We have seen this observation previously with multiple actions. Error!
// TODO provide more diagnostic information
STORM_LOG_THROW(false, storm::exceptions::AmbiguousModelException, "Observation " << observation << " sometimes provides multiple actions, but in state " << state << " provides one action.");
std::string stateval ="";
if (pomdp.hasStateValuations()) {
stateval = " (" + pomdp.getStateValuations().getStateInfo(state) + ") ";
}
std::string actionval= "";
if (pomdp.hasChoiceLabeling()) {
actionval = *pomdp.getChoiceLabeling().getLabelsOfChoice(rowIndexFrom).begin();
}
STORM_LOG_THROW(false, storm::exceptions::AmbiguousModelException, "Observation " << observation << " sometimes provides multiple actions, but in state " << state << stateval << " provides only one action " << actionval << ".");
}
oneActionObservations.set(observation);
@ -184,7 +192,15 @@ namespace storm {
} else {
if (oneActionObservations.get(observation)) {
// We have seen this observation previously with one action. Error!
STORM_LOG_THROW(false, storm::exceptions::AmbiguousModelException, "Observation " << observation << " sometimes provides one action, but in state " << state << " provides multiple actions.");
std::string stateval ="";
if (pomdp.hasStateValuations()) {
stateval = " (" + pomdp.getStateValuations().getStateInfo(state) + ") ";
}
// std::string actionval= "";
// if (pomdp.hasChoiceLabeling()) {
// actionval = *pomdp.getChoiceLabeling().getLabelsOfChoice(rowIndexFrom).begin();
// }
STORM_LOG_THROW(false, storm::exceptions::AmbiguousModelException, "Observation " << observation << " sometimes provides one action, but in state " << state << stateval << " provides " << rowIndexTo - rowIndexFrom << " actions.");
}
moreActionObservations.set(observation);
}

Loading…
Cancel
Save