@ -8,6 +8,7 @@
# include "src/exceptions/NotImplementedException.h"
# include "src/utility/macros.h"
namespace storm {
namespace ps {
@ -16,14 +17,14 @@ namespace storm {
assert ( safeProp . getSubformula ( ) . isEventuallyFormula ( ) ) ;
auto backwardTransitions = mdp - > getBackwardTransitions ( ) ;
storm : : storage : : BitVector goalstates = propMC . check ( safeProp . getSubformula ( ) . asEventuallyFormula ( ) . getSubformula ( ) ) - > asExplicitQualitativeCheckResult ( ) . getTruthValuesVector ( ) ;
goalstates = storm : : utility : : graph : : performProb1E ( * mdp , backwardTransitions , storm : : storage : : BitVector ( goalstates . size ( ) , true ) , goalstates ) ;
goalstates = storm : : utility : : graph : : performProb1A ( * mdp , backwardTransitions , storm : : storage : : BitVector ( goalstates . size ( ) , true ) , goalstates ) ;
storm : : storage : : BitVector sinkstates = storm : : utility : : graph : : performProb0A ( * mdp , backwardTransitions , storm : : storage : : BitVector ( goalstates . size ( ) , true ) , goalstates ) ;
auto solver = storm : : utility : : solver : : getLpSolver ( " Gurobi " , storm : : solver : : LpSolverTypeSelection : : Gurobi ) ;
MilpPermissiveSchedulerComputation comp ( * solver , mdp , goalstates , sinkstates ) ;
STORM_LOG_THROW ( ! storm : : logic : : isStrict ( safeProp . getComparisonType ( ) ) , storm : : exceptions : : NotImplementedException , " Strict bounds are not supported " ) ;
comp . calculatePermissiveScheduler ( storm : : logic : : isLowerBound ( safeProp . getComparisonType ( ) ) , safeProp . getBound ( ) ) ;
comp . dumpLpToFile ( " milpdump.lp " ) ;
//comp.dumpLpToFile("milpdump.lp");
std : : cout < < " Found Solution: " < < ( comp . foundSolution ( ) ? " yes " : " no " ) < < std : : endl ;
if ( comp . foundSolution ( ) ) {
return boost : : optional < SubMDPPermissiveScheduler > ( comp . getScheduler ( ) ) ;
@ -37,7 +38,20 @@ namespace storm {
}
boost : : optional < SubMDPPermissiveScheduler > computerPermissiveSchedulerViaSMT ( std : : shared_ptr < storm : : models : : sparse : : Mdp < double > > mdp , storm : : logic : : ProbabilityOperatorFormula const & safeProp ) {
storm : : modelchecker : : SparsePropositionalModelChecker < storm : : models : : sparse : : Mdp < double > > propMC ( * mdp ) ;
assert ( safeProp . getSubformula ( ) . isEventuallyFormula ( ) ) ;
auto backwardTransitions = mdp - > getBackwardTransitions ( ) ;
storm : : storage : : BitVector goalstates = propMC . check ( safeProp . getSubformula ( ) . asEventuallyFormula ( ) . getSubformula ( ) ) - > asExplicitQualitativeCheckResult ( ) . getTruthValuesVector ( ) ;
goalstates = storm : : utility : : graph : : performProb1A ( * mdp , backwardTransitions , storm : : storage : : BitVector ( goalstates . size ( ) , true ) , goalstates ) ;
storm : : storage : : BitVector sinkstates = storm : : utility : : graph : : performProb0A ( * mdp , backwardTransitions , storm : : storage : : BitVector ( goalstates . size ( ) , true ) , goalstates ) ;
SmtPermissiveSchedulerComputation comp ( mdp , goalstates , sinkstates )
if ( comp . foundSolution ( ) ) {
return boost : : optional < SubMDPPermissiveScheduler > ( comp . getScheduler ( ) ) ;
} else {
return boost : : optional < SubMDPPermissiveScheduler > ( ) ;
}
}
}
}