From 4c8e29d62047dce10036128d07ea584fbe9b58bb Mon Sep 17 00:00:00 2001 From: ThomasH Date: Mon, 26 Oct 2015 18:49:23 +0100 Subject: [PATCH] add new class files Former-commit-id: 76f60aa71870c5b2b7f64dc8e82a50b92dd2765f --- src/parser/GspnParser.cpp | 5 +++++ src/parser/GspnParser.h | 14 ++++++++++++++ src/storage/gspn/GSPN.cpp | 4 ++++ src/storage/gspn/GSPN.h | 5 +++++ 4 files changed, 28 insertions(+) create mode 100644 src/parser/GspnParser.cpp create mode 100644 src/storage/gspn/GSPN.cpp diff --git a/src/parser/GspnParser.cpp b/src/parser/GspnParser.cpp new file mode 100644 index 000000000..f5999e5f7 --- /dev/null +++ b/src/parser/GspnParser.cpp @@ -0,0 +1,5 @@ +#include "src/parser/GspnParser.h" + +storm::gspn::GSPN storm::parser::GspnParser::parse(const std::string &filename) { + return storm::gspn::GSPN(); +} diff --git a/src/parser/GspnParser.h b/src/parser/GspnParser.h index a24f1b1d9..f519e5a17 100644 --- a/src/parser/GspnParser.h +++ b/src/parser/GspnParser.h @@ -1,9 +1,23 @@ #ifndef STORM_GSPNPARSER_H #define STORM_GSPNPARSER_H +#include +#include "src/storage/gspn/GSPN.h" + namespace storm { namespace parser { // Parses a GSPN in xml format + class GspnParser { + public: + /*! + * Parses the given file into the GSPN storage class assuming it complies with the PNML. + * + * @param filename The name of the file to parse + * @return The resulting GSPN. + */ + static storm::gspn::GSPN parse(std::string const& filename); + private: + }; } } diff --git a/src/storage/gspn/GSPN.cpp b/src/storage/gspn/GSPN.cpp new file mode 100644 index 000000000..f32dded64 --- /dev/null +++ b/src/storage/gspn/GSPN.cpp @@ -0,0 +1,4 @@ +#include "src/storage/gspn/GSPN.h" + +storm::gspn::GSPN::GSPN() : initialMarking(0, 0) { +} \ No newline at end of file diff --git a/src/storage/gspn/GSPN.h b/src/storage/gspn/GSPN.h index 4c1be4699..711b69140 100644 --- a/src/storage/gspn/GSPN.h +++ b/src/storage/gspn/GSPN.h @@ -14,6 +14,11 @@ namespace storm { // Later, the rates and probabilities type should become a template, for now, let it be doubles. typedef double RateType; typedef double WeightType; + + /*! + * The empty constructor creates an GSPN without transition and places + */ + GSPN(); private: // set containing all immediate transitions std::vector> immediateTransitions;