1#include "storm-config.h"
11TEST(NondeterministicModelParserTest, NonExistingFile) {
14 STORM_TEST_RESOURCES_DIR
"/nonExistingFile.not"),
15 storm::exceptions::FileIoException);
18TEST(NondeterministicModelParserTest, BasicMdpParsing) {
21 STORM_TEST_RESOURCES_DIR
"/tra/mdp_general.tra", STORM_TEST_RESOURCES_DIR
"/lab/mdp_general.lab", STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.state.rew",
22 STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.trans.rew"));
38 for (uint_fast64_t i = 0; i < mdp.
getRewardModel(
"").getStateRewardVector().size(); i++) {
41 ASSERT_EQ(158.32, rewardSum);
44 ASSERT_EQ(17ul, mdp.
getRewardModel(
"").getTransitionRewardMatrix().getEntryCount());
46 for (uint_fast64_t i = 0; i < mdp.
getRewardModel(
"").getTransitionRewardMatrix().getRowCount(); i++) {
47 rewardSum += mdp.
getRewardModel(
"").getTransitionRewardMatrix().getRowSum(i);
49 ASSERT_EQ(1376.864, rewardSum);
52TEST(NondeterministicModelParserTest, MismatchedFiles) {
57 STORM_TEST_RESOURCES_DIR
"/lab/mdp_general.lab"),
58 storm::exceptions::OutOfRangeException);
62 STORM_TEST_RESOURCES_DIR
"/lab/mdp_mismatched.lab",
63 STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.state.rew"),
64 storm::exceptions::OutOfRangeException);
68 STORM_TEST_RESOURCES_DIR
"/lab/mdp_mismatched.lab",
"",
69 STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.trans.rew"),
70 storm::exceptions::OutOfRangeException);
74 STORM_TEST_RESOURCES_DIR
"/lab/mdp_mismatched.lab",
"",
75 STORM_TEST_RESOURCES_DIR
"/rew/mdp_mismatched.trans.rew"),
76 storm::exceptions::OutOfRangeException);
TEST(NondeterministicModelParserTest, NonExistingFile)
std::size_t getNumberOfLabels() const
Returns the number of labels managed by this object.
This class represents a (discrete-time) Markov decision process.
std::set< std::string > getLabelsOfState(storm::storage::sparse::state_type state) const
Retrieves the set of labels attached to the given state.
virtual bool hasRewardModel(std::string const &rewardModelName) const override
Retrieves whether the model has a reward model with the given name.
storm::models::sparse::StateLabeling const & getStateLabeling() const
Returns the state labeling associated with this model.
virtual uint_fast64_t getNumberOfTransitions() const override
Returns the number of (non-zero) transitions of the model.
virtual uint_fast64_t getNumberOfStates() const override
Returns the number of states of the model.
RewardModelType const & getRewardModel(std::string const &rewardModelName) const
Retrieves the reward model with the given name, if one exists.
storm::storage::BitVector const & getInitialStates() const
Retrieves the initial states of the model.
uint_fast64_t getNumberOfChoices(uint_fast64_t state) const
Loads a nondeterministic model (Mdp or Ctmdp) from files.
uint64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
#define STORM_SILENT_ASSERT_THROW(statement, expected_exception)