1#ifndef STORM_UTILITY_GRAPH_H_
2#define STORM_UTILITY_GRAPH_H_
30template<storm::dd::DdType Type,
typename ValueType>
33template<storm::dd::DdType Type,
typename ValueType>
34class DeterministicModel;
36template<storm::dd::DdType Type,
typename ValueType>
37class NondeterministicModel;
39template<storm::dd::DdType Type,
typename ValueType>
40class StochasticTwoPlayerGame;
46template<storm::dd::DdType Type>
49template<storm::dd::DdType Type,
typename ValueType>
55class ExplicitGameStrategyPair;
85 bool useStepBound =
false, uint_fast64_t maximalSteps = 0,
86 boost::optional<storm::storage::BitVector>
const& choiceFilter = boost::none);
130 boost::optional<storm::storage::BitVector>
const& subsystem = boost::none);
223template<storm::dd::DdType Type,
typename ValueType>
226 boost::optional<uint_fast64_t>
const& stepBound = boost::optional<uint_fast64_t>());
239template<storm::dd::DdType Type,
typename ValueType>
254template<storm::dd::DdType Type,
typename ValueType>
267template<storm::dd::DdType Type,
typename ValueType>
281template<storm::dd::DdType Type,
typename ValueType>
295template<
typename T,
typename SchedulerValueType>
298 boost::optional<storm::storage::BitVector>
const& rowFilter = boost::none);
326template<
typename T,
typename SchedulerValueType>
330 boost::optional<storm::storage::BitVector>
const& rowFilter = boost::none);
340template<
typename T,
typename SchedulerValueType>
351template<
typename T,
typename SchedulerValueType>
366template<
typename T,
typename SchedulerValueType>
370 boost::optional<storm::storage::BitVector>
const& rowFilter = boost::none);
408 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices,
411 boost::optional<storm::storage::BitVector>
const& choiceConstraint = boost::none);
425template<
typename T,
typename RM>
432 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices,
447template<
typename T,
typename RM>
469 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices,
472 boost::optional<storm::storage::BitVector>
const& choiceConstraint = boost::none);
486template<
typename T,
typename RM>
492 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices,
508template<
typename T,
typename RM>
515 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices,
521 std::vector<uint_fast64_t>
const& nondeterministicChoiceIndices,
536template<
typename T,
typename RM>
551template<storm::dd::DdType Type,
typename ValueType =
double>
559template<storm::dd::DdType Type,
typename ValueType>
574template<storm::dd::DdType Type,
typename ValueType =
double>
588template<storm::dd::DdType Type,
typename ValueType =
double>
603template<storm::dd::DdType Type,
typename ValueType =
double>
618template<storm::dd::DdType Type,
typename ValueType =
double>
634template<storm::dd::DdType Type,
typename ValueType =
double>
642template<storm::dd::DdType Type,
typename ValueType>
647template<storm::dd::DdType Type,
typename ValueType =
double>
651template<storm::dd::DdType Type,
typename ValueType =
double>
656template<storm::dd::DdType Type,
typename ValueType =
double>
660template<storm::dd::DdType Type,
typename ValueType =
double>
665template<storm::dd::DdType Type>
723template<storm::dd::DdType Type,
typename ValueType>
728 bool producePlayer2Strategy =
false);
741template<storm::dd::DdType Type,
typename ValueType>
746 bool producePlayer2Strategy =
false, boost::optional<
storm::dd::Bdd<Type>>
const& player1Candidates = boost::none);
786template<
typename ValueType>
808template<
typename ValueType>
814 boost::optional<storm::storage::BitVector>
const& player1Candidates = boost::none);
The base class of all sparse deterministic models.
The base class of sparse nondeterministic models.
Base class for all deterministic symbolic models.
Base class for all symbolic models.
Base class for all nondeterministic symbolic models.
This class represents a discrete-time stochastic two-player game.
A bit vector that is internally represented as a vector of 64-bit values.
This class defines which action is chosen in a particular state of a non-deterministic model.
A class that holds a possibly non-square matrix in the compressed row storage format.
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01(storm::models::sparse::DeterministicModel< T > const &model, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 0 or 1, respectively, of satisfying phi until psi i...
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01Max(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)
void computeSchedulerStayingInStates(storm::storage::BitVector const &states, storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::Scheduler< SchedulerValueType > &scheduler, boost::optional< storm::storage::BitVector > const &rowFilter)
Computes a scheduler for the given states that chooses an action that stays completely in the very sa...
ExplicitGameProb01Result performProb0(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< uint64_t > const &player1Groups, storm::storage::SparseMatrix< ValueType > const &player1BackwardTransitions, std::vector< uint64_t > const &player2BackwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, storm::OptimizationDirection const &player1Direction, storm::OptimizationDirection const &player2Direction, storm::storage::ExplicitGameStrategyPair *strategyPair)
Computes the set of states that have probability 0 given the strategies of the two players.
std::vector< uint_fast64_t > getTopologicalSort(storm::storage::SparseMatrix< T > const &matrix, std::vector< uint64_t > const &firstStates)
Performs a topological sort of the states of the system according to the given transitions.
void computeSchedulerProbGreater0E(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, storm::storage::Scheduler< SchedulerValueType > &scheduler, boost::optional< storm::storage::BitVector > const &rowFilter)
Computes a scheduler for the ProbGreater0E-States such that in the induced system the given psiStates...
std::vector< uint_fast64_t > getBFSSort(storm::storage::SparseMatrix< T > const &matrix, std::vector< uint_fast64_t > const &firstStates)
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...
storm::storage::BitVector getReachableOneStep(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::BitVector const &initialStates)
Computes the states reachable in one step from the states indicated by the bitvector.
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...
void computeSchedulerWithOneSuccessorInStates(storm::storage::BitVector const &states, storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::Scheduler< SchedulerValueType > &scheduler)
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...
void computeSchedulerProb1E(storm::storage::BitVector const &prob1EStates, storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, storm::storage::Scheduler< SchedulerValueType > &scheduler, boost::optional< storm::storage::BitVector > const &rowFilter)
Computes a scheduler for the given prob1EStates such that in the induced system the given psiStates a...
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 performProb1A(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 1 of satisfying phi until psi under all possible re...
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 performProb0A(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
storm::storage::BitVector performProb1(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &, storm::storage::BitVector const &psiStates, storm::storage::BitVector const &statesWithProbabilityGreater0)
Computes the set of states of the given model for which all paths lead to the given set of target sta...
bool checkIfECWithChoiceExists(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &subsystem, storm::storage::BitVector const &choices)
Checks whether there is an End Component that.
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...
storm::storage::BitVector getBsccCover(storm::storage::SparseMatrix< T > const &transitionMatrix)
Retrieves a set of states that covers als BSCCs of the system in the sense that for every BSCC exactl...
void computeSchedulerProb0E(storm::storage::BitVector const &prob0EStates, storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::Scheduler< SchedulerValueType > &scheduler)
Computes a scheduler for the given states that have a scheduler that has a probability 0.
std::pair< storm::storage::BitVector, storm::storage::BitVector > performProb01Min(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)
std::vector< uint_fast64_t > getDistances(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::BitVector const &initialStates, boost::optional< storm::storage::BitVector > const &subsystem)
Performs a breadth-first search through the underlying graph structure to compute the distance from a...
storm::storage::BitVector performProb1E(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, boost::optional< storm::storage::BitVector > const &choiceConstraint)
Computes the sets of states that have probability 1 of satisfying phi until psi under at least one po...
void computeSchedulerRewInf(storm::storage::BitVector const &rewInfStates, storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::Scheduler< SchedulerValueType > &scheduler)
Computes a scheduler for the given states that have a scheduler that has a reward infinity.
storage::BitVector BitVector
ExplicitGameProb01Result(storm::storage::BitVector const &player1States, storm::storage::BitVector const &player2States)
storm::storage::BitVector const & getPlayer1States() const
ExplicitGameProb01Result()=default
storm::storage::BitVector player2States
storm::storage::BitVector const & getPlayer2States() const
ExplicitGameProb01Result(uint64_t numberOfPlayer1States, uint64_t numberOfPlayer2States)
storm::storage::BitVector player1States
boost::optional< storm::dd::Bdd< Type > > player1Strategy
bool hasPlayer1Strategy() const
SymbolicGameProb01Result(storm::dd::Bdd< Type > const &player1States, storm::dd::Bdd< Type > const &player2States, boost::optional< storm::dd::Bdd< Type > > const &player1Strategy=boost::none, boost::optional< storm::dd::Bdd< Type > > const &player2Strategy=boost::none)
boost::optional< storm::dd::Bdd< Type > > const & getOptionalPlayer2Strategy()
storm::dd::Bdd< Type > const & getPlayer2States() const
bool hasPlayer2Strategy() const
storm::dd::Bdd< Type > const & getPlayer1Strategy() const
boost::optional< storm::dd::Bdd< Type > > const & getOptionalPlayer1Strategy()
storm::dd::Bdd< Type > player1States
storm::dd::Bdd< Type > const & getPlayer2Strategy() const
boost::optional< storm::dd::Bdd< Type > > player2Strategy
SymbolicGameProb01Result()=default
storm::dd::Bdd< Type > const & getPlayer1States() const
storm::dd::Bdd< Type > player2States