Browse Source

Added a method to get the number of choices for a specific state.

Former-commit-id: 1ced589a95
tempestpy_adaptions
sjunges 10 years ago
parent
commit
a212cce8c1
  1. 6
      src/models/sparse/NondeterministicModel.cpp
  2. 9
      src/models/sparse/NondeterministicModel.h

6
src/models/sparse/NondeterministicModel.cpp

@ -39,6 +39,12 @@ namespace storm {
return this->getTransitionMatrix().getRowGroupIndices();
}
template<typename ValueType>
uint_fast64_t getNumberOfChoices(uint_fast64_t state) const {
auto indices = this->getNondetermininisticChoiceIndices();
return indices[state+1] - indices[state];
}
template<typename ValueType>
void NondeterministicModel<ValueType>::printModelInformationToStream(std::ostream& out) const {
out << "-------------------------------------------------------------- " << std::endl;

9
src/models/sparse/NondeterministicModel.h

@ -66,10 +66,17 @@ namespace storm {
/*!
* Retrieves the vector indicating which matrix rows represent non-deterministic choices of a certain state.
*
* @param The vector indicating which matrix rows represent non-deterministic choices of a certain state.
* @return The vector indicating which matrix rows represent non-deterministic choices of a certain state.
*/
std::vector<uint_fast64_t> const& getNondeterministicChoiceIndices() const;
/*!
* @param state State for which we want to know how many choices it has
*
* @return The number of non-deterministic choices for the given state
*/
uint_fast64_t getNumberOfChoices(uint_fast64_t state) const;
virtual void printModelInformationToStream(std::ostream& out) const;
virtual void writeDotToStream(std::ostream& outStream, bool includeLabeling = true, storm::storage::BitVector const* subsystem = nullptr, std::vector<ValueType> const* firstValue = nullptr, std::vector<ValueType> const* secondValue = nullptr, std::vector<uint_fast64_t> const* stateColoring = nullptr, std::vector<std::string> const* colors = nullptr, std::vector<uint_fast64_t>* scheduler = nullptr, bool finalizeOutput = true) const;

Loading…
Cancel
Save