8#include "storm-config.h"
22#define STATE_COUNT 6ul
23#define CHOICE_COUNT 7ul
25TEST(MarkovAutomatonSparseTransitionParserTest, NonExistingFile) {
29 storm::exceptions::FileIoException);
32TEST(MarkovAutomatonSparseTransitionParserTest, BasicParsing) {
34 std::string filename = STORM_TEST_RESOURCES_DIR
"/tra/ma_general.tra";
84 ASSERT_EQ(2, cIter->getValue());
86 ASSERT_EQ(1, cIter->getValue());
88 ASSERT_EQ(1, cIter->getValue());
90 ASSERT_EQ(2, cIter->getValue());
92 ASSERT_EQ(4, cIter->getValue());
94 ASSERT_EQ(8, cIter->getValue());
96 ASSERT_EQ(0.5, cIter->getValue());
98 ASSERT_EQ(0.5, cIter->getValue());
100 ASSERT_EQ(1, cIter->getValue());
102 ASSERT_EQ(0.5, cIter->getValue());
104 ASSERT_EQ(0.5, cIter->getValue());
106 ASSERT_EQ(1, cIter->getValue());
108 ASSERT_EQ(transitionMatrix.
end(), cIter);
111TEST(MarkovAutomatonSparseTransitionParserTest, Whitespaces) {
113 std::string filename = STORM_TEST_RESOURCES_DIR
"/tra/ma_whitespaces.tra";
163 ASSERT_EQ(2, cIter->getValue());
165 ASSERT_EQ(1, cIter->getValue());
167 ASSERT_EQ(1, cIter->getValue());
169 ASSERT_EQ(2, cIter->getValue());
171 ASSERT_EQ(4, cIter->getValue());
173 ASSERT_EQ(8, cIter->getValue());
175 ASSERT_EQ(0.5, cIter->getValue());
177 ASSERT_EQ(0.5, cIter->getValue());
179 ASSERT_EQ(1, cIter->getValue());
181 ASSERT_EQ(0.5, cIter->getValue());
183 ASSERT_EQ(0.5, cIter->getValue());
185 ASSERT_EQ(1, cIter->getValue());
187 ASSERT_EQ(transitionMatrix.
end(), cIter);
190TEST(MarkovAutomatonSparseTransitionParserTest, FixDeadlocks) {
210TEST(MarkovAutomatonSparseTransitionParserTest, DontFixDeadlocks) {
216 storm::exceptions::WrongFormatException);
TEST(MarkovAutomatonSparseTransitionParserTest, NonExistingFile)
A class providing the functionality to parse the transitions of a Markov automaton.
static Result parseMarkovAutomatonTransitions(std::string const &filename)
Parses the given file under the assumption that it contains a Markov automaton specified in the appro...
std::unique_ptr< storm::settings::SettingMemento > overrideDontFixDeadlocksSet(bool stateToSet)
Overrides the option to not fix deadlocks by setting it to the specified value.
size_t size() const
Retrieves the number of bits this bit vector can store.
uint_fast64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
bool get(uint_fast64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
A class that holds a possibly non-square matrix in the compressed row storage format.
index_type getEntryCount() const
Returns the number of entries in the matrix.
const_iterator begin(index_type row) const
Retrieves an iterator that points to the beginning of the given row.
const_iterator end(index_type row) const
Retrieves an iterator that points past the end of the given row.
index_type getRowGroupCount() const
Returns the number of row groups in the matrix.
index_type getColumnCount() const
Returns the number of columns of the matrix.
std::vector< MatrixEntry< index_type, value_type > >::const_iterator const_iterator
std::vector< index_type > const & getRowGroupIndices() const
Returns the grouping of rows of this matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
storm::settings::modules::BuildSettings & mutableBuildSettings()
Retrieves the build settings in a mutable form.
#define STORM_SILENT_ASSERT_THROW(statement, expected_exception)
A structure representing the result of the parser.
storm::storage::BitVector markovianChoices
A bit vector indicating which choices are Markovian. By duality, all other choices are probabilitic.
storm::storage::BitVector markovianStates
A bit vector indicating which states possess a Markovian choice.
std::vector< ValueType > exitRates
A vector that stores the exit rates for each state. For all states that do not possess Markovian choi...
storm::storage::SparseMatrixBuilder< ValueType > transitionMatrixBuilder
A matrix representing the transitions of the model.