Browse Source

Added a few assertions

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
3c5df045c1
  1. 2
      src/storm-pomdp/builder/BeliefMdpExplorer.h
  2. 2
      src/storm-pomdp/modelchecker/TrivialPomdpValueBoundsModelChecker.h

2
src/storm-pomdp/builder/BeliefMdpExplorer.h

@ -473,6 +473,8 @@ namespace storm {
std::unique_ptr<storm::modelchecker::CheckResult> res(storm::api::verifyWithSparseEngine<ValueType>(exploredMdp, task)); std::unique_ptr<storm::modelchecker::CheckResult> res(storm::api::verifyWithSparseEngine<ValueType>(exploredMdp, task));
if (res) { if (res) {
values = std::move(res->asExplicitQuantitativeCheckResult<ValueType>().getValueVector()); values = std::move(res->asExplicitQuantitativeCheckResult<ValueType>().getValueVector());
STORM_LOG_WARN_COND_DEBUG(storm::utility::vector::compareElementWise(lowerValueBounds, values, std::less_equal<ValueType>()), "Computed values are smaller than the lower bound.");
STORM_LOG_WARN_COND_DEBUG(storm::utility::vector::compareElementWise(upperValueBounds, values, std::greater_equal<ValueType>()), "Computed values are larger than the upper bound.");
} else { } else {
STORM_LOG_ASSERT(storm::utility::resources::isTerminate(), "Empty check result!"); STORM_LOG_ASSERT(storm::utility::resources::isTerminate(), "Empty check result!");
STORM_LOG_ERROR("No result obtained while checking."); STORM_LOG_ERROR("No result obtained while checking.");

2
src/storm-pomdp/modelchecker/TrivialPomdpValueBoundsModelChecker.h

@ -88,6 +88,7 @@ namespace storm {
pomdpScheduler.setChoice(choiceDistribution, state); pomdpScheduler.setChoice(choiceDistribution, state);
} }
} }
STORM_LOG_ASSERT(!pomdpScheduler.isPartialScheduler(), "Expected a fully defined scheduler.");
auto scheduledModel = underlyingMdp->applyScheduler(pomdpScheduler, false); auto scheduledModel = underlyingMdp->applyScheduler(pomdpScheduler, false);
auto resultPtr2 = storm::api::verifyWithSparseEngine<ValueType>(scheduledModel, storm::api::createTask<ValueType>(formula.asSharedPointer(), false)); auto resultPtr2 = storm::api::verifyWithSparseEngine<ValueType>(scheduledModel, storm::api::createTask<ValueType>(formula.asSharedPointer(), false));
@ -104,6 +105,7 @@ namespace storm {
result.lower = std::move(pomdpSchedulerResult); result.lower = std::move(pomdpSchedulerResult);
result.upper = std::move(fullyObservableResult); result.upper = std::move(fullyObservableResult);
} }
STORM_LOG_WARN_COND_DEBUG(storm::utility::vector::compareElementWise(result.lower, result.upper, std::less_equal<ValueType>()), "Lower bound is larger than upper bound");
return result; return result;
} }

Loading…
Cancel
Save