Browse Source

Quantiles: Bug fixes.

tempestpy_adaptions
Tim Quatmann 6 years ago
parent
commit
c21ea2ce1f
  1. 9
      src/storm/modelchecker/prctl/helper/rewardbounded/QuantileHelper.cpp

9
src/storm/modelchecker/prctl/helper/rewardbounded/QuantileHelper.cpp

@ -152,10 +152,11 @@ namespace storm {
prec = storm::utility::convertNumber<ValueType>(env.solver().getPrecisionOfLinearEquationSolver(env.solver().getLinearEquationSolverType()).first.get()); prec = storm::utility::convertNumber<ValueType>(env.solver().getPrecisionOfLinearEquationSolver(env.solver().getLinearEquationSolverType()).first.get());
relative = env.solver().getPrecisionOfLinearEquationSolver(env.solver().getLinearEquationSolverType()).second.get(); relative = env.solver().getPrecisionOfLinearEquationSolver(env.solver().getLinearEquationSolverType()).second.get();
} }
prec *= factor;
if (relative) { if (relative) {
return std::make_pair<ValueType, ValueType>((value * (1/(prec + 1))) * factor, (value * (1 + prec/(prec +1))) * factor);
return std::make_pair<ValueType, ValueType>(value * (1/(prec + 1)), value * (1 + prec/(prec +1)));
} else { } else {
return std::make_pair<ValueType, ValueType>((value - prec) * factor, (value + prec) * factor);
return std::make_pair<ValueType, ValueType>(value - prec, value + prec);
} }
} }
@ -197,11 +198,13 @@ namespace storm {
// Translate the result by applying the scaling factors and permutation. // Translate the result by applying the scaling factors and permutation.
std::vector<uint64_t> permutation; std::vector<uint64_t> permutation;
for (auto const& v : quantileFormula.getBoundVariables()) { for (auto const& v : quantileFormula.getBoundVariables()) {
uint64_t openDim = 0;
for (auto const& dim : getOpenDimensions()) { for (auto const& dim : getOpenDimensions()) {
if (getVariableForDimension(dim) == v) { if (getVariableForDimension(dim) == v) {
permutation.push_back(dim);
permutation.push_back(openDim);
break; break;
} }
++openDim;
} }
} }
assert(permutation.size() == getOpenDimensions().getNumberOfSetBits()); assert(permutation.size() == getOpenDimensions().getNumberOfSetBits());

Loading…
Cancel
Save