Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::storage::DistributionWithReward< ValueType, StateType > Class Template Reference

#include <DistributionWithReward.h>

Inheritance diagram for storm::storage::DistributionWithReward< ValueType, StateType >:
Collaboration diagram for storm::storage::DistributionWithReward< ValueType, StateType >:

Public Member Functions

 DistributionWithReward (ValueType const &reward=storm::utility::zero< ValueType >())
 Creates an empty distribution.
 
 DistributionWithReward (DistributionWithReward const &other)=default
 
DistributionWithRewardoperator= (DistributionWithReward const &other)=default
 
 DistributionWithReward (DistributionWithReward &&other)=default
 
DistributionWithRewardoperator= (DistributionWithReward &&other)=default
 
bool equals (DistributionWithReward< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >()) const
 Checks whether the two distributions specify the same probabilities to go to the same states.
 
bool less (DistributionWithReward< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
 
void setReward (ValueType const &reward)
 Sets the reward of this distribution.
 
ValueType const & getReward () const
 Retrieves the reward of this distribution.
 
- Public Member Functions inherited from storm::storage::Distribution< ValueType, StateType >
 Distribution ()
 Creates an empty distribution.
 
 Distribution (Distribution const &other)=default
 
Distributionoperator= (Distribution const &other)=default
 
 Distribution (Distribution &&other)=default
 
Distributionoperator= (Distribution &&other)=default
 
void reserve (uint64_t size)
 
void add (Distribution const &other)
 Adds the given distribution to the current one.
 
bool equals (Distribution< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >()) const
 Checks whether the two distributions specify the same probabilities to go to the same states.
 
void addProbability (StateType const &state, ValueType const &probability)
 Assigns the given state the given probability under this distribution.
 
void removeProbability (StateType const &state, ValueType const &probability, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >())
 Removes the given probability mass of going to the given state.
 
void shiftProbability (StateType const &fromState, StateType const &toState, ValueType const &probability, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >())
 Removes the probability mass from one state and adds it to another.
 
iterator begin ()
 Retrieves an iterator to the elements in this distribution.
 
const_iterator begin () const
 Retrieves an iterator to the elements in this distribution.
 
const_iterator cbegin () const
 Retrieves an iterator to the elements in this distribution.
 
iterator end ()
 Retrieves an iterator past the elements in this distribution.
 
const_iterator end () const
 Retrieves an iterator past the elements in this distribution.
 
const_iterator cend () const
 Retrieves an iterator past the elements in this distribution.
 
void scale (StateType const &state)
 Scales the distribution by multiplying all the probabilities with 1/p where p is the probability of moving to the given state and sets the probability of moving to the given state to zero.
 
std::size_t size () const
 Retrieves the size of the distribution, i.e.
 
bool less (Distribution< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
 
ValueType getProbability (StateType const &state) const
 Returns the probability of the given state.
 
void normalize ()
 Normalizes the distribution such that the values sum up to one.
 
StateType sampleFromDistribution (ValueType const &quantile) const
 Given a value q, find the event in the ordered distribution that corresponds to this prob.
 

Additional Inherited Members

- Public Types inherited from storm::storage::Distribution< ValueType, StateType >
typedef boost::container::flat_map< StateType, ValueType > container_type
 
typedef container_type::iterator iterator
 
typedef container_type::const_iterator const_iterator
 

Detailed Description

template<typename ValueType, typename StateType = uint32_t>
class storm::storage::DistributionWithReward< ValueType, StateType >

Definition at line 13 of file DistributionWithReward.h.

Constructor & Destructor Documentation

◆ DistributionWithReward() [1/3]

template<typename ValueType , typename StateType >
storm::storage::DistributionWithReward< ValueType, StateType >::DistributionWithReward ( ValueType const &  reward = storm::utility::zero<ValueType>())

Creates an empty distribution.

Definition at line 11 of file DistributionWithReward.cpp.

◆ DistributionWithReward() [2/3]

template<typename ValueType , typename StateType = uint32_t>
storm::storage::DistributionWithReward< ValueType, StateType >::DistributionWithReward ( DistributionWithReward< ValueType, StateType > const &  other)
default

◆ DistributionWithReward() [3/3]

template<typename ValueType , typename StateType = uint32_t>
storm::storage::DistributionWithReward< ValueType, StateType >::DistributionWithReward ( DistributionWithReward< ValueType, StateType > &&  other)
default

Member Function Documentation

◆ equals()

template<typename ValueType , typename StateType >
bool storm::storage::DistributionWithReward< ValueType, StateType >::equals ( DistributionWithReward< ValueType, StateType > const &  other,
storm::utility::ConstantsComparator< ValueType > const &  comparator = storm::utility::ConstantsComparator<ValueType>() 
) const

Checks whether the two distributions specify the same probabilities to go to the same states.

Parameters
otherThe distribution with which the current distribution is to be compared.
Returns
True iff the two distributions are equal.

Definition at line 16 of file DistributionWithReward.cpp.

◆ getReward()

template<typename ValueType , typename StateType >
ValueType const & storm::storage::DistributionWithReward< ValueType, StateType >::getReward ( ) const

Retrieves the reward of this distribution.

Definition at line 42 of file DistributionWithReward.cpp.

◆ less()

template<typename ValueType , typename StateType >
bool storm::storage::DistributionWithReward< ValueType, StateType >::less ( DistributionWithReward< ValueType, StateType > const &  other,
storm::utility::ConstantsComparator< ValueType > const &  comparator 
) const

Definition at line 25 of file DistributionWithReward.cpp.

◆ operator=() [1/2]

template<typename ValueType , typename StateType = uint32_t>
DistributionWithReward & storm::storage::DistributionWithReward< ValueType, StateType >::operator= ( DistributionWithReward< ValueType, StateType > &&  other)
default

◆ operator=() [2/2]

template<typename ValueType , typename StateType = uint32_t>
DistributionWithReward & storm::storage::DistributionWithReward< ValueType, StateType >::operator= ( DistributionWithReward< ValueType, StateType > const &  other)
default

◆ setReward()

template<typename ValueType , typename StateType >
void storm::storage::DistributionWithReward< ValueType, StateType >::setReward ( ValueType const &  reward)

Sets the reward of this distribution.

Definition at line 37 of file DistributionWithReward.cpp.


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