Browse Source

fixed correctly setting the result bounds for weight vector checker

tempestpy_adaptions
TimQu 7 years ago
parent
commit
4da61d972c
  1. 11
      src/storm/modelchecker/multiobjective/pcaa/SparseMdpRewardBoundedPcaaWeightVectorChecker.cpp
  2. 11
      src/storm/modelchecker/multiobjective/pcaa/SparsePcaaWeightVectorChecker.cpp

11
src/storm/modelchecker/multiobjective/pcaa/SparseMdpRewardBoundedPcaaWeightVectorChecker.cpp

@ -142,16 +142,6 @@ namespace storm {
std::vector<ValueType>& x = cachedData.xLinEq[objIndex];
assert(x.size() == choices.size());
auto req = cachedData.linEqSolver->getRequirements();
if (storm::solver::minimize(obj.formula->getOptimalityType())) {
if (obj.lowerResultBound) {
req.clearUpperBounds();
cachedData.linEqSolver->setUpperBound(-(*obj.lowerResultBound));
}
if (obj.upperResultBound) {
req.clearLowerBounds();
cachedData.linEqSolver->setLowerBound(-(*obj.upperResultBound));
}
} else {
if (obj.lowerResultBound) {
req.clearLowerBounds();
cachedData.linEqSolver->setLowerBound(*obj.lowerResultBound);
@ -160,7 +150,6 @@ namespace storm {
cachedData.linEqSolver->setUpperBound(*obj.upperResultBound);
req.clearUpperBounds();
}
}
STORM_LOG_THROW(req.empty(), storm::exceptions::UncheckedRequirementException, "At least one requirement of the LinearEquationSolver was not met.");
swEqBuilding.stop();
swLinEqSolving.start();

11
src/storm/modelchecker/multiobjective/pcaa/SparsePcaaWeightVectorChecker.cpp

@ -261,16 +261,6 @@ namespace storm {
// Now solve the resulting equation system.
std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> solver = linearEquationSolverFactory.create(std::move(submatrix));
auto req = solver->getRequirements();
if (storm::solver::minimize(obj.formula->getOptimalityType())) {
if (obj.lowerResultBound) {
req.clearUpperBounds();
solver->setUpperBound(-(*obj.lowerResultBound));
}
if (obj.upperResultBound) {
req.clearLowerBounds();
solver->setLowerBound(-(*obj.upperResultBound));
}
} else {
if (obj.lowerResultBound) {
req.clearLowerBounds();
solver->setLowerBound(*obj.lowerResultBound);
@ -279,7 +269,6 @@ namespace storm {
solver->setUpperBound(*obj.upperResultBound);
req.clearUpperBounds();
}
}
STORM_LOG_THROW(req.empty(), storm::exceptions::UncheckedRequirementException, "At least one requirement of the LinearEquationSolver was not met.");
solver->solveEquations(x, b);

Loading…
Cancel
Save