Browse Source

"number of edges" and "number of commands" in jani model / prism programs

tempestpy_adaptions
Sebastian Junges 6 years ago
parent
commit
919dfeebae
  1. 10
      src/storm/storage/jani/Model.cpp
  2. 5
      src/storm/storage/jani/Model.h
  3. 8
      src/storm/storage/prism/Program.cpp
  4. 7
      src/storm/storage/prism/Program.h

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

@ -608,7 +608,15 @@ namespace storm {
std::vector<Constant>& Model::getConstants() {
return constants;
}
std::size_t Model::getNumberOfEdges() const {
size_t res = 0;
for (auto const& aut : getAutomata()) {
res += aut.getNumberOfEdges();
}
return res;
}
Variable const& Model::addVariable(Variable const& variable) {
if (variable.isBooleanVariable()) {
return addVariable(variable.asBooleanVariable());

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

@ -287,6 +287,11 @@ namespace storm {
* Retrieves the number of automata in this model.
*/
std::size_t getNumberOfAutomata() const;
/*!
* Retrieves the total number of edges in this model.
*/
std::size_t getNumberOfEdges() const;
/*!
* Sets the system composition expression of the JANI model.

8
src/storm/storage/prism/Program.cpp

@ -192,6 +192,14 @@ namespace storm {
bool Program::isDeterministicModel() const {
return modelType == ModelType::DTMC || modelType == ModelType::CTMC;
}
size_t Program::getNumberOfCommands() const {
size_t res = 0;
for (auto const& module : this->getModules()) {
res += module.getNumberOfCommands();
}
return res;
}
bool Program::hasUndefinedConstants() const {
for (auto const& constant : this->getConstants()) {

7
src/storm/storage/prism/Program.h

@ -157,7 +157,12 @@ namespace storm {
* @return
*/
std::vector<Constant> usedConstants() const;
/*!
* The total number of commands in the prism file.
*/
size_t getNumberOfCommands() const;
/*!
* Retrieves whether a global Boolean variable with the given name exists
*

Loading…
Cancel
Save