Browse Source

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

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

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

@ -609,6 +609,14 @@ namespace storm {
return constants; 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) { Variable const& Model::addVariable(Variable const& variable) {
if (variable.isBooleanVariable()) { if (variable.isBooleanVariable()) {
return addVariable(variable.asBooleanVariable()); return addVariable(variable.asBooleanVariable());

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

@ -288,6 +288,11 @@ namespace storm {
*/ */
std::size_t getNumberOfAutomata() const; 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. * Sets the system composition expression of the JANI model.
*/ */

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

@ -193,6 +193,14 @@ namespace storm {
return modelType == ModelType::DTMC || modelType == ModelType::CTMC; 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 { bool Program::hasUndefinedConstants() const {
for (auto const& constant : this->getConstants()) { for (auto const& constant : this->getConstants()) {
if (!constant.isDefined()) { if (!constant.isDefined()) {

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

@ -158,6 +158,11 @@ namespace storm {
*/ */
std::vector<Constant> usedConstants() const; 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 * Retrieves whether a global Boolean variable with the given name exists
* *

Loading…
Cancel
Save