1#include "storm-config.h"
12TEST(NondeterministicModelParserTest, NonExistingFile) {
15 STORM_TEST_RESOURCES_DIR
"/nonExistingFile.not"),
16 storm::exceptions::FileIoException);
19TEST(NondeterministicModelParserTest, BasicMdpParsing) {
22 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",
23 STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.trans.rew"));
39 for (uint_fast64_t i = 0; i < mdp.
getRewardModel(
"").getStateRewardVector().size(); i++) {
42 ASSERT_EQ(158.32, rewardSum);
45 ASSERT_EQ(17ul, mdp.
getRewardModel(
"").getTransitionRewardMatrix().getEntryCount());
47 for (uint_fast64_t i = 0; i < mdp.
getRewardModel(
"").getTransitionRewardMatrix().getRowCount(); i++) {
48 rewardSum += mdp.
getRewardModel(
"").getTransitionRewardMatrix().getRowSum(i);
50 ASSERT_EQ(1376.864, rewardSum);
53TEST(NondeterministicModelParserTest, MismatchedFiles) {
58 STORM_TEST_RESOURCES_DIR
"/lab/mdp_general.lab"),
59 storm::exceptions::OutOfRangeException);
63 STORM_TEST_RESOURCES_DIR
"/lab/mdp_mismatched.lab",
64 STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.state.rew"),
65 storm::exceptions::OutOfRangeException);
69 STORM_TEST_RESOURCES_DIR
"/lab/mdp_mismatched.lab",
"",
70 STORM_TEST_RESOURCES_DIR
"/rew/mdp_general.trans.rew"),
71 storm::exceptions::OutOfRangeException);
75 STORM_TEST_RESOURCES_DIR
"/lab/mdp_mismatched.lab",
"",
76 STORM_TEST_RESOURCES_DIR
"/rew/mdp_mismatched.trans.rew"),
77 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.
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.
#define STORM_SILENT_ASSERT_THROW(statement, expected_exception)