Browse Source

collect number of variables

tempestpy_adaptions
Sebastian Junges 5 years ago
parent
commit
6147b35fc8
  1. 8
      src/storm/storage/jani/Model.cpp
  2. 6
      src/storm/storage/jani/Model.h
  3. 9
      src/storm/storage/jani/VariableSet.cpp
  4. 18
      src/storm/storage/jani/VariableSet.h

8
src/storm/storage/jani/Model.cpp

@ -676,6 +676,14 @@ namespace storm {
return res;
}
std::size_t Model::getTotalNumberOfNonTransientVariables() const {
std::size_t res = globalVariables.getNumberOfNontransientVariables();
for (auto const& aut : getAutomata()) {
res += aut.getVariables().getNumberOfNontransientVariables();
}
return res;
}
Variable const& Model::addVariable(Variable const& variable) {
if (variable.isBooleanVariable()) {
return addVariable(variable.asBooleanVariable());

6
src/storm/storage/jani/Model.h

@ -385,6 +385,12 @@ namespace storm {
*/
std::size_t getNumberOfEdges() const;
/*!
* Number of global and local variables.
*/
std::size_t getTotalNumberOfNonTransientVariables() const;
/*!
* Sets the system composition expression of the JANI model.
*/

9
src/storm/storage/jani/VariableSet.cpp

@ -322,6 +322,15 @@ namespace storm {
return !(containsBooleanVariable() || containsBoundedIntegerVariable() || containsUnboundedIntegerVariables() || containsRealVariables() || containsArrayVariables() || containsClockVariables());
}
uint64_t VariableSet::getNumberOfVariables() const {
return variables.size();
}
uint64_t VariableSet::getNumberOfNontransientVariables() const {
return getNumberOfVariables() - getNumberOfTransientVariables();
}
uint_fast64_t VariableSet::getNumberOfTransientVariables() const {
uint_fast64_t result = 0;
for (auto const& variable : variables) {

18
src/storm/storage/jani/VariableSet.h

@ -229,25 +229,35 @@ namespace storm {
*/
bool empty() const;
/*!
* Total number of variables, including transient variables.
*/
uint64_t getNumberOfVariables() const;
/*
* Total number of nontransient variables
*/
uint64_t getNumberOfNontransientVariables() const;
/*!
* Retrieves the number of transient variables in this variable set.
*/
uint_fast64_t getNumberOfTransientVariables() const;
uint64_t getNumberOfTransientVariables() const;
/*!
* Retrieves the number of real transient variables in this variable set.
*/
uint_fast64_t getNumberOfRealTransientVariables() const;
uint64_t getNumberOfRealTransientVariables() const;
/*!
* Retrieves the number of unbounded integer transient variables in this variable set.
*/
uint_fast64_t getNumberOfUnboundedIntegerTransientVariables() const;
uint64_t getNumberOfUnboundedIntegerTransientVariables() const;
/*!
* Retrieves the number of numerical (i.e. real, or integer) transient variables in this variable set.
*/
uint_fast64_t getNumberOfNumericalTransientVariables() const;
uint64_t getNumberOfNumericalTransientVariables() const;
/*!
* Retrieves the transient variables in this variable set.

Loading…
Cancel
Save