Browse Source
Merge branch 'master' of https://sselab.de/lab9/private/git/MRMC
Merge branch 'master' of https://sselab.de/lab9/private/git/MRMC
Conflicts: src/storage/SquareSparseMatrix.htempestpy_adaptions
gereon
12 years ago
64 changed files with 577 additions and 688 deletions
-
1.gitignore
-
24src/exceptions/BaseException.h
-
23src/exceptions/FileIoException.h
-
18src/exceptions/InvalidArgumentException.h
-
16src/exceptions/InvalidSettings.h
-
14src/exceptions/InvalidSettingsException.h
-
20src/exceptions/InvalidStateException.h
-
56src/exceptions/NoConvergence.h
-
17src/exceptions/NoConvergenceException.h
-
18src/exceptions/OutOfRangeException.h
-
27src/exceptions/WrongFileFormatException.h
-
33src/exceptions/file_IO_exception.h
-
34src/exceptions/invalid_argument.h
-
37src/exceptions/invalid_state.h
-
34src/exceptions/out_of_range.h
-
35src/exceptions/wrong_file_format.h
-
30src/formula/And.h
-
34src/formula/Ap.h
-
32src/formula/BoundedUntil.h
-
14src/formula/Formulas.h
-
26src/formula/Next.h
-
24src/formula/Not.h
-
30src/formula/Or.h
-
14src/formula/PctlFormula.h
-
16src/formula/PctlPathFormula.h
-
16src/formula/PctlStateFormula.h
-
30src/formula/ProbabilisticIntervalOperator.h
-
29src/formula/ProbabilisticNoBoundsOperator.h
-
31src/formula/ProbabilisticOperator.h
-
32src/formula/Until.h
-
24src/modelChecker/DtmcPrctlModelChecker.h
-
14src/modelChecker/EigenDtmcPrctlModelChecker.h
-
14src/modelChecker/GmmxxDtmcPrctlModelChecker.h
-
19src/models/AtomicPropositionsLabeling.h
-
8src/models/Dtmc.h
-
8src/models/GraphTransitions.h
-
17src/mrmc.cpp
-
21src/parser/LabParser.cpp
-
8src/parser/LabParser.h
-
33src/parser/Parser.cpp
-
21src/parser/Parser.h
-
9src/parser/PrctlParser.cpp
-
33src/parser/PrctlParser.h
-
18src/parser/TraParser.cpp
-
9src/parser/TraParser.h
-
33src/parser/readPrctlFile.h
-
8src/reward/RewardModel.h
-
16src/solver/GraphAnalyzer.h
-
20src/storage/BitVector.h
-
40src/storage/SquareSparseMatrix.h
-
8src/utility/ConstTemplates.h
-
8src/utility/IoUtility.cpp
-
8src/utility/IoUtility.h
-
8src/utility/OsDetection.h
-
12src/utility/Settings.cpp
-
12src/utility/Settings.h
-
8src/utility/Vector.h
-
2test/eigen/EigenSparseMatrixTest.cpp
-
4test/parser/ParseDtmcTest.cpp
-
16test/parser/ReadLabFileTest.cpp
-
18test/parser/ReadTraFileTest.cpp
-
4test/reward/RewardModelTest.cpp
-
2test/storage/BitVectorTest.cpp
-
17test/storage/SquareSparseMatrixTest.cpp
@ -0,0 +1,23 @@ |
|||
/* |
|||
* FileIoException.h |
|||
* |
|||
* Created on: 16.08.2012 |
|||
* Author: Thomas Heinemann |
|||
*/ |
|||
|
|||
#ifndef MRMC_EXCEPTIONS_FILEIOEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_FILEIOEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
MRMC_EXCEPTION_DEFINE_NEW(FileIoException) |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
#endif /* MRMC_EXCEPTIONS_FILEIOEXCEPTION_H_ */ |
@ -0,0 +1,18 @@ |
|||
#ifndef MRMC_EXCEPTIONS_INVALIDARGUMENTEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_INVALIDARGUMENTEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
/*! |
|||
* @brief This exception is thrown when a parameter is invalid in this context |
|||
*/ |
|||
MRMC_EXCEPTION_DEFINE_NEW(InvalidArgumentException) |
|||
|
|||
} // namespace exceptions |
|||
|
|||
} // namespace mrmc |
|||
#endif // MRMC_EXCEPTIONS_INVALIDARGUMENTEXCEPTION_H_ |
@ -1,16 +0,0 @@ |
|||
#ifndef INVALIDSETTINGS_H_ |
|||
#define INVALIDSETTINGS_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
namespace exceptions { |
|||
|
|||
class InvalidSettings : public BaseException<InvalidSettings> |
|||
{ |
|||
}; |
|||
|
|||
} // namespace exceptions |
|||
} // namespace mrmc |
|||
|
|||
#endif // INVALIDSETTINGS_H_ |
@ -0,0 +1,14 @@ |
|||
#ifndef MRMC_EXCEPTIONS_INVALIDSETTINGSEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_INVALIDSETTINGSEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
namespace exceptions { |
|||
|
|||
MRMC_EXCEPTION_DEFINE_NEW(InvalidSettingsException) |
|||
|
|||
} // namespace exceptions |
|||
} // namespace mrmc |
|||
|
|||
#endif // MRMC_EXCEPTIONS_INVALIDSETTINGSEXCEPTION_H_ |
@ -0,0 +1,20 @@ |
|||
#ifndef MRMC_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
/*! |
|||
* @brief This exception is thrown when a memory request can't be |
|||
* fulfilled. |
|||
*/ |
|||
MRMC_EXCEPTION_DEFINE_NEW(InvalidStateException) |
|||
|
|||
} // namespace exceptions |
|||
|
|||
} // namespace mrmc |
|||
|
|||
#endif // MRMC_EXCEPTIONS_INVALIDSTATEEXCEPTION_H_ |
@ -1,56 +0,0 @@ |
|||
#ifndef MRMC_EXCEPTIONS_NO_CONVERGENCE_H_ |
|||
#define MRMC_EXCEPTIONS_NO_CONVERGENCE_H_ |
|||
|
|||
#include <exception> |
|||
|
|||
namespace mrmc { |
|||
namespace exceptions { |
|||
|
|||
//!This exception is thrown when an iterative solver failed to converge with the given maxIterations |
|||
class NoConvergence : public std::exception |
|||
{ |
|||
public: |
|||
/* The Visual C++-Version of the exception class has constructors accepting |
|||
* a char*-constant; The GCC version does not have these |
|||
* |
|||
* As the "extended" constructor is used in the sparse matrix code, a dummy |
|||
* constructor is used under linux (which will ignore the parameter) |
|||
*/ |
|||
#ifdef _WIN32 |
|||
NoConvergence() : exception("::mrmc::NoConvergence"){ |
|||
iterations = -1; |
|||
maxIterations = -1; |
|||
} |
|||
NoConvergence(const char * const s, int iterations, int maxIterations): exception(s) { |
|||
this->iterations = iterations; |
|||
this->maxIterations = maxIterations; |
|||
} |
|||
#else |
|||
NoConvergence() : exception() { |
|||
iterations = -1; |
|||
maxIterations = -1; |
|||
} |
|||
NoConvergence(const char * const s, int iterations, int maxIterations): exception() { |
|||
this->iterations = iterations; |
|||
this->maxIterations = maxIterations; |
|||
} |
|||
|
|||
#endif |
|||
virtual const char* what() const throw() |
|||
{ return "mrmc::NoConvergence"; } |
|||
|
|||
int getIterationCount() const { |
|||
return iterations; |
|||
} |
|||
int getMaxIterationCount() const { |
|||
return maxIterations; |
|||
} |
|||
private: |
|||
int iterations; |
|||
int maxIterations; |
|||
}; |
|||
|
|||
} // namespace exceptions |
|||
} // namespace mrmc |
|||
|
|||
#endif // MRMC_EXCEPTIONS_NO_CONVERGENCE_H_ |
@ -0,0 +1,17 @@ |
|||
#ifndef MRMC_EXCEPTIONS_NOCONVERGENCEEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_NOCONVERGENCEEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
namespace exceptions { |
|||
|
|||
/*! |
|||
* @brief This exception is thrown when an iterative solver failed to converge with the given maxIterations |
|||
*/ |
|||
MRMC_EXCEPTION_DEFINE_NEW(NoConvergenceException) |
|||
|
|||
} // namespace exceptions |
|||
} // namespace mrmc |
|||
|
|||
#endif // MRMC_EXCEPTIONS_NOCONVERGENCEEXCEPTION_H_ |
@ -0,0 +1,18 @@ |
|||
#ifndef MRMC_EXCEPTIONS_OUTOFRANGEEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_OUTOFRANGEEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
/* |
|||
* @briefThis exception is thrown when a parameter is not in the range of valid values |
|||
*/ |
|||
MRMC_EXCEPTION_DEFINE_NEW(OutOfRangeException) |
|||
|
|||
} // namespace exceptions |
|||
|
|||
} // namespace mrmc |
|||
#endif // MRMC_EXCEPTIONS_OUTOFRANGEEXCEPTION_H_ |
@ -0,0 +1,27 @@ |
|||
/* |
|||
* WrongFileFormatException.h |
|||
* |
|||
* Created on: 16.08.2012 |
|||
* Author: Thomas Heinemann |
|||
*/ |
|||
|
|||
#ifndef MRMC_EXCEPTIONS_WRONGFILEFORMATEXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_WRONGFILEFORMATEXCEPTION_H_ |
|||
|
|||
#include "src/exceptions/BaseException.h" |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
/*! |
|||
* @brief This exception is thrown when an input file |
|||
* contains invalid or missing keys. |
|||
*/ |
|||
MRMC_EXCEPTION_DEFINE_NEW(WrongFileFormatException) |
|||
|
|||
} //namespace exceptions |
|||
|
|||
} //namespace mrmc |
|||
|
|||
#endif /* MRMC_EXCEPTIONS_WRONGFILEFORMATEXCEPTION_H_ */ |
@ -1,33 +0,0 @@ |
|||
/* |
|||
* file_IO_exception.h |
|||
* |
|||
* Created on: 16.08.2012 |
|||
* Author: Thomas Heinemann |
|||
*/ |
|||
|
|||
#ifndef MRMC_EXCEPTIONS_FILE_IO_EXCEPTION_H_ |
|||
#define MRMC_EXCEPTIONS_FILE_IO_EXCEPTION_H_ |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
class file_IO_exception : public std::exception { |
|||
public: |
|||
#ifdef _WIN32 |
|||
file_IO_exception() : exception("::mrmc::file_IO_exception"){}; |
|||
file_IO_exception(const char * const s): exception(s) {}; |
|||
#else |
|||
file_IO_exception() {}; |
|||
file_IO_exception(const char * const s): exception() {}; |
|||
#endif |
|||
virtual const char* what() const throw(){ |
|||
{ return "mrmc::file_IO_exception"; } |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
#endif /* MRMC_EXCEPTIONS_FILE_IO_EXCEPTION_H_ */ |
@ -1,34 +0,0 @@ |
|||
#ifndef MRMC_EXCEPTIONS_INVALID_ARGUMENT_H_ |
|||
#define MRMC_EXCEPTIONS_INVALID_ARGUMENT_H_ |
|||
|
|||
#include <exception> |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
//!This exception is thrown when a parameter is invalid in this context |
|||
class invalid_argument : public std::exception |
|||
{ |
|||
public: |
|||
/* The Visual C++-Version of the exception class has constructors accepting |
|||
* a char*-constant; The GCC version does not have these |
|||
* |
|||
* As the "extended" constructor is used in the sparse matrix code, a dummy |
|||
* constructor is used under linux (which will ignore the parameter) |
|||
*/ |
|||
#ifdef _WIN32 |
|||
invalid_argument() : exception("::mrmc::invalid_argument"){} |
|||
invalid_argument(const char * const s): exception(s) {} |
|||
#else |
|||
invalid_argument() : exception() {} |
|||
invalid_argument(const char * const s): exception() {} |
|||
#endif |
|||
virtual const char* what() const throw() |
|||
{ return "mrmc::invalid_argument"; } |
|||
}; |
|||
|
|||
} // namespace exceptions |
|||
|
|||
} // namespace mrmc |
|||
#endif // MRMC_EXCEPTIONS_INVALID_ARGUMENT_H_ |
@ -1,37 +0,0 @@ |
|||
#ifndef MRMC_EXCEPTIONS_INVALID_STATE_H_ |
|||
#define MRMC_EXCEPTIONS_INVALID_STATE_H_ |
|||
|
|||
#include <exception> |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
//!This exception is thrown when a memory request can't be |
|||
//!fulfilled. |
|||
class invalid_state : public std::exception |
|||
{ |
|||
public: |
|||
/* The Visual C++-Version of the exception class has constructors accepting |
|||
* a char*-constant; The GCC version does not have these |
|||
* |
|||
* As the "extended" constructor is used in the sparse matrix code, a dummy |
|||
* constructor is used under linux (which will ignore the parameter) |
|||
*/ |
|||
#ifdef _WIN32 |
|||
invalid_state() : exception("::mrmc::invalid_state"){} |
|||
invalid_state(const char * const s): exception(s) {} |
|||
#else |
|||
invalid_state() : exception() {} |
|||
invalid_state(const char * const s): exception() {} |
|||
|
|||
#endif |
|||
virtual const char* what() const throw() |
|||
{ return "mrmc::invalid_state"; } |
|||
}; |
|||
|
|||
} // namespace exceptions |
|||
|
|||
} // namespace mrmc |
|||
|
|||
#endif // MRMC_EXCEPTIONS_INVALID_STATE_H_ |
@ -1,34 +0,0 @@ |
|||
#ifndef MRMC_EXCEPTIONS_OUT_OF_RANGE_H_ |
|||
#define MRMC_EXCEPTIONS_OUT_OF_RANGE_H_ |
|||
|
|||
#include <exception> |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
//!This exception is thrown when a parameter is not in the range of valid values |
|||
class out_of_range : public std::exception |
|||
{ |
|||
public: |
|||
/* The Visual C++-Version of the exception class has constructors accepting |
|||
* a char*-constant; The GCC version does not have these |
|||
* |
|||
* As the "extended" constructor is used in the sparse matrix code, a dummy |
|||
* constructor is used under linux (which will ignore the parameter) |
|||
*/ |
|||
#ifdef _WIN32 |
|||
out_of_range() : exception("::mrmc::out_of_range"){} |
|||
out_of_range(const char * const s): exception(s) {} |
|||
#else |
|||
out_of_range() : exception() {} |
|||
out_of_range(const char * const s): exception() {} |
|||
#endif |
|||
virtual const char* what() const throw() |
|||
{ return "mrmc::out_of_range"; } |
|||
}; |
|||
|
|||
} // namespace exceptions |
|||
|
|||
} // namespace mrmc |
|||
#endif // MRMC_EXCEPTIONS_OUT_OF_RANGE_H_ |
@ -1,35 +0,0 @@ |
|||
/* |
|||
* wrong_file_format.h |
|||
* |
|||
* Created on: 16.08.2012 |
|||
* Author: Thomas Heinemann |
|||
*/ |
|||
|
|||
#ifndef WRONG_FILE_FORMAT_H_ |
|||
#define WRONG_FILE_FORMAT_H_ |
|||
|
|||
#include <exception> |
|||
|
|||
namespace mrmc { |
|||
|
|||
namespace exceptions { |
|||
|
|||
class wrong_file_format : public std::exception { |
|||
public: |
|||
#ifdef _WIN32 |
|||
wrong_file_format() : exception("::mrmc::wrong_file_format"){}; |
|||
wrong_file_format(const char * const s): exception(s) {}; |
|||
#else |
|||
wrong_file_format() {}; |
|||
wrong_file_format(const char * const s): exception() {}; |
|||
#endif |
|||
virtual const char* what() const throw(){ |
|||
{ return "mrmc::wrong_file_format"; } |
|||
} |
|||
}; |
|||
|
|||
} //namespace exceptions |
|||
|
|||
} //namespace mrmc |
|||
|
|||
#endif /* WRONG_FILE_FORMAT_H_ */ |
@ -0,0 +1,33 @@ |
|||
#ifndef MRMC_PARSER_PRCTLPARSER_H_ |
|||
#define MRMC_PARSER_PRCTLPARSER_H_ |
|||
|
|||
#include "src/formula/PctlFormula.h" |
|||
#include "src/parser/Parser.h" |
|||
|
|||
namespace mrmc { |
|||
namespace parser { |
|||
|
|||
/*! |
|||
* @brief Load PRCTL file |
|||
*/ |
|||
class PrctlParser : Parser |
|||
{ |
|||
public: |
|||
PrctlParser(const char * filename); |
|||
|
|||
/*! |
|||
* @brief return formula object parsed from file. |
|||
*/ |
|||
mrmc::formula::PctlFormula<double>* getFormula() |
|||
{ |
|||
return this->formula; |
|||
} |
|||
|
|||
private: |
|||
mrmc::formula::PctlFormula<double>* formula; |
|||
}; |
|||
|
|||
} // namespace parser |
|||
} // namespace mrmc |
|||
|
|||
#endif /* MRMC_PARSER_PRCTLPARSER_H_ */ |
@ -1,33 +0,0 @@ |
|||
#ifndef READPRCTLFILE_H_ |
|||
#define READPRCTLFILE_H_ |
|||
|
|||
#include "src/formula/PCTLformula.h" |
|||
#include "src/parser/parser.h" |
|||
|
|||
namespace mrmc { |
|||
namespace parser { |
|||
|
|||
/*! |
|||
* @brief Load PRCTL file |
|||
*/ |
|||
class PRCTLParser : Parser |
|||
{ |
|||
public: |
|||
PRCTLParser(const char * filename); |
|||
|
|||
/*! |
|||
* @brief return formula object parsed from file. |
|||
*/ |
|||
mrmc::formula::PCTLFormula<double>* getFormula() |
|||
{ |
|||
return this->formula; |
|||
} |
|||
|
|||
private: |
|||
mrmc::formula::PCTLFormula<double>* formula; |
|||
}; |
|||
|
|||
} // namespace parser |
|||
} // namespace mrmc |
|||
|
|||
#endif /* READPRCTLFILE_H_ */ |
@ -1,13 +1,13 @@ |
|||
/*
|
|||
* ioUtility.cpp |
|||
* IoUtility.cpp |
|||
* |
|||
* Created on: 17.10.2012 |
|||
* Author: Thomas Heinemann |
|||
*/ |
|||
|
|||
#include "src/utility/ioUtility.h"
|
|||
#include "src/parser/readTraFile.h"
|
|||
#include "src/parser/readLabFile.h"
|
|||
#include "src/utility/IoUtility.h"
|
|||
#include "src/parser/TraParser.h"
|
|||
#include "src/parser/LabParser.h"
|
|||
|
|||
#include <fstream>
|
|||
|
@ -1,15 +1,21 @@ |
|||
#pragma once |
|||
#ifndef MRMC_UTILITY_OSDETECTION_H_ |
|||
#define MRMC_UTILITY_OSDETECTION_H_ |
|||
|
|||
#if defined __linux__ || defined __linux |
|||
# define LINUX |
|||
#elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__ |
|||
# define MACOSX |
|||
# define _DARWIN_USE_64_BIT_INODE |
|||
# include <sys/mman.h> |
|||
# include <unistd.h> |
|||
#elif defined _WIN32 || defined _WIN64 |
|||
# define WINDOWS |
|||
# define NOMINMAX |
|||
# include <Windows.h> |
|||
# include <winnt.h> |
|||
# define strncpy strncpy_s |
|||
#else |
|||
# error Could not detect Operating System |
|||
#endif |
|||
|
|||
#endif // MRMC_UTILITY_OSDETECTION_H_ |
@ -1,7 +1,7 @@ |
|||
#include "gtest/gtest.h"
|
|||
|
|||
#include "Eigen/Sparse"
|
|||
#include "src/exceptions/invalid_argument.h"
|
|||
#include "src/exceptions/InvalidArgumentException.h"
|
|||
#include "boost/integer/integer_mask.hpp"
|
|||
|
|||
TEST(EigenSparseMatrixTest, BasicReadWriteTest) { |
@ -1,11 +1,11 @@ |
|||
#include "gtest/gtest.h"
|
|||
|
|||
#include "Eigen/Sparse"
|
|||
#include "src/exceptions/invalid_argument.h"
|
|||
#include "src/exceptions/InvalidArgumentException.h"
|
|||
#include "boost/integer/integer_mask.hpp"
|
|||
#include <vector>
|
|||
|
|||
#include "reward/reward_model.h"
|
|||
#include "reward/RewardModel.h"
|
|||
|
|||
TEST(RewardModelTest, ReadWriteTest) { |
|||
// 50 entries
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue