Browse Source

Fixed assertion for RationalFunction

tempestpy_adaptions
Matthias Volk 4 years ago
parent
commit
8b05837e77
No known key found for this signature in database GPG Key ID: 83A57678F739FCD3
  1. 6
      src/storm-pomdp/transformer/ObservationTraceUnfolder.cpp

6
src/storm-pomdp/transformer/ObservationTraceUnfolder.cpp

@ -1,6 +1,7 @@
#include "storm/exceptions/InvalidArgumentException.h" #include "storm/exceptions/InvalidArgumentException.h"
#include "storm-pomdp/transformer/ObservationTraceUnfolder.h" #include "storm-pomdp/transformer/ObservationTraceUnfolder.h"
#include "storm/storage/expressions/ExpressionManager.h" #include "storm/storage/expressions/ExpressionManager.h"
#include "storm/utility/ConstantsComparator.h"
#undef _VERBOSE_OBSERVATION_UNFOLDING #undef _VERBOSE_OBSERVATION_UNFOLDING
@ -131,13 +132,14 @@ namespace storm {
// Now, take care of the last step. // Now, take care of the last step.
uint64_t sinkState = newStateIndex; uint64_t sinkState = newStateIndex;
uint64_t targetState = newStateIndex + 1; uint64_t targetState = newStateIndex + 1;
auto cc = storm::utility::ConstantsComparator<ValueType>();
for (auto const& unfoldedToOldEntry : unfoldedToOldNextStep) { for (auto const& unfoldedToOldEntry : unfoldedToOldNextStep) {
svbuilder.addState(unfoldedToOldEntry.first, {}, {static_cast<int64_t>(unfoldedToOldEntry.second)}); svbuilder.addState(unfoldedToOldEntry.first, {}, {static_cast<int64_t>(unfoldedToOldEntry.second)});
transitionMatrixBuilder.newRowGroup(newRowGroupStart); transitionMatrixBuilder.newRowGroup(newRowGroupStart);
STORM_LOG_ASSERT(risk.size() > unfoldedToOldEntry.second, "Must be a state"); STORM_LOG_ASSERT(risk.size() > unfoldedToOldEntry.second, "Must be a state");
STORM_LOG_ASSERT(risk[unfoldedToOldEntry.second] <= storm::utility::one<ValueType>(), "Risk must be a probability");
STORM_LOG_ASSERT(risk[unfoldedToOldEntry.second] >= storm::utility::zero<ValueType>(), "Risk must be a probability");
STORM_LOG_ASSERT(!cc.isLess(storm::utility::one<ValueType>(), risk[unfoldedToOldEntry.second]), "Risk must be a probability");
STORM_LOG_ASSERT(!cc.isLess(risk[unfoldedToOldEntry.second], storm::utility::zero<ValueType>()), "Risk must be a probability");
//std::cout << "risk is" << risk[unfoldedToOldEntry.second] << std::endl; //std::cout << "risk is" << risk[unfoldedToOldEntry.second] << std::endl;
if (!storm::utility::isOne(risk[unfoldedToOldEntry.second])) { if (!storm::utility::isOne(risk[unfoldedToOldEntry.second])) {
transitionMatrixBuilder.addNextValue(newRowGroupStart, sinkState, transitionMatrixBuilder.addNextValue(newRowGroupStart, sinkState,

Loading…
Cancel
Save