Browse Source

isSinkState

tempestpy_adaptions
Sebastian Junges 5 years ago
parent
commit
82978f4357
  1. 11
      src/storm/models/sparse/Model.cpp
  2. 2
      src/storm/models/sparse/Model.h

11
src/storm/models/sparse/Model.cpp

@ -412,7 +412,16 @@ namespace storm {
void Model<ValueType, RewardModelType>::setTransitionMatrix(storm::storage::SparseMatrix<ValueType>&& transitionMatrix) {
this->transitionMatrix = std::move(transitionMatrix);
}
template<typename ValueType, typename RewardModelType>
bool Model<ValueType, RewardModelType>::isSinkState(uint64_t state) const {
for (auto const& entry : this->getTransitionMatrix().getRowGroup(state)) {
if (entry.getColumn() != state) { return false; }
if (storm::utility::isOne(entry.getValue())) { return false; }
}
return true;
}
template<typename ValueType, typename RewardModelType>
bool Model<ValueType, RewardModelType>::isSparseModel() const {
return true;

2
src/storm/models/sparse/Model.h

@ -318,6 +318,8 @@ namespace storm {
* @param out The stream the information is to be printed to.
*/
virtual void printModelInformationToStream(std::ostream& out) const override;
bool isSinkState(uint64_t sink) const;
/*!
* Exports the model to the dot-format and prints the result to the given stream.

Loading…
Cancel
Save