31template<
typename ValueType>
34 std::unique_ptr<storm::solver::MinMaxLinearEquationSolver<ValueType>>
solver;
43 solver->setHasUniqueSolution(
true);
44 solver->setHasNoEndComponents(
true);
47 solver->setCachingEnabled(
true);
48 solver->setRequirementsChecked(
true);
49 auto req =
solver->getRequirements(env, dir);
51 req.clearUniqueSolution();
55 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
56 "The solver requirement " << req.getEnabledRequirementsAsString() <<
" has not been checked.");
61template<
typename ValueType>
66 : transitionMatrix(transitionMatrix), exitRateVector(exitRateVector), markovianStates(markovianStates) {
72 ValueType
const& upperTimeBound,
73 boost::optional<storm::storage::BitVector>
const& relevantStates = boost::none) {
86 psiStates,
false,
false)
90 boost::optional<storm::storage::BitVector> relevantMaybeStates;
93 if (!relevantStates->isSubsetOf(markovianStates)) {
95 auto const enhancedRelevantStates =
97 relevantMaybeStates = enhancedRelevantStates % maybeStates;
99 relevantMaybeStates = relevantStates.get() % maybeStates;
101 relevantMarkovianMaybeStates = relevantMaybeStates.
get() & markovianStatesModMaybeStates;
103 relevantMarkovianMaybeStates = markovianStatesModMaybeStates;
106 std::vector<ValueType> bestKnownSolution;
107 if (relevantMaybeStates) {
108 bestKnownSolution.resize(relevantMaybeStates->getNumberOfSetBits());
122 ValueType lambda = *std::max_element(markovianExitRates.begin(), markovianExitRates.end());
127 std::vector<std::pair<uint64_t, ValueType>> markovianToPsiProbabilities = getSparseOneStepProbabilities(markovianMaybeStates, psiStates);
128 for (
auto& entry : markovianToPsiProbabilities) {
129 entry.second *= markovianExitRates[entry.first] / lambda;
133 getUniformizedMarkovianTransitions(markovianExitRates, lambda, maybeStates, markovianMaybeStates);
136 transitionMatrix.
getSubmatrix(
true, probabilisticMaybeStates, probabilisticMaybeStates,
false);
139 transitionMatrix.
getSubmatrix(
true, probabilisticMaybeStates, markovianMaybeStates,
false);
141 std::vector<std::pair<uint64_t, ValueType>> probabilisticToPsiProbabilities = getSparseOneStepProbabilities(probabilisticMaybeStates, psiStates);
152 std::vector<ValueType> nextMarkovianStateValues = std::move(
154 std::vector<ValueType> nextProbabilisticStateValues(probabilisticToProbabilisticTransitions.
getRowGroupCount());
155 std::vector<ValueType> eqSysRhs(probabilisticToProbabilisticTransitions.
getRowCount());
159 uint64_t iteration = 0;
161 bool converged =
false;
162 bool abortedInnerIterations =
false;
178 for (
bool computeLowerBound : {
false,
true}) {
179 auto& maybeStatesValues = computeLowerBound ? maybeStatesValuesLower : maybeStatesValuesWeightedUpper;
182 std::string(computeLowerBound ?
"lower" :
"upper") +
" bounds.");
185 bool firstIteration =
true;
188 for (--k; k >= 0; --k) {
190 if (computeLowerBound) {
192 if (
static_cast<uint64_t
>(k) > foxGlynnResult.right) {
197 uint64_t i = N - 1 - k;
198 if (i > foxGlynnResult.right) {
206 if (firstIteration) {
207 firstIteration =
false;
214 markovianToMaybeMultiplier->multiply(env, maybeStatesValues,
nullptr, nextMarkovianStateValues);
215 for (
auto const& oneStepProb : markovianToPsiProbabilities) {
216 nextMarkovianStateValues[oneStepProb.first] += oneStepProb.second * targetValue;
222 if (computeLowerBound &&
static_cast<uint64_t
>(k) >= foxGlynnResult.left) {
223 assert(
static_cast<uint64_t
>(k) <= foxGlynnResult.right);
224 targetValue += foxGlynnResult.weights[k - foxGlynnResult.left];
228 probabilisticToMarkovianMultiplier->multiply(env, nextMarkovianStateValues,
nullptr, eqSysRhs);
229 for (
auto const& oneStepProb : probabilisticToPsiProbabilities) {
230 eqSysRhs[oneStepProb.first] += oneStepProb.second * targetValue;
233 solver->solveEquations(solverEnv, dir, nextProbabilisticStateValues, eqSysRhs);
243 if (!computeLowerBound) {
245 uint64_t i = N - 1 - k;
246 if (i >= foxGlynnResult.left) {
247 assert(i <= foxGlynnResult.right);
248 ValueType
const& weight = foxGlynnResult.weights[i - foxGlynnResult.left];
255 abortedInnerIterations =
true;
260 if (computeLowerBound) {
271 converged = checkConvergence(maybeStatesValuesLower, maybeStatesValuesUpper, relevantMarkovianMaybeStates, epsilon, relativePrecision, kappa);
277 if (relevantMaybeStates) {
278 auto currentSolIt = bestKnownSolution.begin();
279 for (
auto state : relevantMaybeStates.get()) {
281 *currentSolIt = (maybeStatesValuesLower[state] + maybeStatesValuesUpper[state]) / two;
291 ValueType oldLambda = lambda;
295 if (relativePrecision) {
298 if (relevantMaybeStates) {
301 minValue = *std::min_element(maybeStatesValuesUpper.begin(), maybeStatesValuesUpper.end());
304 kappa = std::min(kappa, minValue);
309 uniformize(markovianToMaybeTransitions, markovianToPsiProbabilities, oldLambda, lambda, markovianStatesModMaybeStates);
316 STORM_LOG_WARN(
"Aborted unif+ in iteration " << iteration <<
".");
326 if (abortedInnerIterations && iteration > 1 && relevantMaybeStates && relevantStates) {
332 "Unexpected number of Markovian maybe states");
333 auto subStateIt = markovianStatesModMaybeStates.
begin();
334 for (
auto const markovianState : markovianMaybeStates) {
335 result[markovianState] = (maybeStatesValuesLower[*subStateIt] + maybeStatesValuesUpper[*subStateIt]) / two;
340 uint64_t probSubState = 0;
341 for (
auto const probabilisticState : probabilisticMaybeStates) {
342 for (
auto const probStateRow : transitionMatrix.getRowGroupIndices(probabilisticState)) {
343 eqSysRhs[probSubState] = transitionMatrix.multiplyRowWithVector(probStateRow, result);
348 solver->solveEquations(solverEnv, dir, nextProbabilisticStateValues, eqSysRhs);
359 bool checkConvergence(std::vector<ValueType>
const& lower, std::vector<ValueType>
const& upper,
storm::storage::BitVector const& relevantValues,
360 ValueType
const& epsilon,
bool relative, ValueType& kappa) {
365 ValueType truncationError = epsilon * kappa;
366 for (uint64_t
const i : relevantValues) {
367 if (lower[i] == upper[i]) {
370 if (lower[i] <= truncationError) {
373 ValueType absDiff = upper[i] - lower[i] + truncationError;
374 ValueType relDiff = absDiff / lower[i];
375 if (relDiff > epsilon) {
383 storm::storage::SparseMatrix<ValueType> getUniformizedMarkovianTransitions(std::vector<ValueType>
const& oldRates, ValueType uniformizationRate,
384 storm::storage::BitVector
const& maybeStates,
385 storm::storage::BitVector
const& markovianMaybeStates) {
390 auto submatrix = transitionMatrix.getSubmatrix(
true, markovianMaybeStates, maybeStates);
391 assert(submatrix.getRowCount() == submatrix.getRowGroupCount());
394 storm::storage::SparseMatrixBuilder<ValueType> builder(submatrix.getRowCount(), submatrix.getColumnCount());
395 auto markovianStateColumns = markovianMaybeStates % maybeStates;
397 for (
auto selfloopColumn : markovianStateColumns) {
398 ValueType const& oldExitRate = oldRates[row];
399 bool foundSelfoop =
false;
400 for (
auto const& entry : submatrix.getRow(row)) {
401 if (entry.getColumn() == selfloopColumn) {
403 ValueType newSelfLoop = uniformizationRate - oldExitRate + entry.getValue() * oldExitRate;
404 builder.addNextValue(row, entry.getColumn(), newSelfLoop / uniformizationRate);
406 builder.addNextValue(row, entry.getColumn(), entry.getValue() * oldExitRate / uniformizationRate);
410 ValueType newSelfLoop = uniformizationRate - oldExitRate;
411 builder.addNextValue(row, selfloopColumn, newSelfLoop / uniformizationRate);
415 assert(row == submatrix.getRowCount());
417 return builder.build();
420 void uniformize(storm::storage::SparseMatrix<ValueType>& matrix, std::vector<std::pair<uint64_t, ValueType>>& oneSteps,
421 std::vector<ValueType>
const& oldRates, ValueType uniformizationRate, storm::storage::BitVector
const& selfloopColumns) {
423 for (
auto selfloopColumn : selfloopColumns) {
424 ValueType const& oldExitRate = oldRates[row];
425 if (oldExitRate == uniformizationRate) {
430 for (
auto& v : matrix.
getRow(row)) {
431 if (v.getColumn() == selfloopColumn) {
432 ValueType newSelfLoop = uniformizationRate - oldExitRate + v.getValue() * oldExitRate;
433 v.setValue(newSelfLoop / uniformizationRate);
435 v.setValue(v.getValue() * oldExitRate / uniformizationRate);
441 for (
auto& oneStep : oneSteps) {
442 oneStep.second *= oldRates[oneStep.first] / uniformizationRate;
448 void uniformize(storm::storage::SparseMatrix<ValueType>& matrix, std::vector<std::pair<uint64_t, ValueType>>& oneSteps, ValueType oldUniformizationRate,
449 ValueType newUniformizationRate, storm::storage::BitVector
const& selfloopColumns) {
450 if (oldUniformizationRate != newUniformizationRate) {
451 assert(oldUniformizationRate < newUniformizationRate);
452 ValueType rateDiff = newUniformizationRate - oldUniformizationRate;
453 ValueType rateFraction = oldUniformizationRate / newUniformizationRate;
455 for (
auto selfloopColumn : selfloopColumns) {
456 for (
auto& v : matrix.
getRow(row)) {
457 if (v.getColumn() == selfloopColumn) {
458 ValueType newSelfLoop = rateDiff + v.getValue() * oldUniformizationRate;
459 v.setValue(newSelfLoop / newUniformizationRate);
461 v.setValue(v.getValue() * rateFraction);
467 for (
auto& oneStep : oneSteps) {
468 oneStep.second *= rateFraction;
473 storm::storage::BitVector getProb0States(
OptimizationDirection dir, storm::storage::BitVector
const& phiStates,
474 storm::storage::BitVector
const& psiStates)
const {
475 if (dir == storm::solver::OptimizationDirection::Maximize) {
488 std::vector<std::pair<uint64_t, ValueType>> getSparseOneStepProbabilities(storm::storage::BitVector
const& sourceStateConstraint,
489 storm::storage::BitVector
const& targetStateConstraint)
const {
490 auto denseResult = transitionMatrix.getConstrainedRowGroupSumVector(sourceStateConstraint, targetStateConstraint);
491 std::vector<std::pair<uint64_t, ValueType>> sparseResult;
492 for (uint64_t i = 0;
i < denseResult.size(); ++
i) {
493 auto const& val = denseResult[
i];
495 sparseResult.emplace_back(i, val);
501 storm::storage::SparseMatrix<ValueType>
const& transitionMatrix;
502 std::vector<ValueType>
const& exitRateVector;
503 storm::storage::BitVector
const& markovianStates;
506template<
typename ValueType>
511 std::vector<ValueType>& probabilisticNonGoalValues, ValueType delta, uint64_t numberOfSteps) {
519 bool existProbabilisticStates = !probabilisticNonGoalStates.
empty();
523 if (existProbabilisticStates) {
524 aMarkovianToProbabilistic = transitionMatrix.
getSubmatrix(
true, markovianNonGoalStates, probabilisticNonGoalStates);
525 aProbabilistic = transitionMatrix.
getSubmatrix(
true, probabilisticNonGoalStates, probabilisticNonGoalStates);
526 aProbabilisticToMarkovian = transitionMatrix.
getSubmatrix(
true, probabilisticNonGoalStates, markovianNonGoalStates);
531 uint64_t rowIndex = 0;
532 for (
auto state : markovianNonGoalStates) {
533 for (
auto& element : aMarkovian.
getRow(rowIndex)) {
534 ValueType eTerm = std::exp(-exitRates[state] * delta);
535 if (element.getColumn() == rowIndex) {
545 if (existProbabilisticStates) {
547 for (
auto state : markovianNonGoalStates) {
548 for (
auto& element : aMarkovianToProbabilistic.
getRow(rowIndex)) {
549 element.setValue((1 - std::exp(-exitRates[state] * delta)) * element.getValue());
556 std::vector<ValueType> bProbabilistic(existProbabilisticStates ? aProbabilistic.
getRowCount() : 0);
560 std::vector<ValueType> bProbabilisticFixed;
561 if (existProbabilisticStates) {
564 std::vector<ValueType> bMarkovianFixed;
566 for (
auto state : markovianNonGoalStates) {
569 for (
auto& element : transitionMatrix.
getRowGroup(state)) {
570 if (goalStates.
get(element.getColumn())) {
571 bMarkovianFixed.back() += (1 - std::exp(-exitRates[state] * delta)) * element.getValue();
577 auto solverEnv = env;
587 std::vector<ValueType> markovianNonGoalValuesSwap(markovianNonGoalValues);
588 for (uint64_t currentStep = 0; currentStep < numberOfSteps; ++currentStep) {
589 if (existProbabilisticStates) {
596 solver->solveEquations(solverEnv, dir, probabilisticNonGoalValues, bProbabilistic);
607 std::swap(markovianNonGoalValues, markovianNonGoalValuesSwap);
608 if (existProbabilisticStates) {
618 if (existProbabilisticStates) {
623 solver->solveEquations(solverEnv, dir, probabilisticNonGoalValues, bProbabilistic);
630template<
typename ValueType>
635 STORM_LOG_TRACE(
"Using IMCA's technique to compute bounded until probabilities.");
640 double lowerBound = boundsPair.first;
641 double upperBound = boundsPair.second;
644 ValueType maxExitRate = 0;
645 for (
auto value : exitRateVector) {
646 maxExitRate = std::max(maxExitRate, value);
651 uint64_t numberOfSteps =
static_cast<uint64_t
>(std::ceil((upperBound - lowerBound) / delta));
652 STORM_LOG_INFO(
"Performing " << numberOfSteps <<
" iterations (delta=" << delta <<
") for interval [" << lowerBound <<
", " << upperBound <<
"].\n");
659 std::vector<ValueType> vProbabilistic(probabilisticNonGoalStates.
getNumberOfSetBits());
663 vMarkovian, vProbabilistic, delta, numberOfSteps);
667 std::vector<ValueType> vAllProbabilistic((~markovianStates).getNumberOfSetBits());
677 numberOfSteps =
static_cast<uint64_t
>(std::ceil(lowerBound / delta));
678 STORM_LOG_INFO(
"Performing " << numberOfSteps <<
" iterations (delta=" << delta <<
") for interval [0, " << lowerBound <<
"].\n");
682 ~markovianStates, vAllMarkovian, vAllProbabilistic, delta, numberOfSteps);
692 std::vector<ValueType> result(numberOfStates);
700template<typename ValueType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
706 "Exact computations not possible for bounded until probabilities.");
710 if (method == storm::solver::MaBoundedReachabilityMethod::Imca) {
711 if (!phiStates.
full()) {
712 STORM_LOG_WARN(
"Using Unif+ method because IMCA method does not support (phi Until psi) for non-trivial phi");
713 method = storm::solver::MaBoundedReachabilityMethod::UnifPlus;
716 STORM_LOG_ASSERT(method == storm::solver::MaBoundedReachabilityMethod::UnifPlus,
"Unknown solution method.");
718 STORM_LOG_WARN(
"Using IMCA method because Unif+ does not support a lower bound > 0.");
719 method = storm::solver::MaBoundedReachabilityMethod::Imca;
723 if (method == storm::solver::MaBoundedReachabilityMethod::Imca) {
727 boost::optional<storm::storage::BitVector> relevantValues;
728 if (goal.hasRelevantValues()) {
729 relevantValues = std::move(goal.relevantValues());
731 return helper.computeBoundedUntilProbabilities(env, goal.direction(), phiStates, psiStates, boundsPair.second, relevantValues);
735template<typename ValueType, typename std::enable_if<!storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
740 std::pair<double, double>
const&) {
741 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Computing bounded until probabilities is unsupported for this value type.");
744template<
typename ValueType>
748 bool qualitative,
bool produceScheduler) {
750 psiStates, qualitative, produceScheduler);
753template<
typename ValueType,
typename RewardModelType>
760 for (
auto const markovianState : markovianStates) {
763 std::vector<ValueType> totalRewardVector = rewardModel.getTotalActionRewardVector(transitionMatrix, stateRewardWeights);
764 RewardModelType scaledRewardModel(std::nullopt, std::move(totalRewardVector));
769template<
typename ValueType,
typename RewardModelType>
776 for (
auto const markovianState : markovianStates) {
779 std::vector<ValueType> totalRewardVector = rewardModel.getTotalActionRewardVector(transitionMatrix, stateRewardWeights);
780 RewardModelType scaledRewardModel(std::nullopt, std::move(totalRewardVector));
786template<
typename ValueType>
793 for (
auto const markovianState : markovianStates) {
810 bool qualitative,
bool produceScheduler);
848 bool produceScheduler);
SolverEnvironment & solver()
void setMethod(storm::solver::MinMaxMethod value, bool isSetFromDefault=false)
MinMaxSolverEnvironment & minMax()
bool isForceExact() const
TimeBoundedSolverEnvironment & timeBounded()
void setForceExact(bool value)
bool const & getRelativeTerminationCriterion() const
storm::RationalNumber const & getPrecision() const
storm::RationalNumber const & getUnifPlusKappa() const
storm::solver::MaBoundedReachabilityMethod const & getMaMethod() const
static MDPSparseModelCheckingHelperReturnType< ValueType > computeTotalRewards(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, RewardModelType const &rewardModel, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeReachabilityRewards(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, RewardModelType const &rewardModel, storm::storage::BitVector const &psiStates, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeUntilProbabilities(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeReachabilityTimes(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &psiStates, bool produceScheduler)
static std::vector< ValueType > computeBoundedUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::pair< double, double > const &boundsPair)
static MDPSparseModelCheckingHelperReturnType< SolutionType > computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static MDPSparseModelCheckingHelperReturnType< SolutionType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static MDPSparseModelCheckingHelperReturnType< SolutionType > computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
std::vector< ValueType > computeBoundedUntilProbabilities(storm::Environment const &env, OptimizationDirection dir, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, ValueType const &upperTimeBound, boost::optional< storm::storage::BitVector > const &relevantStates=boost::none)
UnifPlusHelper(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates)
virtual std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env) const override
std::unique_ptr< Multiplier< ValueType, SolutionType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix)
A bit vector that is internally represented as a vector of 64-bit values.
bool full() const
Retrieves whether all bits are set in this bit vector.
bool empty() const
Retrieves whether no bits are set to true in this bit vector.
uint64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
const_iterator begin() const
Returns an iterator to the indices of the set bits in the bit vector.
size_t size() const
Retrieves the number of bits this bit vector can store.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
A class that holds a possibly non-square matrix in the compressed row storage format.
const_rows getRow(index_type row) const
Returns an object representing the given row.
void multiplyWithVector(std::vector< value_type > const &vector, std::vector< value_type > &result, std::vector< value_type > const *summand=nullptr) const
Multiplies the matrix with the given vector and writes the result to the given result vector.
SparseMatrix getSubmatrix(bool useGroups, storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint, bool insertDiagonalEntries=false, storm::storage::BitVector const &makeZeroColumns=storm::storage::BitVector()) const
Creates a submatrix of the current matrix by dropping all rows and columns whose bits are not set to ...
const_rows getRowGroup(index_type rowGroup) const
Returns an object representing the given row group.
index_type getRowGroupCount() const
Returns the number of row groups in the matrix.
std::vector< index_type > const & getRowGroupIndices() const
Returns the grouping of rows of this matrix.
std::vector< value_type > getConstrainedRowGroupSumVector(storm::storage::BitVector const &rowGroupConstraint, storm::storage::BitVector const &columnConstraint) const
Computes a vector whose entries represent the sums of selected columns for all rows in selected row g...
index_type getRowCount() const
Returns the number of rows of the matrix.
index_type getNonzeroEntryCount() const
Returns the cached number of nonzero entries in the matrix.
A class that provides convenience operations to display run times.
bool updateProgress(uint64_t count)
Updates the progress to the current count and prints it if the delay passed.
void setMaxCount(uint64_t maxCount)
Sets the maximal possible count.
void startNewMeasurement(uint64_t startCount)
Starts a new measurement, dropping all progress information collected so far.
#define STORM_LOG_INFO(message)
#define STORM_LOG_WARN(message)
#define STORM_LOG_DEBUG(message)
#define STORM_LOG_TRACE(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SFTBDDChecker::ValueType ValueType
void computeBoundedReachabilityProbabilitiesImca(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRates, storm::storage::BitVector const &goalStates, storm::storage::BitVector const &markovianNonGoalStates, storm::storage::BitVector const &probabilisticNonGoalStates, std::vector< ValueType > &markovianNonGoalValues, std::vector< ValueType > &probabilisticNonGoalValues, ValueType delta, uint64_t numberOfSteps)
std::unique_ptr< storm::solver::MinMaxLinearEquationSolver< ValueType > > setUpProbabilisticStatesSolver(storm::Environment &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitions)
std::vector< ValueType > computeBoundedUntilProbabilitiesImca(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &psiStates, std::pair< double, double > const &boundsPair)
storm::storage::BitVector getReachableStates(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &constraintStates, storm::storage::BitVector const &targetStates, bool useStepBound, uint_fast64_t maximalSteps, boost::optional< storm::storage::BitVector > const &choiceFilter)
Performs a forward depth-first search through the underlying graph structure to identify the states t...
bool hasCycle(storm::storage::SparseMatrix< T > const &transitionMatrix, boost::optional< storm::storage::BitVector > const &subsystem)
Returns true if the graph represented by the given matrix has a cycle.
storm::storage::BitVector performProb0A(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
storm::storage::BitVector performProb0E(storm::models::sparse::NondeterministicModel< T, RM > const &model, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 0 of satisfying phi until psi under at least one po...
FoxGlynnResult< ValueType > foxGlynn(ValueType lambda, ValueType epsilon)
bool isTerminate()
Check whether the program should terminate (due to some abort signal).
VT min_if(std::vector< VT > const &values, storm::storage::BitVector const &filter)
Computes the minimum of the entries from the values that are selected by the (non-empty) filter.
void addVectors(std::vector< InValueType1 > const &firstOperand, std::vector< InValueType2 > const &secondOperand, std::vector< OutValueType > &target)
Adds the two given vectors and writes the result to the target vector.
void setVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< T > const &values)
Sets the provided values at the provided positions in the given vector.
bool equalModuloPrecision(T const &val1, T const &val2, T const &precision, bool relativeError=true)
Compares the given elements and determines whether they are equal modulo the given precision.
void reduceVectorMinOrMax(storm::solver::OptimizationDirection dir, std::vector< T > const &source, std::vector< T > &target, std::vector< uint_fast64_t > const &rowGrouping, std::vector< uint_fast64_t > *choices=nullptr)
Reduces the given source vector by selecting either the smallest or the largest out of each row group...
void addScaledVector(std::vector< InValueType1 > &firstOperand, std::vector< InValueType2 > const &secondOperand, InValueType3 const &factor)
Computes x:= x + a*y, i.e., adds each element of the first vector and (the corresponding element of t...
void scaleVectorInPlace(std::vector< ValueType1 > &target, ValueType2 const &factor)
Multiplies each element of the given vector with the given factor and writes the result into the vect...
bool hasNonZeroEntry(std::vector< T > const &v)
std::vector< Type > filterVector(std::vector< Type > const &in, storm::storage::BitVector const &filter)
bool isZero(ValueType const &a)
ValueType ceil(ValueType const &number)
ValueType log(ValueType const &number)
bool isInfinity(ValueType const &a)
TargetType convertNumber(SourceType const &number)
solver::OptimizationDirection OptimizationDirection