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

Constructs a belief. More...

#include <BeliefBuilder.h>

Public Types

using ValueType = typename BeliefType::ValueType

Public Member Functions

void reserve (uint64_t size)
 Reserves space to build the belief more efficiently.
void addValue (BeliefStateType const &state, ValueType const &value)
 Adds a probability value to the given state.
void setObservation (BeliefObservationType const &observation)
 Sets the observation of the belief.
ValueType normalize ()
 Normalizes the belief, i.e., if the sum of the values is not 1, it divides all values by the sum.
BeliefType build ()
 Builds the belief and returns it.
void reset ()
 Resets the builder to its initial state.

Detailed Description

template<typename BeliefType>
class storm::pomdp::beliefs::BeliefBuilder< BeliefType >

Constructs a belief.

Template Parameters
BeliefTypethe type of belief to construct

Definition at line 13 of file BeliefBuilder.h.

Member Typedef Documentation

◆ ValueType

template<typename BeliefType>
using storm::pomdp::beliefs::BeliefBuilder< BeliefType >::ValueType = typename BeliefType::ValueType

Definition at line 15 of file BeliefBuilder.h.

Member Function Documentation

◆ addValue()

template<typename BeliefType>
void storm::pomdp::beliefs::BeliefBuilder< BeliefType >::addValue ( BeliefStateType const & state,
ValueType const & value )

Adds a probability value to the given state.

If a value for the state already exists, its new value is the sum of the existing one and the given value.

Definition at line 18 of file BeliefBuilder.cpp.

◆ build()

template<typename BeliefType>
BeliefType storm::pomdp::beliefs::BeliefBuilder< BeliefType >::build ( )

Builds the belief and returns it.

Precondition
the belief must be a valid probability distribution, i.e., all values are in [0,1] and sum up to 1. Furthermore, an observation must have been set before calling this.
Note
After calling this, the builder is in an invalid state. Before building another belief with this builder, the reset() method must be called.

Definition at line 47 of file BeliefBuilder.cpp.

◆ normalize()

template<typename BeliefType>
BeliefBuilder< BeliefType >::ValueType storm::pomdp::beliefs::BeliefBuilder< BeliefType >::normalize ( )

Normalizes the belief, i.e., if the sum of the values is not 1, it divides all values by the sum.

Hence, after calling this, the sum of the values is 1.

Precondition
the sum is must be strictly greater than 0.
Returns
the sum of the values (before normalization)

Definition at line 31 of file BeliefBuilder.cpp.

◆ reserve()

template<typename BeliefType>
void storm::pomdp::beliefs::BeliefBuilder< BeliefType >::reserve ( uint64_t size)

Reserves space to build the belief more efficiently.

Parameters
sizethe number of states in the support of the belief
Note
providing this is optional, but can improve performance

Definition at line 13 of file BeliefBuilder.cpp.

◆ reset()

template<typename BeliefType>
void storm::pomdp::beliefs::BeliefBuilder< BeliefType >::reset ( )

Resets the builder to its initial state.

After build() has been called, this method must be called before building another belief with this builder.

Definition at line 60 of file BeliefBuilder.cpp.

◆ setObservation()

template<typename BeliefType>
void storm::pomdp::beliefs::BeliefBuilder< BeliefType >::setObservation ( BeliefObservationType const & observation)

Sets the observation of the belief.

Parameters
observationthe observation to set

Definition at line 26 of file BeliefBuilder.cpp.


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