Browse Source

Added assertion for turnRatesToProbabilities in MA

tempestpy_adaptions
Matthias Volk 7 years ago
parent
commit
88544a9ec7
  1. 4
      src/storm/models/sparse/MarkovAutomaton.cpp

4
src/storm/models/sparse/MarkovAutomaton.cpp

@ -160,9 +160,13 @@ namespace storm {
transition.setValue(transition.getValue() / this->exitRates[state]); transition.setValue(transition.getValue() / this->exitRates[state]);
} }
++row; ++row;
} else {
if (assertRates) {
STORM_LOG_THROW(storm::utility::isZero<ValueType>(this->exitRates[state]), storm::exceptions::InvalidArgumentException, "The specified exit rate for (non-Markovian) choice should be 0.");
} else { } else {
this->exitRates.push_back(storm::utility::zero<ValueType>()); this->exitRates.push_back(storm::utility::zero<ValueType>());
} }
}
for (; row < this->getTransitionMatrix().getRowGroupIndices()[state+1]; ++row) { for (; row < this->getTransitionMatrix().getRowGroupIndices()[state+1]; ++row) {
STORM_LOG_THROW(storm::utility::isOne(this->getTransitionMatrix().getRowSum(row)), storm::exceptions::InvalidArgumentException, "Entries of transition matrix do not sum up to one for (non-Markovian) choice " << row << " of state " << state << " (sum is " << this->getTransitionMatrix().getRowSum(row) << ")."); STORM_LOG_THROW(storm::utility::isOne(this->getTransitionMatrix().getRowSum(row)), storm::exceptions::InvalidArgumentException, "Entries of transition matrix do not sum up to one for (non-Markovian) choice " << row << " of state " << state << " (sum is " << this->getTransitionMatrix().getRowSum(row) << ").");
} }

Loading…
Cancel
Save