Class sdm::Belief

Class List > sdm > Belief

  • #include <belief_state.hpp>

Inherits the following classes: sdm::BeliefInterface, sdm::MappedVector

Inherited by the following classes: sdm::OccupancyState

Public Types inherited from sdm::MappedVector

See sdm::MappedVector

Type Name
typedef typename std::unordered_map< TIndex, T, Hash, KeyEqual >::const_iterator const_iterator
typedef typename std::unordered_map< TIndex, T, Hash, KeyEqual >::iterator iterator
typedef typename RecursiveMap< TIndex, T >::type type
typedef typename RecursiveMap< TIndex, T >::value_list_type value_list_type
typedef typename RecursiveMap< TIndex, T >::value_type value_type

Public Static Attributes

Type Name
double PRECISION

Public Static Attributes inherited from sdm::MappedVector

See sdm::MappedVector

Type Name
double PRECISION

Public Functions

Type Name
Belief ()
Belief (std::size_t)
Belief (const Belief &)
Belief (const MappedVector< std::shared_ptr< State >> &)
Belief (const std::vector< std::shared_ptr< State >> & list_states, const std::vector< double > & list_proba)
virtual void addProbability (const std::shared_ptr< State > & state, double proba)
virtual void finalize ()
virtual double getDefaultValue () const
virtual double getProbability (const std::shared_ptr< State > & state) const
virtual std::vector< std::shared_ptr< State > > getStates () const
virtual TypeState getTypeState () const
virtual std::shared_ptr< VectorInterface< std::shared_ptr< State >, double > > getVectorInferface ()
virtual size_t hash () const
Get the hash of the state. The hash is used in tabular value functions in order to compare efficiently two states. This function must be reimplemented in inherited classes.
virtual bool isStateExist (const std::shared_ptr< State > & state_tmp) const
virtual double norm_1 () const
virtual void normalizeBelief (double norm_1)
virtual double operator< (const std::shared_ptr< BeliefInterface > & other) const
double operator< (const Belief & other) const
bool operator== (const Belief &) const
virtual bool operator== (const std::shared_ptr< State > & other) const
Check equality between two states. This function must be implemented in inherited classes.
virtual bool operator== (const std::shared_ptr< BeliefInterface > & other) const
virtual double operator^ (const std::shared_ptr< BeliefInterface > & other) const
virtual std::shared_ptr< State > sampleState ()
void serialize (Archive & archive, const unsigned int)
virtual void setDefaultValue (double)
virtual void setProbability (const std::shared_ptr< State > & state, double proba)
virtual size_t size () const
virtual std::string str () const
Get a string describing the current item.
virtual ~Belief ()

Public Functions inherited from sdm::BeliefInterface

See sdm::BeliefInterface

Type Name
virtual void addProbability (const std::shared_ptr< State > &, double proba) = 0
virtual void finalize () = 0
virtual double getDefaultValue () const = 0
virtual double getProbability (const std::shared_ptr< State > & state) const = 0
virtual std::vector< std::shared_ptr< State > > getStates () const = 0
virtual TypeState getTypeState () const
virtual std::shared_ptr< VectorInterface< std::shared_ptr< State >, double > > getVectorInferface () = 0
virtual bool isStateExist (const std::shared_ptr< State > & state_tmp) const = 0
virtual double norm_1 () const = 0
virtual void normalizeBelief (double norm_1) = 0
virtual double operator< (const std::shared_ptr< BeliefInterface > & other) const = 0
virtual bool operator== (const std::shared_ptr< BeliefInterface > & other) const = 0
virtual double operator^ (const std::shared_ptr< BeliefInterface > & other) const = 0
virtual std::shared_ptr< State > sampleState () = 0
virtual void setDefaultValue (double) = 0
virtual void setProbability (const std::shared_ptr< State > & state, double proba) = 0
virtual size_t size () const = 0

Public Functions inherited from sdm::State

See sdm::State

Type Name
virtual TypeState getTypeState () const
virtual size_t hash () const
Get the hash of the state. The hash is used in tabular value functions in order to compare efficiently two states. This function must be reimplemented in inherited classes.
virtual bool operator== (const std::shared_ptr< State > & other) const
Check equality between two states. This function must be implemented in inherited classes.
virtual std::string str () const = 0
Get a string describing the current item.
virtual std::shared_ptr< BeliefInterface > toBelief ()
Cast the state into a belief.
virtual std::shared_ptr< HistoryInterface > toHistory ()
Cast the state into a history.
virtual std::shared_ptr< OccupancyStateInterface > toOccupancyState ()
Cast the state into an occupancy state.
virtual std::shared_ptr< BaseSerialInterface > toSerial ()
Cast the state into a serial interface.
virtual std::shared_ptr< SerialOccupancyInterface > toSerialOccupancyState ()
Cast the state into a serial occupancy state.
virtual ~State ()

Public Functions inherited from sdm::Observation

See sdm::Observation

Type Name
virtual std::string str () const = 0
Get a string describing the current item.
virtual ~Observation ()

Public Functions inherited from sdm::Item

See sdm::Item

Type Name
virtual std::shared_ptr< Item > getPointer ()
Get the shared_ptr on current (this) item.
virtual bool isBaseItem ()
virtual std::string str () const = 0
Get a string describing the current item.
std::shared_ptr< T > to ()
virtual std::shared_ptr< Action > toAction ()
Cast the item into a pointer on action.
virtual std::shared_ptr< Item > toItem ()
Cast the item into a pointer on item.
virtual std::shared_ptr< Observation > toObservation ()
Cast the item into a pointer on observation.
virtual std::shared_ptr< State > toState ()
Cast the item into a pointer on state.

Public Functions inherited from std::inheritable_enable_shared_from_this

See std::inheritable_enable_shared_from_this

Type Name
std::shared_ptr< Down > downcasted_shared_from_this ()
std::shared_ptr< T > shared_from_this ()

Public Functions inherited from std::MultipleInheritableEnableSharedFromThis

See std::MultipleInheritableEnableSharedFromThis

Type Name
virtual ~MultipleInheritableEnableSharedFromThis ()

Public Functions inherited from sdm::MappedVector

See sdm::MappedVector

Type Name
MappedVector ()
MappedVector (T default_value)
MappedVector (long size, T default_value)
MappedVector (const MappedVector &)
MappedVector (std::initializer_list< value_list_type >)
std::shared_ptr< TOutput > add (const std::shared_ptr< TOutput > & other, double coef_this=1., double coef_other=1.) const
virtual void addValueAt (const TIndex &, const T &)
virtual TIndex argmax ()
virtual TIndex argmin ()
virtual T at (const TIndex &) const
T dot (const MappedVector &) const
This method implements a non-commutative dot product : It is worth noticing that sometimes arg1.dot(arg2) != arg2.dot(arg1)
void finalize ()
T getDefault () const
virtual std::vector< TIndex > getIndexes () const
virtual T getValueAt (const TIndex &) const
bool isExist (const TIndex &) const
bool is_equal (const MappedVector & other, double precision) const
virtual T max ()
virtual T min ()
T norm_1 () const
T norm_2 () const
bool operator!= (const MappedVector &) const
T operator* (const MappedVector &) const
bool operator< (const MappedVector &) const
bool operator== (const MappedVector & other) const
T operator^ (const MappedVector &) const
This method implements a non-commutative dot product : It is worth noticing that sometimes arg1.dot(arg2) != arg2.dot(arg1)
void serialize (Archive & archive, const unsigned int)
void setDefault (double default_value)
virtual void setValueAt (const TIndex &, const T &)
void setupIndexes ()
virtual size_t size () const
virtual std::string str () const
virtual ~MappedVector ()

Public Functions inherited from sdm::VectorInterface

See sdm::VectorInterface

Type Name
virtual void addValueAt (const I & index, const T & value) = 0
virtual I argmax () = 0
virtual I argmin () = 0
virtual T at (const I & index) const = 0
virtual std::vector< I > getIndexes () const = 0
virtual T getValueAt (const I & index) const = 0
virtual T max () = 0
virtual T min () = 0
virtual void setValueAt (const I & index, const T & value) = 0
virtual size_t size () const = 0
virtual std::string str () const = 0

Public Static Functions

Type Name
std::shared_ptr< State > getState (const std::shared_ptr< State > &)

Public Static Functions inherited from sdm::MappedVector

See sdm::MappedVector

Type Name
void setPrecision (double)

Protected Attributes

Type Name
DiscreteDistribution< std::shared_ptr< State > > distribution_

Protected Attributes inherited from sdm::MappedVector

See sdm::MappedVector

Type Name
bool bmax = = false
bool bmin = = false
T default_value_ = = 0.0
std::pair< TIndex, T > pmax
std::pair< TIndex, T > pmin
long size_ = = -1
std::vector< TIndex > v_indexes = = {}

Protected Functions inherited from sdm::MappedVector

See sdm::MappedVector

Type Name
const std::pair< TIndex, T > & getMax ()
const std::pair< TIndex, T > & getMin ()

Public Static Attributes Documentation

variable PRECISION

double sdm::Belief::PRECISION;

Public Functions Documentation

function Belief [1/5]

sdm::Belief::Belief () 

function Belief [2/5]

sdm::Belief::Belief (
    std::size_t
) 

function Belief [3/5]

sdm::Belief::Belief (
    const Belief &
) 

function Belief [4/5]

sdm::Belief::Belief (
    const MappedVector < std::shared_ptr< State >> &
) 

function Belief [5/5]

sdm::Belief::Belief (
    const std::vector< std::shared_ptr< State >> & list_states,
    const std::vector< double > & list_proba
) 

function addProbability

virtual void sdm::Belief::addProbability (
    const std::shared_ptr< State > & state,
    double proba
) 

Implements sdm::BeliefInterface::addProbability

function finalize

virtual void sdm::Belief::finalize () 

Implements sdm::BeliefInterface::finalize

function getDefaultValue

virtual double sdm::Belief::getDefaultValue () const

Implements sdm::BeliefInterface::getDefaultValue

function getProbability

virtual double sdm::Belief::getProbability (
    const std::shared_ptr< State > & state
) const

Implements sdm::BeliefInterface::getProbability

function getStates

virtual std::vector< std::shared_ptr< State > > sdm::Belief::getStates () const

Implements sdm::BeliefInterface::getStates

function getTypeState

virtual TypeState sdm::Belief::getTypeState () const

Implements sdm::State::getTypeState

function getVectorInferface

virtual std::shared_ptr< VectorInterface < std::shared_ptr< State >, double > > sdm::Belief::getVectorInferface () 

Implements sdm::BeliefInterface::getVectorInferface

function hash

virtual size_t sdm::Belief::hash () const

Returns:

size_t the hash code

Implements sdm::State::hash

function isStateExist

virtual bool sdm::Belief::isStateExist (
    const std::shared_ptr< State > & state_tmp
) const

Implements sdm::BeliefInterface::isStateExist

function norm_1

virtual double sdm::Belief::norm_1 () const

Implements sdm::BeliefInterface::norm_1

function normalizeBelief

virtual void sdm::Belief::normalizeBelief (
    double norm_1
) 

Implements sdm::BeliefInterface::normalizeBelief

function operator<

virtual double sdm::Belief::operator< (
    const std::shared_ptr< BeliefInterface > & other
) const

Implements sdm::BeliefInterface::operator<

function operator<

double sdm::Belief::operator< (
    const Belief & other
) const

function operator==

bool sdm::Belief::operator== (
    const Belief &
) const

function operator==

virtual bool sdm::Belief::operator== (
    const std::shared_ptr< State > & other
) const

Parameters:

  • other the state to be compared to current state

Returns:

true if states are equal

Returns:

false if they are different

Implements sdm::State::operator==

function operator==

virtual bool sdm::Belief::operator== (
    const std::shared_ptr< BeliefInterface > & other
) const

Implements sdm::BeliefInterface::operator==

function operator^

virtual double sdm::Belief::operator^ (
    const std::shared_ptr< BeliefInterface > & other
) const

Implements sdm::BeliefInterface::operator^

function sampleState

virtual std::shared_ptr< State > sdm::Belief::sampleState () 

Implements sdm::BeliefInterface::sampleState

function serialize

template<class Archive class Archive>
inline void sdm::Belief::serialize (
    Archive & archive,
    const unsigned int
) 

function setDefaultValue

virtual void sdm::Belief::setDefaultValue (
    double
) 

Implements sdm::BeliefInterface::setDefaultValue

function setProbability

virtual void sdm::Belief::setProbability (
    const std::shared_ptr< State > & state,
    double proba
) 

Implements sdm::BeliefInterface::setProbability

function size

inline virtual size_t sdm::Belief::size () const

Implements sdm::BeliefInterface::size

function str

virtual std::string sdm::Belief::str () const

Returns:

std::string the description of the item

Implements sdm::State::str

function ~Belief

virtual sdm::Belief::~Belief () 

Public Static Functions Documentation

function getState

static std::shared_ptr< State > sdm::Belief::getState (
    const std::shared_ptr< State > &
) 

Protected Attributes Documentation

variable distribution_

DiscreteDistribution<std::shared_ptr<State> > sdm::Belief::distribution_;

Friends Documentation

friend operator<<

inline friend std::ostream & sdm::Belief::operator<< (
    std::ostream & os,
    const Belief & belief
) 

The documentation for this class was generated from the following file src/sdm/core/state/belief_state.hpp