Browse Source

Fixed "division by zero" error that occurred when considering a CTMC with state rewards but without action rewards

tempestpy_adaptions
TimQu 8 years ago
parent
commit
170105c261
  1. 4
      src/storm/generator/PrismNextStateGenerator.cpp

4
src/storm/generator/PrismNextStateGenerator.cpp

@ -22,7 +22,7 @@ namespace storm {
} }
template<typename ValueType, typename StateType> template<typename ValueType, typename StateType>
PrismNextStateGenerator<ValueType, StateType>::PrismNextStateGenerator(storm::prism::Program const& program, NextStateGeneratorOptions const& options, bool) : NextStateGenerator<ValueType, StateType>(program.getManager(), options), program(program), rewardModels() {
PrismNextStateGenerator<ValueType, StateType>::PrismNextStateGenerator(storm::prism::Program const& program, NextStateGeneratorOptions const& options, bool) : NextStateGenerator<ValueType, StateType>(program.getManager(), options), program(program), rewardModels(), hasStateActionRewards(false) {
STORM_LOG_TRACE("Creating next-state generator for PRISM program: " << program); STORM_LOG_TRACE("Creating next-state generator for PRISM program: " << program);
STORM_LOG_THROW(!this->program.specifiesSystemComposition(), storm::exceptions::WrongFormatException, "The explicit next-state generator currently does not support custom system compositions."); STORM_LOG_THROW(!this->program.specifiesSystemComposition(), storm::exceptions::WrongFormatException, "The explicit next-state generator currently does not support custom system compositions.");
@ -262,8 +262,10 @@ namespace storm {
} }
} }
if (hasStateActionRewards) {
globalChoice.addReward(stateActionRewardValue / totalExitRate); globalChoice.addReward(stateActionRewardValue / totalExitRate);
} }
}
// Move the newly fused choice in place. // Move the newly fused choice in place.
allChoices.clear(); allChoices.clear();

Loading…
Cancel
Save