Class sdm::TabularObservationDynamicsS

Class List > sdm > TabularObservationDynamicsS

Tabular representation for the observation dynamics p(o' | s'). More...

  • #include <tabular_observation_dynamics_S.hpp>

Inherits the following classes: sdm::TabularObservationDynamics

Public Functions

Type Name
TabularObservationDynamicsS ()
TabularObservationDynamicsS (const TabularObservationDynamicsS & copy)
virtual std::shared_ptr< Distribution< std::shared_ptr< Observation > > > getNextObservationDistribution (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t=0)
Get the distribution over next observations.
virtual const MappedVector< std::shared_ptr< Observation > > & getObservationProbabilities (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t=0) const
Get the observation vector for a given action and next state.
virtual double getObservationProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, number t=0) const
Get the observation probability.
virtual std::set< std::shared_ptr< Observation > > getReachableObservations (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t=0) const
Get reachable observations from a state, suppose a specific action was executed.
void setObservationModel (const MappedMatrix< std::shared_ptr< State >, std::shared_ptr< Observation >> & o_model)
virtual void setObservationProbabilities (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const MappedVector< std::shared_ptr< Observation >> & observation_probas)
Set the observation probability.
virtual void setObservationProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, double proba)
Set the observation probability.
virtual void setReachableObservations (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, number t=0)
Set _the the state / observation transition probability (i.e. p(s', o
virtual ~TabularObservationDynamicsS ()

Public Functions inherited from sdm::TabularObservationDynamics

See sdm::TabularObservationDynamics

Type Name
virtual std::shared_ptr< Distribution< std::shared_ptr< Observation > > > getNextObservationDistribution (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t=0) = 0
Get the distribution over next observations.
virtual const MappedVector< std::shared_ptr< Observation > > & getObservationProbabilities (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t=0) const = 0
Get the observation vector for a given action and next state.
virtual double getObservationProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, number t=0) const = 0
Get the observation probability.
virtual std::set< std::shared_ptr< Observation > > getReachableObservations (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t=0) const = 0
Get reachable observations from a state, suppose a specific action was executed.
virtual void setObservationProbabilities (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const MappedVector< std::shared_ptr< Observation >> & observation_probas) = 0
Set the observation probability.
virtual void setObservationProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, double proba) = 0
Set the observation probability.
virtual void setReachableObservations (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, number t=0) = 0
Set _the the state / observation transition probability (i.e. p(s', o

Public Functions inherited from sdm::ObservationDynamicsInterface

See sdm::ObservationDynamicsInterface

Type Name
virtual std::shared_ptr< Distribution< std::shared_ptr< Observation > > > getNextObservationDistribution (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t) = 0
Get the distribution over next observations.
virtual double getObservationProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, number t) const = 0
_Get the the state / observation transition probability (i.e. p(o
virtual std::set< std::shared_ptr< Observation > > getReachableObservations (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, number t) const = 0
Get reachable observations from a state, suppose a specific action was executed.

Protected Attributes

Type Name
std::unordered_map< std::shared_ptr< State >, std::shared_ptr< DiscreteDistribution< std::shared_ptr< Observation > > > > next_observations_distrib_
map from state, current action pairs to the distribution over next states
MappedMatrix< std::shared_ptr< State >, std::shared_ptr< Observation > > observation_model_
transition and observation matrices
std::unordered_map< std::shared_ptr< State >, std::set< std::shared_ptr< Observation > > > successor_observations_
map from next-state to set of next observations

Protected Functions

Type Name
void updateNextObsDistribution (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const std::shared_ptr< State > & next_state, const std::shared_ptr< Observation > & observation, double proba)

Detailed Description

The class is optimized to provide a constant time access to all transition probabilities and reachable observations. The representation used is an array containing probabilities p(o' | s').

Public Functions Documentation

function TabularObservationDynamicsS [1/2]

sdm::TabularObservationDynamicsS::TabularObservationDynamicsS () 

function TabularObservationDynamicsS [2/2]

sdm::TabularObservationDynamicsS::TabularObservationDynamicsS (
    const TabularObservationDynamicsS & copy
) 

function getNextObservationDistribution

virtual std::shared_ptr< Distribution < std::shared_ptr< Observation > > > sdm::TabularObservationDynamicsS::getNextObservationDistribution (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    number t=0
) 

Parameters:

  • state the state
  • action the action
  • next_state the next state
  • t the timestep

Returns:

the distribution over observations

Implements sdm::TabularObservationDynamics::getNextObservationDistribution

function getObservationProbabilities

virtual const MappedVector < std::shared_ptr< Observation > > & sdm::TabularObservationDynamicsS::getObservationProbabilities (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    number t=0
) const

Parameters:

  • action the action

Returns:

the observation matrix

Implements sdm::TabularObservationDynamics::getObservationProbabilities

function getObservationProbability

virtual double sdm::TabularObservationDynamicsS::getObservationProbability (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    const std::shared_ptr< Observation > & observation,
    number t=0
) const

Parameters:

  • state a specific state (timestep t)
  • action a specific action
  • obs a specific observation
  • next_state a specific state (timestep t+1)

Returns:

double a probability

Implements sdm::TabularObservationDynamics::getObservationProbability

function getReachableObservations

virtual std::set< std::shared_ptr< Observation > > sdm::TabularObservationDynamicsS::getReachableObservations (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    number t=0
) const

Parameters:

  • state the current state
  • action the current action
  • t the timestep

Returns:

the list of next reachable observations

Implements sdm::TabularObservationDynamics::getReachableObservations

function setObservationModel

void sdm::TabularObservationDynamicsS::setObservationModel (
    const MappedMatrix < std::shared_ptr< State >, std::shared_ptr< Observation >> & o_model
) 

function setObservationProbabilities

virtual void sdm::TabularObservationDynamicsS::setObservationProbabilities (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    const MappedVector < std::shared_ptr< Observation >> & observation_probas
) 

Parameters:

  • action
  • next_state
  • observation_probas

Implements sdm::TabularObservationDynamics::setObservationProbabilities

function setObservationProbability

virtual void sdm::TabularObservationDynamicsS::setObservationProbability (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    const std::shared_ptr< Observation > & observation,
    double proba
) 

Parameters:

  • action a specific action
  • observation a specific observation
  • next_state a specific state
  • proba a probability

Implements sdm::TabularObservationDynamics::setObservationProbability

function setReachableObservations

virtual void sdm::TabularObservationDynamicsS::setReachableObservations (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    const std::shared_ptr< Observation > & observation,
    number t=0
) 

Parameters:

  • state the state
  • action the action
  • next_state the next state
  • observation the observation
  • proba the probability
  • t the timestep

Returns:

double the probability

Implements sdm::TabularObservationDynamics::setReachableObservations

function ~TabularObservationDynamicsS

virtual sdm::TabularObservationDynamicsS::~TabularObservationDynamicsS () 

Protected Attributes Documentation

variable next_observations_distrib_

std::unordered_map<std::shared_ptr<State>, std::shared_ptr<DiscreteDistribution<std::shared_ptr<Observation> > > > sdm::TabularObservationDynamicsS::next_observations_distrib_;

variable observation_model_

MappedMatrix<std::shared_ptr<State>, std::shared_ptr<Observation> > sdm::TabularObservationDynamicsS::observation_model_;

variable successor_observations_

std::unordered_map<std::shared_ptr<State>, std::set<std::shared_ptr<Observation> > > sdm::TabularObservationDynamicsS::successor_observations_;

Protected Functions Documentation

function updateNextObsDistribution

void sdm::TabularObservationDynamicsS::updateNextObsDistribution (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const std::shared_ptr< State > & next_state,
    const std::shared_ptr< Observation > & observation,
    double proba
) 

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