Browse Source
Merge branch 'master' of https://sselab.de/lab9/private/git/storm
Merge branch 'master' of https://sselab.de/lab9/private/git/storm
Conflicts: src/storage/SparseMatrix.htempestpy_adaptions
PBerger
12 years ago
19 changed files with 257 additions and 131 deletions
-
4CMakeLists.txt
-
7src/adapters/GmmxxAdapter.h
-
4src/models/AbstractModel.h
-
11src/models/Dtmc.h
-
20src/parser/AutoParser.cpp
-
2src/parser/AutoParser.h
-
24src/parser/DeterministicModelParser.cpp
-
62src/parser/DeterministicModelParser.h
-
40src/parser/DtmcParser.h
-
30src/storage/BitVector.h
-
64src/storage/SparseMatrix.h
-
11src/storm.cpp
-
2src/utility/Settings.cpp
-
51src/utility/Settings.h
-
6test/parser/ParseDtmcTest.cpp
-
2test/storm-tests.cpp
@ -0,0 +1,62 @@ |
|||
/* |
|||
* DtmcParser.h |
|||
* |
|||
* Created on: 19.12.2012 |
|||
* Author: thomas |
|||
*/ |
|||
|
|||
#ifndef STORM_PARSER_DETERMINISTICMODELPARSER_H_ |
|||
#define STORM_PARSER_DETERMINISTICMODELPARSER_H_ |
|||
|
|||
#include "src/parser/Parser.h" |
|||
#include "src/models/Dtmc.h" |
|||
#include "src/models/Ctmc.h" |
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
|
|||
/*! |
|||
* @brief Load label and transition file and return initialized dtmc or ctmc object. |
|||
* |
|||
* @Note This class creates a new Dtmc or Ctmc object that can |
|||
* be accessed via getDtmc() or getCtmc(). However, it will not delete this object! |
|||
* |
|||
* @Note The labeling representation in the file may use at most as much nodes as are specified in the transition system. |
|||
*/ |
|||
class DeterministicModelParser: public storm::parser::Parser { |
|||
public: |
|||
DeterministicModelParser(std::string const & transitionSystemFile, std::string const & labelingFile, |
|||
std::string const & stateRewardFile = "", std::string const & transitionRewardFile = ""); |
|||
|
|||
/*! |
|||
* @brief Get the parsed dtmc model. |
|||
*/ |
|||
std::shared_ptr<storm::models::Dtmc<double>> getDtmc() { |
|||
if (this->dtmc == nullptr) { |
|||
this->dtmc = std::shared_ptr<storm::models::Dtmc<double>>(new storm::models::Dtmc<double>(this->transitionSystem, this->labeling, this->stateRewards, this->transitionRewards)); |
|||
} |
|||
return this->dtmc; |
|||
} |
|||
/*! |
|||
* @brief Get the parsed ctmc model. |
|||
*/ |
|||
std::shared_ptr<storm::models::Ctmc<double>> getCtmc() { |
|||
if (this->ctmc == nullptr) { |
|||
this->ctmc = std::shared_ptr<storm::models::Ctmc<double>>(new storm::models::Ctmc<double>(this->transitionSystem, this->labeling, this->stateRewards, this->transitionRewards)); |
|||
} |
|||
return this->ctmc; |
|||
} |
|||
|
|||
private: |
|||
std::shared_ptr<storm::storage::SparseMatrix<double>> transitionSystem; |
|||
std::shared_ptr<storm::models::AtomicPropositionsLabeling> labeling; |
|||
std::shared_ptr<std::vector<double>> stateRewards; |
|||
std::shared_ptr<storm::storage::SparseMatrix<double>> transitionRewards; |
|||
|
|||
std::shared_ptr<storm::models::Dtmc<double>> dtmc; |
|||
std::shared_ptr<storm::models::Ctmc<double>> ctmc; |
|||
}; |
|||
|
|||
} /* namespace parser */ |
|||
} /* namespace storm */ |
|||
#endif /* STORM_PARSER_DETERMINISTICMODELPARSER_H_ */ |
@ -1,40 +0,0 @@ |
|||
/* |
|||
* DtmcParser.h |
|||
* |
|||
* Created on: 19.12.2012 |
|||
* Author: thomas |
|||
*/ |
|||
|
|||
#ifndef STORM_PARSER_DTMCPARSER_H_ |
|||
#define STORM_PARSER_DTMCPARSER_H_ |
|||
|
|||
#include "src/parser/Parser.h" |
|||
#include "src/models/Dtmc.h" |
|||
|
|||
namespace storm { |
|||
namespace parser { |
|||
|
|||
/*! |
|||
* @brief Load label and transition file and return initialized dtmc object |
|||
* |
|||
* @Note This class creates a new Dtmc object that can |
|||
* be accessed via getDtmc(). However, it will not delete this object! |
|||
* |
|||
* @Note The labeling representation in the file may use at most as much nodes as are specified in the dtmc. |
|||
*/ |
|||
class DtmcParser: public storm::parser::Parser { |
|||
public: |
|||
DtmcParser(std::string const & transitionSystemFile, std::string const & labelingFile, |
|||
std::string const & stateRewardFile = "", std::string const & transitionRewardFile = ""); |
|||
|
|||
std::shared_ptr<storm::models::Dtmc<double>> getDtmc() { |
|||
return this->dtmc; |
|||
} |
|||
|
|||
private: |
|||
std::shared_ptr<storm::models::Dtmc<double>> dtmc; |
|||
}; |
|||
|
|||
} /* namespace parser */ |
|||
} /* namespace storm */ |
|||
#endif /* STORM_PARSER_DTMCPARSER_H_ */ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue