|
@ -1,3 +1,4 @@ |
|
|
|
|
|
#include <src/modelchecker/results/ExplicitQualitativeCheckResult.h>
|
|
|
#include "gtest/gtest.h"
|
|
|
#include "gtest/gtest.h"
|
|
|
#include "storm-config.h"
|
|
|
#include "storm-config.h"
|
|
|
#include "src/parser/PrismParser.h"
|
|
|
#include "src/parser/PrismParser.h"
|
|
@ -7,7 +8,7 @@ |
|
|
#include "src/builder/ExplicitPrismModelBuilder.h"
|
|
|
#include "src/builder/ExplicitPrismModelBuilder.h"
|
|
|
|
|
|
|
|
|
#include "src/models/sparse/StandardRewardModel.h"
|
|
|
#include "src/models/sparse/StandardRewardModel.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "src/modelchecker/prctl/SparseMdpPrctlModelChecker.h"
|
|
|
|
|
|
|
|
|
TEST(MilpPermissiveSchedulerTest, DieSelection) { |
|
|
TEST(MilpPermissiveSchedulerTest, DieSelection) { |
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die_c1.nm"); |
|
|
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die_c1.nm"); |
|
@ -29,15 +30,31 @@ TEST(MilpPermissiveSchedulerTest, DieSelection) { |
|
|
|
|
|
|
|
|
std::shared_ptr<storm::models::sparse::Mdp<double>> mdp = storm::builder::ExplicitPrismModelBuilder<double>::translateProgram(program, options)->as<storm::models::sparse::Mdp<double>>(); |
|
|
std::shared_ptr<storm::models::sparse::Mdp<double>> mdp = storm::builder::ExplicitPrismModelBuilder<double>::translateProgram(program, options)->as<storm::models::sparse::Mdp<double>>(); |
|
|
|
|
|
|
|
|
boost::optional<storm::ps::MemorylessDeterministicPermissiveScheduler> perms = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula02); |
|
|
|
|
|
|
|
|
boost::optional<storm::ps::SubMDPPermissiveScheduler> perms = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula02); |
|
|
EXPECT_NE(perms, boost::none); |
|
|
EXPECT_NE(perms, boost::none); |
|
|
boost::optional<storm::ps::MemorylessDeterministicPermissiveScheduler> perms2 = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula001); |
|
|
|
|
|
|
|
|
boost::optional<storm::ps::SubMDPPermissiveScheduler> perms2 = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula001); |
|
|
EXPECT_EQ(perms2, boost::none); |
|
|
EXPECT_EQ(perms2, boost::none); |
|
|
|
|
|
|
|
|
boost::optional<storm::ps::MemorylessDeterministicPermissiveScheduler> perms3 = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula02b); |
|
|
|
|
|
|
|
|
boost::optional<storm::ps::SubMDPPermissiveScheduler> perms3 = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula02b); |
|
|
EXPECT_EQ(perms3, boost::none); |
|
|
EXPECT_EQ(perms3, boost::none); |
|
|
boost::optional<storm::ps::MemorylessDeterministicPermissiveScheduler> perms4 = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula001b); |
|
|
|
|
|
|
|
|
boost::optional<storm::ps::SubMDPPermissiveScheduler> perms4 = storm::ps::computePermissiveSchedulerViaMILP(mdp, formula001b); |
|
|
EXPECT_NE(perms4, boost::none); |
|
|
EXPECT_NE(perms4, boost::none); |
|
|
|
|
|
|
|
|
|
|
|
storm::modelchecker::SparseMdpPrctlModelChecker<storm::models::sparse::Mdp<double>> checker0(*mdp, std::unique_ptr<storm::utility::solver::MinMaxLinearEquationSolverFactory<double>>(new storm::utility::solver::MinMaxLinearEquationSolverFactory<double>(storm::solver::EquationSolverTypeSelection::Native))); |
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<storm::modelchecker::CheckResult> result0 = checker0.check(formula02); |
|
|
|
|
|
storm::modelchecker::ExplicitQualitativeCheckResult& qualitativeResult0 = result0->asExplicitQualitativeCheckResult(); |
|
|
|
|
|
|
|
|
|
|
|
ASSERT_FALSE(qualitativeResult0[0]); |
|
|
|
|
|
|
|
|
|
|
|
auto submdp = perms->apply(); |
|
|
|
|
|
storm::modelchecker::SparseMdpPrctlModelChecker<storm::models::sparse::Mdp<double>> checker1(submdp, std::unique_ptr<storm::utility::solver::MinMaxLinearEquationSolverFactory<double>>(new storm::utility::solver::MinMaxLinearEquationSolverFactory<double>(storm::solver::EquationSolverTypeSelection::Native))); |
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<storm::modelchecker::CheckResult> result1 = checker1.check(formula02); |
|
|
|
|
|
storm::modelchecker::ExplicitQualitativeCheckResult& qualitativeResult1 = result1->asExplicitQualitativeCheckResult(); |
|
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(qualitativeResult1[0]); |
|
|
|
|
|
|
|
|
//
|
|
|
//
|
|
|
|
|
|
|
|
|
} |
|
|
} |