Browse Source

fixed permissive scheduler test (which is only compiled when gurobi is there)

tempestpy_adaptions
TimQu 7 years ago
parent
commit
e38ec10459
  1. 10
      src/test/storm/permissiveschedulers/MilpPermissiveSchedulerTest.cpp

10
src/test/storm/permissiveschedulers/MilpPermissiveSchedulerTest.cpp

@ -3,9 +3,11 @@
#include "storm-config.h" #include "storm-config.h"
#include "storm/parser/PrismParser.h" #include "storm/parser/PrismParser.h"
#include "storm/parser/FormulaParser.h" #include "storm/parser/FormulaParser.h"
#include "storm/storage/expressions/ExpressionManager.h"
#include "storm/logic/Formulas.h" #include "storm/logic/Formulas.h"
#include "storm/permissivesched/PermissiveSchedulers.h" #include "storm/permissivesched/PermissiveSchedulers.h"
#include "storm/builder/ExplicitModelBuilder.h" #include "storm/builder/ExplicitModelBuilder.h"
#include "storm/solver/StandardMinMaxLinearEquationSolver.h"
#include "storm/models/sparse/StandardRewardModel.h" #include "storm/models/sparse/StandardRewardModel.h"
#include "storm/modelchecker/prctl/SparseMdpPrctlModelChecker.h" #include "storm/modelchecker/prctl/SparseMdpPrctlModelChecker.h"
@ -13,7 +15,7 @@
#ifdef STORM_HAVE_GUROBI #ifdef STORM_HAVE_GUROBI
TEST(MilpPermissiveSchedulerTest, DieSelection) { TEST(MilpPermissiveSchedulerTest, DieSelection) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/builder/die_c1.nm");
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/mdp/die_c1.nm");
storm::parser::FormulaParser formulaParser(program.getManager().getSharedPointer()); storm::parser::FormulaParser formulaParser(program.getManager().getSharedPointer());
auto formula02 = formulaParser.parseSingleFormulaFromString("P>=0.10 [ F \"one\"]")->asProbabilityOperatorFormula(); auto formula02 = formulaParser.parseSingleFormulaFromString("P>=0.10 [ F \"one\"]")->asProbabilityOperatorFormula();
@ -38,7 +40,7 @@ TEST(MilpPermissiveSchedulerTest, DieSelection) {
boost::optional<storm::ps::SubMDPPermissiveScheduler<>> 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::solver::MinMaxLinearEquationSolverFactory<double>>(new storm::solver::MinMaxLinearEquationSolverFactory<double>(storm::solver::EquationSolverTypeSelection::Native)));
storm::modelchecker::SparseMdpPrctlModelChecker<storm::models::sparse::Mdp<double>> checker0(*mdp, std::unique_ptr<storm::solver::MinMaxLinearEquationSolverFactory<double>>(new storm::solver::StandardMinMaxLinearEquationSolverFactory<double>(storm::solver::EquationSolverType::Native)));
std::unique_ptr<storm::modelchecker::CheckResult> result0 = checker0.check(formula02); std::unique_ptr<storm::modelchecker::CheckResult> result0 = checker0.check(formula02);
storm::modelchecker::ExplicitQualitativeCheckResult& qualitativeResult0 = result0->asExplicitQualitativeCheckResult(); storm::modelchecker::ExplicitQualitativeCheckResult& qualitativeResult0 = result0->asExplicitQualitativeCheckResult();
@ -46,15 +48,13 @@ TEST(MilpPermissiveSchedulerTest, DieSelection) {
ASSERT_FALSE(qualitativeResult0[0]); ASSERT_FALSE(qualitativeResult0[0]);
auto submdp = perms->apply(); auto submdp = perms->apply();
storm::modelchecker::SparseMdpPrctlModelChecker<storm::models::sparse::Mdp<double>> checker1(submdp, std::unique_ptr<storm::solver::MinMaxLinearEquationSolverFactory<double>>(new storm::solver::MinMaxLinearEquationSolverFactory<double>(storm::solver::EquationSolverTypeSelection::Native)));
storm::modelchecker::SparseMdpPrctlModelChecker<storm::models::sparse::Mdp<double>> checker1(submdp, std::unique_ptr<storm::solver::MinMaxLinearEquationSolverFactory<double>>(new storm::solver::StandardMinMaxLinearEquationSolverFactory<double>(storm::solver::EquationSolverType::Native)));
std::unique_ptr<storm::modelchecker::CheckResult> result1 = checker1.check(formula02); std::unique_ptr<storm::modelchecker::CheckResult> result1 = checker1.check(formula02);
storm::modelchecker::ExplicitQualitativeCheckResult& qualitativeResult1 = result1->asExplicitQualitativeCheckResult(); storm::modelchecker::ExplicitQualitativeCheckResult& qualitativeResult1 = result1->asExplicitQualitativeCheckResult();
EXPECT_TRUE(qualitativeResult1[0]); EXPECT_TRUE(qualitativeResult1[0]);
//
} }
#endif #endif
Loading…
Cancel
Save