Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::models::symbolic::Dtmc< Type, ValueType > Class Template Reference

This class represents a discrete-time Markov chain. More...

#include <Dtmc.h>

Inheritance diagram for storm::models::symbolic::Dtmc< Type, ValueType >:
Collaboration diagram for storm::models::symbolic::Dtmc< Type, ValueType >:

Public Types

typedef DeterministicModel< Type, ValueType >::RewardModelType RewardModelType
 
- Public Types inherited from storm::models::symbolic::DeterministicModel< Type, ValueType >
typedef Model< Type, ValueType >::RewardModelType RewardModelType
 
- Public Types inherited from storm::models::symbolic::Model< Type, CValueType >
typedef CValueType ValueType
 
typedef StandardRewardModel< Type, ValueTypeRewardModelType
 

Public Member Functions

 Dtmc (Dtmc< Type, ValueType > const &other)=default
 
Dtmcoperator= (Dtmc< Type, ValueType > const &other)=default
 
 Dtmc (Dtmc< Type, ValueType > &&other)=default
 
Dtmcoperator= (Dtmc< Type, ValueType > &&other)=default
 
 Dtmc (std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > rowExpressionAdapter, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::expressions::Expression > labelToExpressionMap=std::map< std::string, storm::expressions::Expression >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
 Dtmc (std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::dd::Bdd< Type > > labelToBddMap=std::map< std::string, storm::dd::Bdd< Type > >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
virtual void reduceToStateBasedRewards () override
 Converts the transition rewards of all reward models to state-based rewards.
 
template<typename NewValueType >
std::shared_ptr< Dtmc< Type, NewValueType > > toValueType () const
 
- Public Member Functions inherited from storm::models::symbolic::DeterministicModel< Type, ValueType >
 DeterministicModel (DeterministicModel< Type, ValueType > const &other)=default
 
DeterministicModeloperator= (DeterministicModel< Type, ValueType > const &other)=default
 
 DeterministicModel (DeterministicModel< Type, ValueType > &&other)=default
 
DeterministicModeloperator= (DeterministicModel< Type, ValueType > &&other)=default
 
 DeterministicModel (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > rowExpressionAdapter, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::expressions::Expression > labelToExpressionMap=std::map< std::string, storm::expressions::Expression >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
 DeterministicModel (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::dd::Bdd< Type > > labelToBddMap=std::map< std::string, storm::dd::Bdd< Type > >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
- Public Member Functions inherited from storm::models::symbolic::Model< Type, CValueType >
 Model (Model< Type, ValueType > const &other)=default
 
Modeloperator= (Model< Type, ValueType > const &other)=default
 
 Model (Model< Type, ValueType > &&other)=default
 
Modeloperator= (Model< Type, ValueType > &&other)=default
 
 Model (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > rowExpressionAdapter, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::expressions::Expression > labelToExpressionMap=std::map< std::string, storm::expressions::Expression >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
 Model (storm::models::ModelType const &modelType, std::shared_ptr< storm::dd::DdManager< Type > > manager, storm::dd::Bdd< Type > reachableStates, storm::dd::Bdd< Type > initialStates, storm::dd::Bdd< Type > deadlockStates, storm::dd::Add< Type, ValueType > transitionMatrix, std::set< storm::expressions::Variable > const &rowVariables, std::set< storm::expressions::Variable > const &columnVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::map< std::string, storm::dd::Bdd< Type > > labelToBddMap=std::map< std::string, storm::dd::Bdd< Type > >(), std::unordered_map< std::string, RewardModelType > const &rewardModels=std::unordered_map< std::string, RewardModelType >())
 Constructs a model from the given data.
 
virtual uint_fast64_t getNumberOfStates () const override
 Returns the number of states of the model.
 
virtual uint_fast64_t getNumberOfTransitions () const override
 Returns the number of (non-zero) transitions of the model.
 
virtual uint_fast64_t getNumberOfChoices () const override
 Returns the number of choices ine the model.
 
storm::dd::DdManager< Type > & getManager () const
 Retrieves the manager responsible for the DDs that represent this model.
 
std::shared_ptr< storm::dd::DdManager< Type > > const & getManagerAsSharedPointer () const
 Retrieves the manager responsible for the DDs that represent this model.
 
storm::dd::Bdd< Type > const & getReachableStates () const
 Retrieves the reachable states of the model.
 
storm::dd::Bdd< Type > const & getInitialStates () const
 Retrieves the initial states of the model.
 
storm::dd::Bdd< Type > const & getDeadlockStates () const
 
virtual storm::dd::Bdd< Type > getStates (std::string const &label) const
 Returns the sets of states labeled with the given label.
 
virtual storm::expressions::Expression getExpression (std::string const &label) const
 Returns the expression for the given label.
 
virtual storm::dd::Bdd< Type > getStates (storm::expressions::Expression const &expression) const
 Returns the set of states labeled satisfying the given expression (that must be of boolean type).
 
virtual bool hasLabel (std::string const &label) const
 Retrieves whether the given label is a valid label in this model.
 
storm::dd::Add< Type, ValueType > const & getTransitionMatrix () const
 Retrieves the matrix representing the transitions of the model.
 
storm::dd::Add< Type, ValueType > & getTransitionMatrix ()
 Retrieves the matrix representing the transitions of the model.
 
virtual storm::dd::Bdd< Type > getQualitativeTransitionMatrix (bool keepNondeterminism=true) const
 Retrieves the matrix qualitatively (i.e.
 
std::set< storm::expressions::Variable > const & getRowVariables () const
 Retrieves the meta variables used to encode the rows of the transition matrix and the vector indices.
 
std::set< storm::expressions::Variable > const & getColumnVariables () const
 Retrieves the meta variables used to encode the columns of the transition matrix and the vector indices.
 
std::set< storm::expressions::VariablegetRowAndNondeterminismVariables () const
 Retrieves all meta variables used to encode rows and nondetermism.
 
std::set< storm::expressions::VariablegetColumnAndNondeterminismVariables () const
 Retrieves all meta variables used to encode columns and nondetermism.
 
virtual std::set< storm::expressions::Variable > const & getNondeterminismVariables () const
 Retrieves all meta variables used to encode the nondeterminism.
 
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const & getRowColumnMetaVariablePairs () const
 Retrieves the pairs of row and column meta variables.
 
storm::dd::Add< Type, ValueTypegetRowColumnIdentity () const
 Retrieves an ADD that represents the diagonal of the transition matrix.
 
virtual bool hasRewardModel (std::string const &rewardModelName) const override
 Retrieves whether the model has a reward model with the given name.
 
RewardModelType const & getRewardModel (std::string const &rewardModelName) const
 Retrieves the reward model with the given name, if one exists.
 
RewardModelType const & getUniqueRewardModel () const
 Retrieves the unique reward model, if there exists exactly one.
 
virtual std::string const & getUniqueRewardModelName () const override
 Retrieves the name of the unique reward model, if there exists exactly one.
 
RewardModelTypegetUniqueRewardModel ()
 Retrieves the unique reward model, if there exists exactly one.
 
virtual bool hasUniqueRewardModel () const override
 Retrieves whether the model has a unique reward model.
 
bool hasRewardModel () const
 Retrieves whether the model has at least one reward model.
 
std::unordered_map< std::string, RewardModelType > & getRewardModels ()
 
std::unordered_map< std::string, RewardModelType > const & getRewardModels () const
 
uint_fast64_t getNumberOfRewardModels () const
 Retrieves the number of reward models associated with this model.
 
virtual void printModelInformationToStream (std::ostream &out) const override
 Prints information about the model to the specified stream.
 
virtual bool isSymbolicModel () const override
 Checks whether the model is a symbolic model.
 
virtual bool supportsParameters () const override
 Checks whether the model supports parameters.
 
virtual bool hasParameters () const override
 Checks whether the model has parameters.
 
std::vector< std::string > getLabels () const
 
void addParameters (std::set< storm::RationalFunctionVariable > const &parameters)
 
std::set< storm::RationalFunctionVariable > const & getParameters () const
 
template<typename NewValueType >
std::enable_if<!std::is_same< ValueType, NewValueType >::value, std::shared_ptr< Model< Type, NewValueType > > >::type toValueType () const
 
template<typename NewValueType >
std::enable_if< std::is_same< ValueType, NewValueType >::value, std::shared_ptr< Model< Type, NewValueType > > >::type toValueType () const
 
void writeDotToFile (std::string const &filename) const
 
void addParameters (std::set< storm::RationalFunctionVariable > const &parameters)
 
std::set< storm::RationalFunctionVariable > const & getParameters () const
 
- Public Member Functions inherited from storm::models::Model< ValueType >
 Model (ModelType const &modelType)
 Constructs a model of the given type.
 
virtual ~Model ()=default
 
- Public Member Functions inherited from storm::models::ModelBase
 ModelBase (ModelType const &modelType)
 Constructs a model of the given type.
 
virtual ~ModelBase ()
 
template<typename ModelType >
std::shared_ptr< ModelTypeas ()
 Casts the model into the model type given by the template parameter.
 
template<typename ModelType >
std::shared_ptr< ModelType const > as () const
 Casts the model into the model type given by the template parameter.
 
virtual ModelType getType () const
 Return the actual type of the model.
 
virtual bool isSparseModel () const
 Checks whether the model is a sparse model.
 
bool isOfType (storm::models::ModelType const &modelType) const
 Checks whether the model is of the given type.
 
bool isNondeterministicModel () const
 Returns true if the model is a nondeterministic model.
 
bool isDiscreteTimeModel () const
 Returns true if the model is a descrete-time model.
 
virtual bool isExact () const
 Checks whether the model is exact.
 
virtual bool isPartiallyObservable () const
 

Additional Inherited Members

- Static Public Attributes inherited from storm::models::symbolic::Model< Type, CValueType >
static const storm::dd::DdType DdType = Type
 
static const storm::models::ModelRepresentation Representation = GetModelRepresentation<DdType>::representation
 
- Protected Member Functions inherited from storm::models::symbolic::Model< Type, CValueType >
void setTransitionMatrix (storm::dd::Add< Type, ValueType > const &transitionMatrix)
 Sets the transition matrix of the model.
 
std::map< std::string, storm::expressions::Expression > const & getLabelToExpressionMap () const
 Retrieves the mapping of labels to their defining expressions.
 
std::map< std::string, storm::dd::Bdd< Type > > const & getLabelToBddMap () const
 Retrieves the mapping of labels to their defining expressions.
 
void printModelInformationHeaderToStream (std::ostream &out) const
 Prints the information header (number of states and transitions) of the model to the specified stream.
 
void printModelInformationFooterToStream (std::ostream &out) const
 Prints the information footer (reward models, labels) of the model to the specified stream.
 
void printRewardModelsInformationToStream (std::ostream &out) const
 Prints information about the reward models to the specified stream.
 
virtual void printDdVariableInformationToStream (std::ostream &out) const
 Prints information about the DD variables to the specified stream.
 
std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > > const & getRowExpressionAdapter () const
 Retrieves the expression adapter of this model.
 
- Protected Attributes inherited from storm::models::symbolic::Model< Type, CValueType >
storm::dd::Add< Type, ValueTypetransitionMatrix
 

Detailed Description

template<storm::dd::DdType Type, typename ValueType = double>
class storm::models::symbolic::Dtmc< Type, ValueType >

This class represents a discrete-time Markov chain.

Definition at line 15 of file Dtmc.h.

Member Typedef Documentation

◆ RewardModelType

template<storm::dd::DdType Type, typename ValueType = double>
typedef DeterministicModel<Type,ValueType>::RewardModelType storm::models::symbolic::Dtmc< Type, ValueType >::RewardModelType

Definition at line 17 of file Dtmc.h.

Constructor & Destructor Documentation

◆ Dtmc() [1/4]

template<storm::dd::DdType Type, typename ValueType = double>
storm::models::symbolic::Dtmc< Type, ValueType >::Dtmc ( Dtmc< Type, ValueType > const &  other)
default

◆ Dtmc() [2/4]

template<storm::dd::DdType Type, typename ValueType = double>
storm::models::symbolic::Dtmc< Type, ValueType >::Dtmc ( Dtmc< Type, ValueType > &&  other)
default

◆ Dtmc() [3/4]

template<storm::dd::DdType Type, typename ValueType >
storm::models::symbolic::Dtmc< Type, ValueType >::Dtmc ( std::shared_ptr< storm::dd::DdManager< Type > >  manager,
storm::dd::Bdd< Type >  reachableStates,
storm::dd::Bdd< Type >  initialStates,
storm::dd::Bdd< Type >  deadlockStates,
storm::dd::Add< Type, ValueType transitionMatrix,
std::set< storm::expressions::Variable > const &  rowVariables,
std::shared_ptr< storm::adapters::AddExpressionAdapter< Type, ValueType > >  rowExpressionAdapter,
std::set< storm::expressions::Variable > const &  columnVariables,
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &  rowColumnMetaVariablePairs,
std::map< std::string, storm::expressions::Expression labelToExpressionMap = std::map<std::string, storm::expressions::Expression>(),
std::unordered_map< std::string, RewardModelType > const &  rewardModels = std::unordered_map<std::string, RewardModelType>() 
)

Constructs a model from the given data.

Parameters
managerThe manager responsible for the decision diagrams.
reachableStatesA DD representing the reachable states.
initialStatesA DD representing the initial states of the model.
deadlockStatesA DD representing the deadlock states of the model.
transitionMatrixThe matrix representing the transitions in the model.
rowVariablesThe set of row meta variables used in the DDs.
rowExpressionAdapterAn object that can be used to translate expressions in terms of the row meta variables.
columVariablesThe set of column meta variables used in the DDs.
rowColumnMetaVariablePairsAll pairs of row/column meta variables.
labelToExpressionMapA mapping from label names to their defining expressions.
rewardModelsThe reward models associated with the model.

Definition at line 16 of file Dtmc.cpp.

◆ Dtmc() [4/4]

template<storm::dd::DdType Type, typename ValueType >
storm::models::symbolic::Dtmc< Type, ValueType >::Dtmc ( std::shared_ptr< storm::dd::DdManager< Type > >  manager,
storm::dd::Bdd< Type >  reachableStates,
storm::dd::Bdd< Type >  initialStates,
storm::dd::Bdd< Type >  deadlockStates,
storm::dd::Add< Type, ValueType transitionMatrix,
std::set< storm::expressions::Variable > const &  rowVariables,
std::set< storm::expressions::Variable > const &  columnVariables,
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &  rowColumnMetaVariablePairs,
std::map< std::string, storm::dd::Bdd< Type > >  labelToBddMap = std::map<std::string, storm::dd::Bdd<Type>>(),
std::unordered_map< std::string, RewardModelType > const &  rewardModels = std::unordered_map<std::string, RewardModelType>() 
)

Constructs a model from the given data.

Parameters
managerThe manager responsible for the decision diagrams.
reachableStatesA DD representing the reachable states.
initialStatesA DD representing the initial states of the model.
deadlockStatesA DD representing the deadlock states of the model.
transitionMatrixThe matrix representing the transitions in the model.
rowVariablesThe set of row meta variables used in the DDs.
columVariablesThe set of column meta variables used in the DDs.
rowColumnMetaVariablePairsAll pairs of row/column meta variables.
labelToBddMapA mapping from label names to their defining BDDs.
rewardModelsThe reward models associated with the model.

Definition at line 30 of file Dtmc.cpp.

Member Function Documentation

◆ operator=() [1/2]

template<storm::dd::DdType Type, typename ValueType = double>
Dtmc & storm::models::symbolic::Dtmc< Type, ValueType >::operator= ( Dtmc< Type, ValueType > &&  other)
default

◆ operator=() [2/2]

template<storm::dd::DdType Type, typename ValueType = double>
Dtmc & storm::models::symbolic::Dtmc< Type, ValueType >::operator= ( Dtmc< Type, ValueType > const &  other)
default

◆ reduceToStateBasedRewards()

template<storm::dd::DdType Type, typename ValueType >
void storm::models::symbolic::Dtmc< Type, ValueType >::reduceToStateBasedRewards ( )
overridevirtual

Converts the transition rewards of all reward models to state-based rewards.

For deterministic models, this reduces the rewards to state rewards only. For nondeterminstic models, the reward models will contain state rewards and state-action rewards. Note that this transformation does not preserve all properties, but it preserves expected rewards.

Implements storm::models::ModelBase.

Definition at line 41 of file Dtmc.cpp.

◆ toValueType()

template<storm::dd::DdType Type, typename ValueType >
template<typename NewValueType >
template std::shared_ptr< Dtmc< storm::dd::DdType::Sylvan, double > > storm::models::symbolic::Dtmc< Type, ValueType >::toValueType ( ) const

Definition at line 49 of file Dtmc.cpp.


The documentation for this class was generated from the following files: