34template<
class SparseModelType>
41template<
class SparseModelType>
46 "There is no Pareto optimal scheduler that yields finite reward for all objectives. This is not supported.");
48 "There might be infinite reward for some scheduler. Multi-objective model checking restricts to schedulers that yield finite reward "
49 "for all objectives. Be aware that solutions yielding infinite reward are discarded.");
50 STORM_LOG_THROW(rewardAnalysis.totalRewardLessInfinityEStates, storm::exceptions::UnexpectedException,
51 "The set of states with reward < infinity for some scheduler has not been computed during preprocessing.");
53 "At least one objective was not reduced to an expected (long run, total or cumulative) reward objective during preprocessing. This is not "
54 "supported by the considered weight vector checker.");
56 "The model has multiple initial states.");
62 rewardAnalysis.totalRewardLessInfinityEStates.get(), rewardAnalysis.totalRewardLessInfinityEStates.get());
63 std::set<std::string> relevantRewardModels;
65 obj.formula->gatherReferencedRewardModels(relevantRewardModels);
70 std::vector<std::string>(relevantRewardModels.begin(), relevantRewardModels.end()), finiteTotalRewardChoices);
78 initialState = *mergerResult.model->getInitialStates().begin();
80 if (mergerResult.targetState) {
86 targetStateAsVector.set(*mergerResult.targetState,
true);
99 for (uint_fast64_t objIndex = 0; objIndex < this->objectives.size(); ++objIndex) {
100 auto const& formula = *this->objectives[objIndex].formula;
101 if (formula.getSubformula().isTotalRewardFormula()) {
102 objectivesWithNoUpperTimeBound.set(objIndex,
true);
105 if (formula.getSubformula().isLongRunAverageRewardFormula()) {
106 lraObjectives.set(objIndex,
true);
107 objectivesWithNoUpperTimeBound.set(objIndex,
true);
121 checkHasBeenCalled =
false;
122 objectiveResults.resize(this->objectives.size());
134 uint64_t numLraMecStates = 0;
136 numLraMecStates += mec.size();
144template<
class SparseModelType>
149 STORM_LOG_THROW(std::any_of(weightVector.begin(), weightVector.end(), [](
auto const& w_i) { return !storm::utility::isZero(w_i); }),
150 storm::exceptions::InvalidOperationException,
"Weight vector must not be the zero vector.");
160 boost::optional<std::vector<ValueType>> weightedStateRewardVector;
163 storm::solver::minimize(this->objectives[objIndex].formula->getOptimalityType()) ? -weightVector[objIndex] : weightVector[objIndex];
166 if (!weightedStateRewardVector) {
179 for (
auto objIndex : totalRewardObjectives) {
190 for (
auto const& obj : this->objectives) {
191 if (!obj.formula->getSubformula().isTotalRewardFormula() && !obj.formula->getSubformula().isLongRunAverageRewardFormula()) {
196 STORM_LOG_INFO(
"Weight vector check done. Lower bounds for results in initial state: "
200 for (uint64_t objIndex = 0; objIndex < this->objectives.size(); ++objIndex) {
201 weightedSum += (
storm::solver::minimize(this->objectives[objIndex].formula->getOptimalityType()) ? -weightVector[objIndex] : weightVector[objIndex]) *
207 "The desired precision was not reached: resulting precision "
208 << resultingWeightedPrecision <<
" exceeds specified value " << this->
getWeightedPrecision() <<
" by approx. "
219template<
class SparseModelType>
222 std::vector<ValueType> res;
223 res.reserve(this->objectives.size());
224 for (uint64_t objIndex = 0; objIndex < this->objectives.size(); ++objIndex) {
230template<
class SparseModelType>
236template<
class SparseModelType>
240 "Tried to retrieve results but check(..) has not been called before.");
241 for (
auto const& obj : this->objectives) {
242 STORM_LOG_THROW(obj.formula->getSubformula().isTotalRewardFormula() || obj.formula->getSubformula().isLongRunAverageRewardFormula(),
243 storm::exceptions::NotImplementedException,
"Scheduler retrival is only implemented for objectives without time-bound.");
247 for (uint64_t inputModelState = 0; inputModelState < numStatesOfInputModel; ++inputModelState) {
253 auto const reducedModelChoice =
optimalChoices[reducedModelState];
255 result.
setChoice(inputModelChoice, inputModelState);
261template<
typename ValueType>
265 std::vector<uint64_t> stack;
267 stack.insert(stack.end(), processedStates.
begin(), processedStates.
end());
268 uint64_t currentState = 0;
270 while (!stack.empty()) {
271 currentState = stack.back();
274 for (
auto const& predecessorEntry : backwardTransitions.
getRow(currentState)) {
275 auto predecessor = predecessorEntry.getColumn();
276 if (consideredStates.
get(predecessor) && !processedStates.
get(predecessor)) {
280 uint64_t row = allowedChoices ? allowedChoices->getNextSetIndex(groupStart) : groupStart;
281 for (; row < groupEnd; row = allowedChoices ? allowedChoices->getNextSetIndex(row + 1) : row + 1) {
282 bool hasSuccessorInProcessedStates =
false;
283 for (
auto const& successorOfPredecessor : transitionMatrix.
getRow(row)) {
284 if (processedStates.
get(successorOfPredecessor.getColumn())) {
285 hasSuccessorInProcessedStates =
true;
289 if (hasSuccessorInProcessedStates) {
290 choices[predecessor] = row - groupStart;
291 processedStates.
set(predecessor,
true);
292 stack.push_back(predecessor);
297 "Unable to find choice at a predecessor of a processed state that leads to a processed state.");
304template<
typename ValueType>
308 for (
auto state : consideredStates) {
311 bool choiceFound =
false;
314 for (
auto const& element : transitionMatrix.
getRow(row)) {
315 if (statesToAvoid.
get(element.getColumn())) {
321 choices[state] = row - groupStart;
329template<
typename ValueType>
333 auto backwardsTransitions = matrix.
transpose(
true);
335 for (uint64_t state = 0; state < result.size(); ++state) {
336 if (rowsWithSumLessOne.
getNextSetIndex(groups[state]) < groups[state + 1]) {
337 result[state] = rowsWithSumLessOne.
getNextSetIndex(groups[state]) - groups[state];
338 processedStates.
set(state,
true);
351template<
typename ValueType>
355 auto badStates = transitionMatrix.
getRowGroupFilter(finitelyOftenChoices,
true) & ~safeStates;
359 transitionMatrix, transitionMatrix.
getRowGroupIndices(), backwardTransitions, ~safeStates, badStates,
false, 0, ~finitelyOftenChoices);
362 auto avoidBadStates = ~reachBadWithProbGreater0AStates & ~safeStates;
363 computeSchedulerProb0(transitionMatrix, backwardTransitions, avoidBadStates, reachBadWithProbGreater0AStates, ~finitelyOftenChoices, choices);
368 computeSchedulerProb1(transitionMatrix, backwardTransitions, reachBadWithProbGreater0AStates, avoidBadStates | safeStates, choices);
371template<
class SparseModelType>
373 std::vector<ValueType>
const& weightedActionRewardVector,
374 boost::optional<std::vector<ValueType>>
const& weightedStateRewardVector,
375 std::vector<ValueType>
const& weightVector) {
376 auto solverEnv = inputEnv;
384 solverEnv.solver().lra().setRelativeTerminationCriterion(
false);
389 helper.setOptimizationDirection(storm::solver::OptimizationDirection::Maximize);
390 helper.setProduceScheduler(
true);
393 auto actionValueGetter = [&weightedActionRewardVector](uint64_t
const& a) {
return weightedActionRewardVector[a]; };
395 if (weightedStateRewardVector) {
396 stateValueGetter = [&weightedStateRewardVector](uint64_t
const& s) {
return weightedStateRewardVector.get()[s]; };
400 lraMecDecomposition->auxMecValues[mecIndex] =
helper.computeLraForComponent(solverEnv, stateValueGetter, actionValueGetter, mec) + offset;
406template<
class SparseModelType>
408 std::vector<ValueType>
const& weightVector) {
410 auto solverEnv = inputEnv;
412 solverEnv.solver().lra().setRelativeTerminationCriterion(
false);
413 bool const requireSoundApproximation = !solverEnv.solver().isForceExact() && solverEnv.solver().isForceSoundness();
418 if (solverEnv.solver().isForceExact()) {
421 }
else if (requireSoundApproximation) {
422 adjustedPrecision /= two;
440 for (
auto const& sc : mec) {
441 statesInLraMec.
set(sc.first,
true);
447 this->optimalChoices);
455 std::map<uint64_t, uint64_t> ecqStateToOptimalMecMap;
464 uint64_t ecqState =
ecQuotient->originalToEcqStateMapping[mec.begin()->first];
465 if (ecqState >=
ecQuotient->matrix.getRowGroupCount()) {
470 uint64_t ecqChoice =
ecQuotient->ecqStayInEcChoices.getNextSetIndex(
ecQuotient->matrix.getRowGroupIndices()[ecqState]);
471 STORM_LOG_ASSERT(ecqChoice < ecQuotient->matrix.getRowGroupIndices()[ecqState + 1],
472 "Unable to find choice that represents staying inside the (eliminated) ec.");
473 auto& ecqChoiceValue =
ecQuotient->auxChoiceValues[ecqChoice];
474 auto insertionRes = ecqStateToOptimalMecMap.emplace(ecqState, mecIndex);
475 if (insertionRes.second) {
478 "Expected a total reward of zero for choices that represent staying in an EC for ever.");
479 ecqChoiceValue = mecValue;
481 if (mecValue > ecqChoiceValue) {
482 ecqChoiceValue = mecValue;
483 insertionRes.first->second = mecIndex;
489 std::unique_ptr<storm::solver::MinMaxLinearEquationSolver<ValueType>>
solver = solverFactory.
create(solverEnv,
ecQuotient->matrix);
490 solver->setTrackScheduler(
true);
491 solver->setHasUniqueSolution(
true);
492 solver->setOptimizationDirection(storm::solver::OptimizationDirection::Maximize);
493 auto req =
solver->getRequirements(solverEnv, storm::solver::OptimizationDirection::Maximize);
496 if (
solver->hasLowerBound()) {
497 req.clearLowerBounds();
499 if (
solver->hasUpperBound()) {
500 req.clearUpperBounds();
502 if (req.validInitialScheduler()) {
504 req.clearValidInitialScheduler();
506 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
507 "Solver requirements " + req.getEnabledRequirementsAsString() +
" not checked.");
508 solver->setRequirementsChecked(
true);
517 this->optimalChoices);
523template<
class SparseModelType>
525 auto solverEnv = inputEnv;
528 std::vector<ValueType> deterministicStateRewards(deterministicMatrix.
getRowCount());
530 bool const requireSoundApproximation = !solverEnv.solver().isForceExact() && solverEnv.solver().isForceSoundness();
534 if (solverEnv.solver().isForceExact()) {
537 }
else if (requireSoundApproximation) {
542 infiniteHorizonHelper.provideBackwardTransitions(deterministicBackwardTransitions);
546 std::vector<ValueType> weightedSumOfUncheckedObjectives =
weightedResult;
550 auto const& obj = this->objectives[objIndex];
558 solverEnv.solver().lra().setRelativeTerminationCriterion(
false);
561 auto actionValueGetter = [&](uint64_t
const& a) {
568 stateValueGetter = [&](uint64_t
const& s) {
return stateRewards[objIndex][s]; };
570 objectiveResults[objIndex] = infiniteHorizonHelper.computeLongRunAverageValues(solverEnv, stateValueGetter, actionValueGetter);
592 if (!maybeStates.
empty()) {
593 bool needEquationSystem =
596 if (needEquationSystem) {
607 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>>
solver = linearEquationSolverFactory.
create(solverEnv, submatrix);
608 auto req =
solver->getRequirements(solverEnv);
612 this->
setBoundsToSolver(*
solver, req.lowerBounds(), req.upperBounds(), objIndex, submatrix, submatrixRowsWithSumLessOne, b);
613 if (
solver->hasLowerBound()) {
614 req.clearLowerBounds();
616 if (
solver->hasUpperBound()) {
617 req.clearUpperBounds();
619 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
620 "Solver requirements " + req.getEnabledRequirementsAsString() +
" not checked.");
621 solver->solveEquations(solverEnv, x, b);
622 if (requireSoundApproximation) {
635 sumOfWeightsOfUncheckedObjectives -= weightVector[objIndex];
644template<
class SparseModelType>
654 for (
auto const& stateChoices : mec) {
655 for (
auto const& choice : stateChoices.second) {
656 zeroLraRewardChoices.
set(choice,
false);
665 auto nonZeroRewardStates =
transitionMatrix.getRowGroupFilter(newReward0Choices,
true);
666 nonZeroRewardStates.complement();
676 for (uint64_t row = 0; row < rowsWithSumLessOne.
size(); ++row) {
677 if (ecElimResult.matrix.getRow(row).getNumberOfEntries() == 0) {
678 rowsWithSumLessOne.
set(row,
true);
680 for (
auto const& entry :
transitionMatrix.getRow(ecElimResult.newToOldRowMapping[row])) {
681 if (!subsystemStates.
get(entry.getColumn())) {
682 rowsWithSumLessOne.
set(row,
true);
690 ecQuotient->matrix = std::move(ecElimResult.matrix);
691 ecQuotient->ecqToOriginalChoiceMapping = std::move(ecElimResult.newToOldRowMapping);
692 ecQuotient->originalToEcqStateMapping = std::move(ecElimResult.oldToNewStateMapping);
694 for (uint64_t state = 0; state <
ecQuotient->originalToEcqStateMapping.size(); ++state) {
695 uint64_t ecqState =
ecQuotient->originalToEcqStateMapping[state];
696 if (ecqState < ecQuotient->matrix.getRowGroupCount()) {
697 ecQuotient->ecqToOriginalStateMapping[ecqState].insert(state);
700 ecQuotient->ecqStayInEcChoices = std::move(ecElimResult.sinkRows);
701 ecQuotient->origReward0Choices = std::move(newReward0Choices);
702 ecQuotient->origTotalReward0Choices = std::move(newTotalReward0Choices);
703 ecQuotient->rowsWithSumLessOne = std::move(rowsWithSumLessOne);
709template<
class SparseModelType>
711 bool requiresUpper, uint64_t objIndex,
714 std::vector<ValueType>
const& rewards)
const {
716 if (this->objectives[objIndex].lowerResultBound) {
717 solver.setLowerBound(this->objectives[objIndex].lowerResultBound.get());
719 if (this->objectives[objIndex].upperResultBound) {
720 solver.setUpperBound(this->objectives[objIndex].upperResultBound.get());
723 if ((requiresLower && !
solver.hasLowerBound()) || (requiresUpper && !
solver.hasUpperBound())) {
728template<
class SparseModelType>
730 bool requiresUpper, std::vector<ValueType>
const& weightVector,
734 std::vector<ValueType>
const& rewards)
const {
741 lowerBound.get() += *min;
744 solver.setLowerBound(lowerBound.get());
751 upperBound.get() += *max;
754 solver.setUpperBound(upperBound.get());
757 if ((requiresLower && !
solver.hasLowerBound()) || (requiresUpper && !
solver.hasUpperBound())) {
762template<
class SparseModelType>
767 std::vector<ValueType>
const& rewards)
const {
770 for (
auto row : rowsWithSumLessOne) {
774 bool hasNegativeReward =
false;
775 bool hasPositiveReward =
false;
776 for (
auto const& rew : rewards) {
778 hasNegativeReward =
true;
780 hasPositiveReward =
true;
782 if (hasNegativeReward && hasPositiveReward) {
786 if (requiresLower && !
solver.hasLowerBound()) {
788 if (hasNegativeReward) {
790 std::vector<ValueType> tmpRewards(rewards.size());
793 std::vector<ValueType> lowerBounds =
796 solver.setLowerBounds(std::move(lowerBounds));
803 if (requiresUpper && !
solver.hasUpperBound()) {
804 if (hasPositiveReward) {
806 .computeTotalRewardBounds(rewards)
814template<
class SparseModelType>
816 std::vector<uint_fast64_t>
const& ecqOptimalChoices,
817 std::map<uint64_t, uint64_t>
const& ecqStateToOptimalMecMap,
818 std::vector<ValueType>& originalSolution,
819 std::vector<uint_fast64_t>& originalOptimalChoices)
const {
831 for (uint64_t ecqState = 0; ecqState < ecqSolution.size(); ++ecqState) {
832 uint64_t ecqChoice =
ecQuotient->matrix.getRowGroupIndices()[ecqState] + ecqOptimalChoices[ecqState];
833 uint_fast64_t origChoice =
ecQuotient->ecqToOriginalChoiceMapping[ecqChoice];
834 auto const& origStates =
ecQuotient->ecqToOriginalStateMapping[ecqState];
835 STORM_LOG_ASSERT(!origStates.empty(),
"Unexpected empty set of original states.");
836 if (
ecQuotient->ecqStayInEcChoices.get(ecqChoice)) {
839 if (!ecqStateToOptimalMecMap.empty()) {
842 STORM_LOG_ASSERT(ecqStateToOptimalMecMap.count(ecqState) > 0,
"No Lra Mec associated to given eliminated EC");
844 if (lraMec.size() == origStates.size()) {
846 for (
auto const& state : origStates) {
847 STORM_LOG_ASSERT(lraMec.containsState(state),
"Expected state to be contained in the lra mec.");
849 unprocessedStates.
set(state,
false);
850 originalSolution[state] = ecqSolution[ecqState];
854 STORM_LOG_ASSERT(lraMec.size() < origStates.size(),
"Lra Mec (" << lraMec.size()
855 <<
" states) should be a proper subset of the eliminated ec ("
856 << origStates.size() <<
" states).");
857 for (
auto const& state : origStates) {
858 if (lraMec.containsState(state)) {
859 ecStatesToReach.
set(state,
true);
862 ecStatesToProcess.
set(state,
true);
864 unprocessedStates.
set(state,
false);
865 originalSolution[state] = ecqSolution[ecqState];
870 ecStatesToProcess.
clear();
871 ecStatesToReach.
clear();
877 bool needSchedulerComputation =
false;
879 "Solution for state that stays inside EC must be zero. Got " << ecqSolution[ecqState] <<
" instead.");
880 for (
auto const& state : origStates) {
882 ecStatesToProcess.
set(state,
true);
884 auto validChoices =
transitionMatrix.getRowFilter(ecStatesToProcess, ecStatesToProcess);
886 for (
auto const& state : origStates) {
889 auto nextValidChoice = valid0RewardChoices.getNextSetIndex(groupStart);
890 if (nextValidChoice < groupEnd) {
891 originalOptimalChoices[state] = nextValidChoice - groupStart;
894 ecStatesToAvoid.
set(state,
true);
895 needSchedulerComputation =
true;
898 if (needSchedulerComputation) {
900 auto ecStatesThatCanAvoid =
902 ecStatesToProcess, ecStatesToAvoid,
false, 0, valid0RewardChoices);
903 ecStatesThatCanAvoid.complement();
906 originalOptimalChoices);
911 ecStatesToAvoid.
clear();
912 ecStatesToProcess.
clear();
918 if (origStates.size() > 1) {
919 for (
auto const& state : origStates) {
923 if (origChoice >= groupStart && origChoice < groupEnd) {
924 originalOptimalChoices[state] = origChoice - groupStart;
925 ecStatesToReach.
set(state,
true);
927 STORM_LOG_ASSERT(origStates.size() > 1,
"Multiple original states expected.");
928 ecStatesToProcess.
set(state,
true);
930 unprocessedStates.
set(state,
false);
931 originalSolution[state] = ecqSolution[ecqState];
933 auto validChoices =
transitionMatrix.getRowFilter(ecStatesToProcess, ecStatesToProcess | ecStatesToReach);
936 ecStatesToProcess.
clear();
937 ecStatesToReach.
clear();
940 auto state = *origStates.begin();
943 origChoice >= groupStart && origChoice <
transitionMatrix.getRowGroupIndices()[state + 1],
944 "Invalid choice: " << originalOptimalChoices[state] <<
" at a state with " <<
transitionMatrix.getRowGroupSize(state) <<
" choices.");
945 originalOptimalChoices[state] = origChoice - groupStart;
946 originalSolution[state] = ecqSolution[ecqState];
947 unprocessedStates.
set(state,
false);
959 for (
auto const& sc : mec) {
960 if (unprocessedStates.
get(sc.first)) {
961 ecStatesToReach.
set(sc.first,
true);
971 unprocessedStates &= ~ecStatesToReach;
SolverEnvironment & solver()
void setRelativeTerminationCriterion(bool value)
MinMaxSolverEnvironment & minMax()
std::vector< ValueType > computeUpperBounds()
Computes upper bounds on the expected rewards.
Helper class for model checking queries that depend on the long run behavior of the (nondeterministic...
SparseInfiniteHorizonHelper< ValueType, true >::ValueGetter ValueGetter
Function mapping from indices to values.
PcaaWeightVectorChecker(std::vector< Objective< ValueType > > const &objectives)
boost::optional< ValueType > computeWeightedResultBound(bool lower, std::vector< ValueType > const &weightVector, storm::storage::BitVector const &objectiveFilter) const
std::vector< Objective< ValueType > > objectives
ValueType const & getWeightedPrecision() const
Helper Class that takes preprocessed Pcaa data and a weight vector and ...
storm::storage::BitVector totalReward0EStates
ValueType getOptimalWeightedSum() const override
Retrieves the optimal weighted sum of the objective values (or an upper bound thereof).
std::vector< uint64_t > goalStateMergerReducedToInputChoiceMapping
void unboundedWeightedPhase(Environment const &env, std::vector< ValueType > const &weightedRewardVector, std::vector< ValueType > const &weightVector)
Determines the scheduler that optimizes the weighted reward vector of the unbounded objectives.
virtual void boundedPhase(Environment const &env, std::vector< ValueType > const &weightVector, std::vector< ValueType > &weightedRewardVector)=0
For each time epoch (starting with the maximal stepBound occurring in the objectives),...
std::vector< ValueType > offsetsToAchievablePoint
virtual storm::modelchecker::helper::SparseNondeterministicInfiniteHorizonHelper< ValueType > createNondetInfiniteHorizonHelper(storm::storage::SparseMatrix< ValueType > const &transitions) const =0
boost::optional< LraMecDecomposition > lraMecDecomposition
void computeAndSetBoundsToSolver(storm::solver::AbstractEquationSolver< ValueType > &solver, bool requiresLower, bool requiresUpper, storm::storage::SparseMatrix< ValueType > const &transitions, storm::storage::BitVector const &rowsWithSumLessOne, std::vector< ValueType > const &rewards) const
storm::storage::BitVector objectivesWithNoUpperTimeBound
virtual ValueType getWeightedPrecisionUnboundedPhase() const =0
virtual DeterministicInfiniteHorizonHelperType createDetInfiniteHorizonHelper(storm::storage::SparseMatrix< ValueType > const &transitions) const =0
virtual std::vector< ValueType > getAchievablePoint() const override
Retrieves the result of the individual objectives at the initial state of the given model.
storm::storage::BitVector lraObjectives
storm::storage::SparseMatrix< ValueType > transitionMatrix
void infiniteHorizonWeightedPhase(Environment const &env, std::vector< ValueType > const &weightedActionRewardVector, boost::optional< std::vector< ValueType > > const &weightedStateRewardVector, std::vector< ValueType > const &weightVector)
std::vector< std::vector< ValueType > > actionRewards
StandardPcaaWeightVectorChecker(preprocessing::SparseMultiObjectivePreprocessorResult< SparseModelType > const &preprocessorResult)
std::vector< std::vector< ValueType > > stateRewards
std::vector< ValueType > weightedResult
SparseModelType::ValueType ValueType
std::vector< std::vector< ValueType > > objectiveResults
boost::optional< EcQuotient > ecQuotient
std::vector< uint64_t > goalStateMergerInputToReducedStateIndexMapping
virtual void check(Environment const &env, std::vector< ValueType > weightVector) override
void transformEcqSolutionToOriginalModel(std::vector< ValueType > const &ecqSolution, std::vector< uint_fast64_t > const &ecqOptimalChoices, std::map< uint64_t, uint64_t > const &ecqStateToOptimalMecMap, std::vector< ValueType > &originalSolution, std::vector< uint_fast64_t > &originalOptimalChoices) const
Transforms the results of a min-max-solver that considers a reduced model (without end components) to...
storm::storage::BitVector ecChoicesHint
virtual void initializeModelTypeSpecificData(SparseMaModelType const &model)=0
virtual storm::storage::Scheduler< ValueType > computeScheduler() const override
Retrieves a scheduler that induces the current values Note that check(..) has to be called before ret...
storm::storage::BitVector actionsWithoutRewardInUnboundedPhase
std::vector< uint64_t > optimalChoices
ValueType offsetToWeightedSum
void updateEcQuotient(std::vector< ValueType > const &weightedRewardVector)
void initialize(preprocessing::SparseMultiObjectivePreprocessorResult< SparseModelType > const &preprocessorResult)
void unboundedIndividualPhase(Environment const &env, std::vector< ValueType > const &weightVector)
Computes the values of the objectives that do not have a stepBound w.r.t.
void setBoundsToSolver(storm::solver::AbstractEquationSolver< ValueType > &solver, bool requiresLower, bool requiresUpper, uint64_t objIndex, storm::storage::SparseMatrix< ValueType > const &transitions, storm::storage::BitVector const &rowsWithSumLessOne, std::vector< ValueType > const &rewards) const
static ReturnType analyze(storm::modelchecker::multiobjective::preprocessing::SparseMultiObjectivePreprocessorResult< SparseModelType > const &preprocessorResult)
Analyzes the reward objectives of the multi objective query.
virtual std::unique_ptr< LinearEquationSolver< ValueType > > create(Environment const &env) const override
Creates an equation solver with the current settings, but without a matrix.
virtual std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env) const override
virtual LinearEquationSolverProblemFormat getEquationProblemFormat(Environment const &env) const
Retrieves the problem format that the solver expects if it was created with the current settings.
A bit vector that is internally represented as a vector of 64-bit values.
void complement()
Negates all bits in the bit vector.
uint64_t getNextSetIndex(uint64_t startingIndex) const
Retrieves the index of the bit that is the next bit set to true in the bit vector.
const_iterator end() const
Returns an iterator pointing at the element past the back of the bit vector.
bool empty() const
Retrieves whether no bits are set to true in this bit vector.
void clear()
Removes all set bits from the bit vector.
bool isSubsetOf(BitVector const &other) const
Checks whether all bits that are set in the current bit vector are also set in the given bit vector.
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
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.
This class represents the decomposition of a nondeterministic model into its maximal end components.
This class defines which action is chosen in a particular state of a non-deterministic model.
void setChoice(SchedulerChoice< ValueType > const &choice, uint_fast64_t modelState, uint_fast64_t memoryState=0)
Sets the choice defined by the scheduler for the given state.
A class that holds a possibly non-square matrix in the compressed row storage format.
void convertToEquationSystem()
Transforms the matrix into an equation system.
const_rows getRow(index_type row) const
Returns an object representing the given row.
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 ...
value_type getRowSum(index_type row) const
Computes the sum of the entries in a given row.
index_type getRowGroupCount() const
Returns the number of row groups in the matrix.
storm::storage::BitVector getRowGroupFilter(storm::storage::BitVector const &rowConstraint, bool setIfForAllRowsInGroup) const
Returns the indices of all row groups selected by the row constraints.
std::vector< index_type > const & getRowGroupIndices() const
Returns the grouping of rows of this matrix.
storm::storage::SparseMatrix< value_type > transpose(bool joinGroups=false, bool keepZeros=false) const
Transposes the matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
storm::storage::BitVector getRowFilter(storm::storage::BitVector const &groupConstraint) const
Returns a bitvector representing the set of rows, with all indices set that correspond to one of the ...
#define STORM_LOG_INFO(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
#define STORM_PRINT_AND_LOG(message)
std::vector< uint64_t > computeValidInitialScheduler(storm::storage::SparseMatrix< ValueType > const &matrix, storm::storage::BitVector const &rowsWithSumLessOne)
void computeSchedulerFinitelyOften(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &finitelyOftenChoices, storm::storage::BitVector safeStates, std::vector< uint64_t > &choices)
Computes a scheduler taking the choices from the given set only finitely often.
void computeSchedulerProb1(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &consideredStates, storm::storage::BitVector const &statesToReach, std::vector< uint64_t > &choices, storm::storage::BitVector const *allowedChoices=nullptr)
void computeSchedulerProb0(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &consideredStates, storm::storage::BitVector const &statesToAvoid, storm::storage::BitVector const &allowedChoices, std::vector< uint64_t > &choices)
SettingsType const & getModule()
Get module.
bool constexpr maximize(OptimizationDirection d)
bool constexpr minimize(OptimizationDirection d)
storm::storage::BitVector performProbGreater0(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps)
Performs a backward depth-first search trough the underlying graph structure of the given model to de...
storm::storage::BitVector performProbGreater0A(storm::storage::SparseMatrix< T > const &transitionMatrix, std::vector< uint_fast64_t > const &nondeterministicChoiceIndices, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps, boost::optional< storm::storage::BitVector > const &choiceConstraint)
Computes the sets of states that have probability greater 0 of satisfying phi until psi under any pos...
storm::storage::BitVector performProbGreater0E(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps)
Computes the sets of states that have probability greater 0 of satisfying phi until psi under at leas...
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...
std::vector< TargetType > convertNumericVector(std::vector< SourceType > const &oldVector)
Converts the given vector to the given ValueType Assumes that both, TargetType and SourceType are num...
T dotProduct(std::vector< T > const &firstOperand, std::vector< T > const &secondOperand)
Computes the dot product (aka scalar product) and returns the result.
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.
void selectVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< T > const &values)
Selects the elements from a vector at the specified positions and writes them consecutively into anot...
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...
std::string toString(std::vector< ValueType > const &vector)
Output vector as string.
void clip(std::vector< ValueType > &x, boost::optional< ValueType > const &lowerBound, boost::optional< ValueType > const &upperBound)
Takes the input vector and ensures that all entries conform to the bounds.
void applyPointwise(std::vector< InValueType1 > const &firstOperand, std::vector< InValueType2 > const &secondOperand, std::vector< OutValueType > &target, Operation f=Operation())
Applies the given operation pointwise on the two given vectors and writes the result to the third vec...
VT sum_if(std::vector< VT > const &values, storm::storage::BitVector const &filter)
Sum the entries from values that are set to one in the filter vector.
std::vector< uint_fast64_t > getSortedIndices(std::vector< T > const &v)
Returns a list of indices such that the first index refers to the highest entry of the given vector,...
storm::storage::BitVector filterZero(std::vector< T > const &values)
Retrieves a bit vector containing all the indices for which the value at this position is equal to ze...
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 isOne(ValueType const &a)
bool isZero(ValueType const &a)
ValueType abs(ValueType const &number)
ValueType sqrt(ValueType const &number)
TargetType convertNumber(SourceType const &number)
std::shared_ptr< SparseModelType > preprocessedModel
bool containsRewardBoundedObjective() const