Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
MilpPermissiveSchedulerTest.cpp
Go to the documentation of this file.
1#include "storm-config.h"
13#include "test/storm_gtest.h"
14
15#ifdef STORM_HAVE_GUROBI
16
17TEST(MilpPermissiveSchedulerTest, DieSelection) {
19 GTEST_SKIP();
20 }
22
23 storm::prism::Program program = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/mdp/die_c1.nm");
25 std::string formulaString = "";
26 formulaString += "P>=0.10 [ F \"one\"];\n";
27 formulaString += "P>=0.17 [ F \"one\"];\n";
28 formulaString += "P<=0.10 [ F \"one\"];\n";
29 formulaString += "P<=0.17 [ F \"one\"];\n";
30 auto formulas = formulaParser.parseFromString(formulaString);
31
32 auto const& formula02 = formulas[0].getRawFormula()->asProbabilityOperatorFormula();
33 ASSERT_TRUE(storm::logic::isLowerBound(formula02.getComparisonType()));
34 auto const& formula001 = formulas[1].getRawFormula()->asProbabilityOperatorFormula();
35 auto const& formula02b = formulas[2].getRawFormula()->asProbabilityOperatorFormula();
36 auto const& formula001b = formulas[3].getRawFormula()->asProbabilityOperatorFormula();
37
38 // Customize and perform model-building.
41 std::shared_ptr<storm::models::sparse::Mdp<double>> mdp =
43
44 boost::optional<storm::ps::SubMDPPermissiveScheduler<>> perms = storm::ps::computePermissiveSchedulerViaMILP<>(*mdp, formula02);
45 EXPECT_TRUE(perms.is_initialized());
46 boost::optional<storm::ps::SubMDPPermissiveScheduler<>> perms2 = storm::ps::computePermissiveSchedulerViaMILP<>(*mdp, formula001);
47 EXPECT_FALSE(perms2.is_initialized());
48
49 boost::optional<storm::ps::SubMDPPermissiveScheduler<>> perms3 = storm::ps::computePermissiveSchedulerViaMILP<>(*mdp, formula02b);
50 EXPECT_FALSE(perms3.is_initialized());
51 boost::optional<storm::ps::SubMDPPermissiveScheduler<>> perms4 = storm::ps::computePermissiveSchedulerViaMILP<>(*mdp, formula001b);
52 EXPECT_TRUE(perms4.is_initialized());
53
55
56 std::unique_ptr<storm::modelchecker::CheckResult> result0 = checker0.check(env, formula02);
58
59 ASSERT_FALSE(qualitativeResult0[0]);
60
61 auto submdp = perms->apply();
63
64 std::unique_ptr<storm::modelchecker::CheckResult> result1 = checker1.check(env, formula02);
66
67 EXPECT_TRUE(qualitativeResult1[0]);
68}
69
70#endif
TEST(OrderTest, Simple)
Definition OrderTest.cpp:8
BuilderOptions & setBuildAllLabels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
BuilderOptions & setBuildChoiceLabels(bool newValue=true)
Should the choice labels be built?
std::shared_ptr< storm::models::sparse::Model< ValueType, RewardModelType > > build()
Convert the program given at construction time to an abstract model.
std::shared_ptr< ExpressionManager > getSharedPointer()
Retrieves a shared pointer to the expression manager.
ExplicitQualitativeCheckResult & asExplicitQualitativeCheckResult()
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:14
static storm::prism::Program parse(std::string const &filename, bool prismCompatability=false)
Parses the given file into the PRISM storage classes assuming it complies with the PRISM syntax.
storm::expressions::ExpressionManager & getManager() const
Retrieves the manager responsible for the expressions of this program.
Definition Program.cpp:2359
bool isLowerBound(ComparisonType t)