Browse Source

isSinkState

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

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

@ -413,6 +413,15 @@ namespace storm {
this->transitionMatrix = std::move(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> template<typename ValueType, typename RewardModelType>
bool Model<ValueType, RewardModelType>::isSparseModel() const { bool Model<ValueType, RewardModelType>::isSparseModel() const {
return true; return true;

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

@ -319,6 +319,8 @@ namespace storm {
*/ */
virtual void printModelInformationToStream(std::ostream& out) const override; 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. * Exports the model to the dot-format and prints the result to the given stream.
* *

Loading…
Cancel
Save