Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::pomdp::beliefs::Belief< ValueTypeArg > Class Template Reference

Represents a belief of a Pomdp, i.e. More...

#include <Belief.h>

Classes

struct  BeliefHash

Public Types

using ValueType = ValueTypeArg

Public Member Functions

 Belief ()=delete
 Belief (Belief const &other)=default
 Belief (Belief &&other)=default
Belief< ValueType > & operator= (Belief const &other)=delete
Belief< ValueType > & operator= (Belief &&other)=delete
std::size_t size () const
BeliefStateType representativeState () const
BeliefObservationType const & observation () const
bool operator== (Belief const &other) const
std::string toString (bool convertToDouble=true, bool fullPrecision=false) const
 A (human-readable) string representation of this belief.
template<typename SummandsType>
SummandsType getWeightedSum (std::vector< SummandsType > const &summands) const
template<typename FunctionType>
void forEach (FunctionType const &f) const
template<typename FunctionType>
bool allOf (FunctionType const &f) const
template<typename FunctionType>
void forEachStateInSupport (FunctionType const &f) const
template<typename FunctionType>
void forEachCombine (Belief< ValueType > const &other, FunctionType const &f, bool considerOnlyThisSupport=false) const
 Calls the function f for each state in X with the arguments (state, value1, value2), where.

Friends

class BeliefBuilder< Belief< ValueType > >

Detailed Description

template<typename ValueTypeArg>
class storm::pomdp::beliefs::Belief< ValueTypeArg >

Represents a belief of a Pomdp, i.e.

a probability distribution over the states of a POMDP. A belief also knows its observation.

Note
A belief cannot be modified or assigned after construction. Use the BeliefBuilder class to construct new beliefs. Moving a belief transfers its contents and leaves the source in a moved-from state.
Template Parameters
ValueTypeArgthe type of the values (probabilities) of the belief.

Definition at line 21 of file Belief.h.

Member Typedef Documentation

◆ ValueType

template<typename ValueTypeArg>
using storm::pomdp::beliefs::Belief< ValueTypeArg >::ValueType = ValueTypeArg

Definition at line 23 of file Belief.h.

Constructor & Destructor Documentation

◆ Belief() [1/3]

template<typename ValueTypeArg>
storm::pomdp::beliefs::Belief< ValueTypeArg >::Belief ( )
delete

◆ Belief() [2/3]

template<typename ValueTypeArg>
storm::pomdp::beliefs::Belief< ValueTypeArg >::Belief ( Belief< ValueTypeArg > const & other)
default

◆ Belief() [3/3]

template<typename ValueTypeArg>
storm::pomdp::beliefs::Belief< ValueTypeArg >::Belief ( Belief< ValueTypeArg > && other)
default

Member Function Documentation

◆ allOf()

template<typename ValueTypeArg>
template<typename FunctionType>
bool storm::pomdp::beliefs::Belief< ValueTypeArg >::allOf ( FunctionType const & f) const
inline
Returns
true if f returns true for all (state, value)-pairs in the support of this belief.

Definition at line 95 of file Belief.h.

◆ forEach()

template<typename ValueTypeArg>
template<typename FunctionType>
void storm::pomdp::beliefs::Belief< ValueTypeArg >::forEach ( FunctionType const & f) const
inline
Parameters
fa function that is called for each (state, value)-pair in the support of this belief.

Definition at line 85 of file Belief.h.

◆ forEachCombine()

template<typename ValueTypeArg>
template<typename FunctionType>
void storm::pomdp::beliefs::Belief< ValueTypeArg >::forEachCombine ( Belief< ValueType > const & other,
FunctionType const & f,
bool considerOnlyThisSupport = false ) const
inline

Calls the function f for each state in X with the arguments (state, value1, value2), where.

  • value1 is the value for state of this belief
  • value2 is the value for state of the other belief
  • if considerOnlyThisSupport is true, X is the set of states in the support of this belief
  • otherwise, X is the set of states in the support of either this or the other belief

Definition at line 122 of file Belief.h.

◆ forEachStateInSupport()

template<typename ValueTypeArg>
template<typename FunctionType>
void storm::pomdp::beliefs::Belief< ValueTypeArg >::forEachStateInSupport ( FunctionType const & f) const
inline
Parameters
fa function that is called for each state in the support of this belief.

Definition at line 108 of file Belief.h.

◆ getWeightedSum()

template<typename ValueTypeArg>
template<typename SummandsType>
SummandsType storm::pomdp::beliefs::Belief< ValueTypeArg >::getWeightedSum ( std::vector< SummandsType > const & summands) const
inline
Parameters
summandsa vector containing a value for each state of the underlying POMDP.
Returns
the sum of the POMDP state values, each multiplied by the value assigned to that state in this belief
Precondition
for every state in the support of this belief, the corresponding index in summands must be valid

Definition at line 67 of file Belief.h.

◆ observation()

template<typename ValueType>
BeliefObservationType const & storm::pomdp::beliefs::Belief< ValueType >::observation ( ) const
Returns
the observation of this belief.

Definition at line 30 of file Belief.cpp.

◆ operator=() [1/2]

template<typename ValueTypeArg>
Belief< ValueType > & storm::pomdp::beliefs::Belief< ValueTypeArg >::operator= ( Belief< ValueTypeArg > && other)
delete

◆ operator=() [2/2]

template<typename ValueTypeArg>
Belief< ValueType > & storm::pomdp::beliefs::Belief< ValueTypeArg >::operator= ( Belief< ValueTypeArg > const & other)
delete

◆ operator==()

template<typename ValueType>
bool storm::pomdp::beliefs::Belief< ValueType >::operator== ( Belief< ValueTypeArg > const & other) const
Returns
true if this belief is equal to the other belief.

Definition at line 35 of file Belief.cpp.

◆ representativeState()

template<typename ValueType>
BeliefStateType storm::pomdp::beliefs::Belief< ValueType >::representativeState ( ) const
Returns
a representative state of this belief.
Precondition
the belief is valid, in particular not empty.

Definition at line 24 of file Belief.cpp.

◆ size()

template<typename ValueType>
std::size_t storm::pomdp::beliefs::Belief< ValueType >::size ( ) const
Returns
the number of states in the support of this belief.

Definition at line 19 of file Belief.cpp.

◆ toString()

template<typename ValueType>
std::string storm::pomdp::beliefs::Belief< ValueType >::toString ( bool convertToDouble = true,
bool fullPrecision = false ) const

A (human-readable) string representation of this belief.

Parameters
convertToDoubleif true, numbers are converted to double before printing. If this has ValueType=RationalNumber, the output as double is readable but potentially imprecise
fullPrecisionif true, numbers are printed with full precision

Definition at line 57 of file Belief.cpp.

◆ BeliefBuilder< Belief< ValueType > >

template<typename ValueTypeArg>
friend class BeliefBuilder< Belief< ValueType > >
friend

Definition at line 1 of file Belief.h.


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