Class sdm::TabularObservationDynamicsAS

Class List > sdm > TabularObservationDynamicsAS

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

  • #include <tabular_observation_dynamics_AS.hpp>

Inherits the following classes: sdm::TabularObservationDynamics

Public Functions

Type Name
TabularObservationDynamicsAS ()
TabularObservationDynamicsAS (const TabularObservationDynamicsAS & 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 std::unordered_map< std::shared_ptr< Action >, 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 ~TabularObservationDynamicsAS ()

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< Action >, 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
std::unordered_map< std::shared_ptr< Action >, MappedMatrix< std::shared_ptr< State >, std::shared_ptr< Observation > > > observation_model_
transition and observation matrices
std::unordered_map< std::shared_ptr< Action >, std::unordered_map< std::shared_ptr< State >, std::set< std::shared_ptr< Observation > > > > successor_observations_
map from next-state, current action pairs 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' | a, s').

Public Functions Documentation

function TabularObservationDynamicsAS [1/2]

sdm::TabularObservationDynamicsAS::TabularObservationDynamicsAS () 

function TabularObservationDynamicsAS [2/2]

sdm::TabularObservationDynamicsAS::TabularObservationDynamicsAS (
    const TabularObservationDynamicsAS & copy
) 

function getNextObservationDistribution

virtual std::shared_ptr< Distribution < std::shared_ptr< Observation > > > sdm::TabularObservationDynamicsAS::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::TabularObservationDynamicsAS::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::TabularObservationDynamicsAS::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::TabularObservationDynamicsAS::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::TabularObservationDynamicsAS::setObservationModel (
    const std::unordered_map< std::shared_ptr< Action >, MappedMatrix < std::shared_ptr< State >, std::shared_ptr< Observation >>> & o_model
) 

function setObservationProbabilities

virtual void sdm::TabularObservationDynamicsAS::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::TabularObservationDynamicsAS::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::TabularObservationDynamicsAS::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 ~TabularObservationDynamicsAS

virtual sdm::TabularObservationDynamicsAS::~TabularObservationDynamicsAS () 

Protected Attributes Documentation

variable next_observations_distrib_

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

variable observation_model_

std::unordered_map<std::shared_ptr<Action>, MappedMatrix<std::shared_ptr<State>, std::shared_ptr<Observation> > > sdm::TabularObservationDynamicsAS::observation_model_;

variable successor_observations_

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

Protected Functions Documentation

function updateNextObsDistribution

void sdm::TabularObservationDynamicsAS::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_AS.hpp