Browse Source

fixed a bug in the reward model

Former-commit-id: 5302a85d6f
tempestpy_adaptions
dehnert 9 years ago
parent
commit
51bd689c96
  1. 4
      src/models/sparse/StandardRewardModel.cpp

4
src/models/sparse/StandardRewardModel.cpp

@ -111,6 +111,7 @@ namespace storm {
if (this->hasTransitionRewards()) { if (this->hasTransitionRewards()) {
if (this->hasStateActionRewards()) { if (this->hasStateActionRewards()) {
storm::utility::vector::addVectors<ValueType>(this->getStateActionRewardVector(), transitionMatrix.getPointwiseProductRowSumVector(this->getTransitionRewardMatrix()), this->getStateActionRewardVector()); storm::utility::vector::addVectors<ValueType>(this->getStateActionRewardVector(), transitionMatrix.getPointwiseProductRowSumVector(this->getTransitionRewardMatrix()), this->getStateActionRewardVector());
this->optionalStateActionRewardVector = boost::none;
} else { } else {
this->optionalStateActionRewardVector = transitionMatrix.getPointwiseProductRowSumVector(this->getTransitionRewardMatrix()); this->optionalStateActionRewardVector = transitionMatrix.getPointwiseProductRowSumVector(this->getTransitionRewardMatrix());
} }
@ -121,8 +122,9 @@ namespace storm {
STORM_LOG_THROW(this->getStateRewardVector().size() == this->getStateActionRewardVector().size(), storm::exceptions::InvalidOperationException, "The reduction to state rewards is only possible of both the state and the state-action rewards have the same dimension."); STORM_LOG_THROW(this->getStateRewardVector().size() == this->getStateActionRewardVector().size(), storm::exceptions::InvalidOperationException, "The reduction to state rewards is only possible of both the state and the state-action rewards have the same dimension.");
storm::utility::vector::addVectors<ValueType>(this->getStateActionRewardVector(), this->getStateRewardVector(), this->getStateRewardVector()); storm::utility::vector::addVectors<ValueType>(this->getStateActionRewardVector(), this->getStateRewardVector(), this->getStateRewardVector());
} else { } else {
this->optionalStateRewardVector = std::move(this->optionalStateRewardVector);
this->optionalStateRewardVector = std::move(this->optionalStateActionRewardVector);
} }
this->optionalStateActionRewardVector = boost::none;
} }
} }

Loading…
Cancel
Save