|
|
@ -13,8 +13,6 @@ |
|
|
|
|
|
|
|
#include "src/exceptions/UnexpectedException.h"
|
|
|
|
|
|
|
|
#include "src/logic/CloneVisitor.h"
|
|
|
|
|
|
|
|
namespace storm { |
|
|
|
namespace modelchecker { |
|
|
|
namespace helper { |
|
|
@ -25,8 +23,6 @@ namespace storm { |
|
|
|
ResultData resultData; |
|
|
|
resultData.overApproximation() = storm::storage::geometry::Polytope<RationalNumberType>::createUniversalPolytope(); |
|
|
|
resultData.underApproximation() = storm::storage::geometry::Polytope<RationalNumberType>::createEmptyPolytope(); |
|
|
|
resultData.stopWatchWeightVectorChecker.pause(); |
|
|
|
resultData.stopWatchWeightVectorChecker.reset(); |
|
|
|
|
|
|
|
// Set the maximum gap between lower and upper bound of the weightVectorChecker result.
|
|
|
|
// This is the maximal edge length of the box we have to consider around each computed point
|
|
|
@ -151,7 +147,6 @@ namespace storm { |
|
|
|
if(optimizationRes.second) { |
|
|
|
resultData.setPrecisionOfResult(optimizationRes.first[optimizingObjIndex] - thresholds[optimizingObjIndex]); |
|
|
|
STORM_LOG_DEBUG("Solution can be improved by at most " << resultData.template getPrecisionOfResult<double>()); |
|
|
|
std::cout << "Current precision of the numerical result is " << resultData.template getPrecisionOfResult<double>() << std::endl; |
|
|
|
} |
|
|
|
if(targetPrecisionReached(resultData) || maxStepsPerformed(resultData)) { |
|
|
|
resultData.setOptimumIsAchievable(checkIfThresholdsAreSatisfied(resultData.underApproximation(), thresholds, strictThresholds)); |
|
|
@ -170,58 +165,6 @@ namespace storm { |
|
|
|
WeightVector direction(preprocessorData.objectives.size(), storm::utility::zero<RationalNumberType>()); |
|
|
|
direction[objIndex] = storm::utility::one<RationalNumberType>(); |
|
|
|
performRefinementStep(std::move(direction), preprocessorData.produceSchedulers, weightVectorChecker, resultData); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO remove this code..
|
|
|
|
std::cout << "multi(" << preprocessorData.originalFormula.getSubformula(0); |
|
|
|
for(uint_fast64_t subFIndex = 1; subFIndex < preprocessorData.originalFormula.getNumberOfSubformulas(); ++subFIndex) { |
|
|
|
std::cout << ", "; |
|
|
|
RationalNumberType thresholdValue = |
|
|
|
storm::utility::convertNumber<RationalNumberType>(resultData.refinementSteps().back().getLowerBoundPoint()[subFIndex]) * storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationFactor) + storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationOffset); |
|
|
|
|
|
|
|
auto const& subF = preprocessorData.originalFormula.getSubformula(subFIndex); |
|
|
|
if(subF.isOperatorFormula() && subF.asOperatorFormula().hasOptimalityType()) { |
|
|
|
storm::logic::CloneVisitor cv; |
|
|
|
auto copySubF = cv.clone(subF); |
|
|
|
|
|
|
|
if(subF.asOperatorFormula().getOptimalityType() == storm::solver::OptimizationDirection::Maximize) { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::GreaterEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} else { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::LessEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} |
|
|
|
std::cout << *copySubF; |
|
|
|
} |
|
|
|
} |
|
|
|
std::cout << ")" << std::endl; |
|
|
|
//TODO remove this code..
|
|
|
|
std::cout << "multi("; |
|
|
|
for(uint_fast64_t subFIndex = 0; subFIndex < preprocessorData.originalFormula.getNumberOfSubformulas(); ++subFIndex) { |
|
|
|
if(subFIndex != 0) { |
|
|
|
std::cout << ", "; |
|
|
|
} |
|
|
|
RationalNumberType thresholdValue = |
|
|
|
storm::utility::convertNumber<RationalNumberType>(resultData.refinementSteps().back().getLowerBoundPoint()[subFIndex]) * storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationFactor) + storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationOffset); |
|
|
|
|
|
|
|
auto const& subF = preprocessorData.originalFormula.getSubformula(subFIndex); |
|
|
|
if(subF.isOperatorFormula() && subF.asOperatorFormula().hasOptimalityType()) { |
|
|
|
storm::logic::CloneVisitor cv; |
|
|
|
auto copySubF = cv.clone(subF); |
|
|
|
|
|
|
|
if(subF.asOperatorFormula().getOptimalityType() == storm::solver::OptimizationDirection::Maximize) { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::GreaterEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} else { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::LessEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} |
|
|
|
std::cout << *copySubF; |
|
|
|
} |
|
|
|
} |
|
|
|
std::cout << ")" << std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
while(true) { |
|
|
@ -240,65 +183,6 @@ namespace storm { |
|
|
|
} |
|
|
|
} |
|
|
|
resultData.setPrecisionOfResult(farestDistance); |
|
|
|
std::cout << "Current precision of the approximation of the pareto curve is " << resultData.template getPrecisionOfResult<double>() << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO remove this code..
|
|
|
|
std::cout << "multi(" << preprocessorData.originalFormula.getSubformula(0); |
|
|
|
for(uint_fast64_t subFIndex = 1; subFIndex < preprocessorData.originalFormula.getNumberOfSubformulas(); ++subFIndex) { |
|
|
|
std::cout << ", "; |
|
|
|
RationalNumberType thresholdValue = |
|
|
|
storm::utility::convertNumber<RationalNumberType>(resultData.refinementSteps().back().getLowerBoundPoint()[subFIndex]) * storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationFactor) + storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationOffset); |
|
|
|
|
|
|
|
auto const& subF = preprocessorData.originalFormula.getSubformula(subFIndex); |
|
|
|
if(subF.isOperatorFormula() && subF.asOperatorFormula().hasOptimalityType()) { |
|
|
|
storm::logic::CloneVisitor cv; |
|
|
|
auto copySubF = cv.clone(subF); |
|
|
|
|
|
|
|
if(subF.asOperatorFormula().getOptimalityType() == storm::solver::OptimizationDirection::Maximize) { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::GreaterEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} else { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::LessEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} |
|
|
|
std::cout << *copySubF; |
|
|
|
} |
|
|
|
} |
|
|
|
std::cout << ")" << std::endl; |
|
|
|
//TODO remove this code..
|
|
|
|
std::cout << "multi("; |
|
|
|
for(uint_fast64_t subFIndex = 0; subFIndex < preprocessorData.originalFormula.getNumberOfSubformulas(); ++subFIndex) { |
|
|
|
if(subFIndex != 0) { |
|
|
|
std::cout << ", "; |
|
|
|
} |
|
|
|
RationalNumberType thresholdValue = |
|
|
|
storm::utility::convertNumber<RationalNumberType>(resultData.refinementSteps().back().getLowerBoundPoint()[subFIndex]) * storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationFactor) + storm::utility::convertNumber<RationalNumberType>(preprocessorData.objectives[subFIndex].toOriginalValueTransformationOffset); |
|
|
|
|
|
|
|
auto const& subF = preprocessorData.originalFormula.getSubformula(subFIndex); |
|
|
|
if(subF.isOperatorFormula() && subF.asOperatorFormula().hasOptimalityType()) { |
|
|
|
storm::logic::CloneVisitor cv; |
|
|
|
auto copySubF = cv.clone(subF); |
|
|
|
|
|
|
|
if(subF.asOperatorFormula().getOptimalityType() == storm::solver::OptimizationDirection::Maximize) { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::GreaterEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} else { |
|
|
|
storm::logic::OperatorInformation opInfo(boost::none, storm::logic::Bound<storm::RationalNumber>(storm::logic::ComparisonType::LessEqual, thresholdValue)); |
|
|
|
copySubF->asOperatorFormula().setOperatorInformation(opInfo); |
|
|
|
} |
|
|
|
std::cout << *copySubF; |
|
|
|
} |
|
|
|
} |
|
|
|
std::cout << ")" << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
STORM_LOG_DEBUG("Current precision of the approximation of the pareto curve is " << resultData.template getPrecisionOfResult<double>()); |
|
|
|
if(targetPrecisionReached(resultData) || maxStepsPerformed(resultData)) { |
|
|
|
break; |
|
|
@ -371,11 +255,7 @@ namespace storm { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
result.stopWatchWeightVectorChecker.unpause(); |
|
|
|
weightVectorChecker->check(storm::utility::vector::convertNumericVector<SparseModelValueType>(direction)); |
|
|
|
result.stopWatchWeightVectorChecker.pause(); |
|
|
|
|
|
|
|
if(oldMaximumLowerUpperBoundGap) { |
|
|
|
// Reset the precision back to the previous values
|
|
|
|
weightVectorChecker->setMaximumLowerUpperBoundGap(*oldMaximumLowerUpperBoundGap); |
|
|
@ -394,7 +274,6 @@ namespace storm { |
|
|
|
} |
|
|
|
updateOverApproximation(result.refinementSteps(), result.overApproximation()); |
|
|
|
updateUnderApproximation(result.refinementSteps(), result.underApproximation()); |
|
|
|
std::cout << "number of performed refinement Steps is: " << result.refinementSteps().size() << std::endl; |
|
|
|
} |
|
|
|
|
|
|
|
template <class SparseModelType, typename RationalNumberType> |
|
|
|