Browse Source

made Ctmc and Dtmc subclasses of AbstractModel

implement getType()
fixed typo
tempestpy_adaptions
gereon 12 years ago
parent
commit
b4862360ba
  1. 10
      src/models/Ctmc.h
  2. 10
      src/models/Dtmc.h

10
src/models/Ctmc.h

@ -18,7 +18,7 @@
#include "src/storage/SparseMatrix.h"
#include "src/exceptions/InvalidArgumentException.h"
#include "src/models/Model.h"
#include "src/models/AbstractModel.h"
namespace storm {
@ -29,7 +29,7 @@ namespace models {
* labeled with atomic propositions.
*/
template <class T>
class Ctmc : public storm::models::Model {
class Ctmc : public storm::models::AbstractModel {
public:
//! Constructor
@ -58,7 +58,7 @@ public:
Ctmc(const Ctmc<T> &ctmc) : rateMatrix(ctmc.rateMatrix),
stateLabeling(ctmc.stateLabeling), stateRewards(ctmc.stateRewards),
transitionRewardMatrix(ctmc.transitionRewardMatrix) {
if (ctmc.backardTransitions != nullptr) {
if (ctmc.backwardTransitions != nullptr) {
this->backwardTransitions = new storm::models::GraphTransitions<T>(*ctmc.backwardTransitions);
}
}
@ -163,6 +163,10 @@ public:
<< std::endl;
}
storm::models::ModelType getType() {
return CTMC;
}
private:
/*! A matrix representing the transition rate function of the CTMC. */

10
src/models/Dtmc.h

@ -19,7 +19,7 @@
#include "src/exceptions/InvalidArgumentException.h"
#include "src/utility/CommandLine.h"
#include "src/models/Model.h"
#include "src/models/AbstractModel.h"
namespace storm {
@ -30,7 +30,7 @@ namespace models {
* labeled with atomic propositions.
*/
template <class T>
class Dtmc : public storm::models::Model {
class Dtmc : public storm::models::AbstractModel {
public:
//! Constructor
@ -62,7 +62,7 @@ public:
Dtmc(const Dtmc<T> &dtmc) : probabilityMatrix(dtmc.probabilityMatrix),
stateLabeling(dtmc.stateLabeling), stateRewards(dtmc.stateRewards),
transitionRewardMatrix(dtmc.transitionRewardMatrix) {
if (dtmc.backardTransitions != nullptr) {
if (dtmc.backwardTransitions != nullptr) {
this->backwardTransitions = new storm::models::GraphTransitions<T>(*dtmc.backwardTransitions);
}
if (!this->checkValidityProbabilityMatrix()) {
@ -194,6 +194,10 @@ public:
out << std::endl;
storm::utility::printSeparationLine(out);
}
storm::models::ModelType getType() {
return DTMC;
}
private:

Loading…
Cancel
Save