public abstract class ObservationFunction
extends java.lang.Object
PODomain
).
Defining the observation function requires sub classing this class and implementing the methods
canEnumerateObservations()
, getAllPossibleObservations()
, getObservationProbability(burlap.oomdp.core.states.State, burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
,
getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
, and
sampleObservation(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
.
canEnumerateObservations()
indicates whether this object can enumerate all observations and therefore implements
the getAllPossibleObservations()
and getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
methods. If those methods cannot be implement because the observation space is infinite (or simply too large), then the method
should return false.
getAllPossibleObservations()
returns the list of possible POMDP observations. Each observation is represented using the
State
interface,
since observations may consist of multiple observations of distinct objects in the world; however, that the observation is represented
with a State
interface does not mean it should be confused with the MDP state. If the observations
cannot be enumerated, then it should throw an UnsupportedOperationException
.
should be thrown.
getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
specifies the
probability mass/density function for a given observation conditioned on the MDP state and previous action selected that led to the MDP state.
getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
generates a list of all possible
observations with nonzero probability and their associated probability mass, conditioned on the given true hidden state and previously selected
action that led to that state. If the observations cannot be enumerated then an UnsupportedOperationException
should be thrown instead.
sampleObservation(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
samples an observation
from the observation distribution conditioned on the given true hidden state and previously selected action that led to the
hidden state.
getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
and
sampleObservation(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
methods can be trivially
implemented by having them return the result of the super class methods
getObservationProbabilitiesByEnumeration(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
and sampleObservationByEnumeration(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
, respectively,
provided that the getAllPossibleObservations()
method is implemented. However, these methods may be computationally
inefficient because they require enumerating all observations as returned by the getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method. Therefore, if computational speed is a concern, it would be better to implement the abstract methods directly instead
of having them return the result of these helper methods.Modifier and Type  Class and Description 

class 
ObservationFunction.ObservationProbability
A class for associating a probability with an observation.

Modifier and Type  Field and Description 

protected PODomain 
domain
The POMDP domain with which this
ObservationFunction is associated. 
Constructor and Description 

ObservationFunction(PODomain domain)
Initializes and set the
PODomain object's ObservationFunction
to this object. 
Modifier and Type  Method and Description 

abstract boolean 
canEnumerateObservations()
Returns whether this object can enumerate observations and implements the
getAllPossibleObservations() and
getObservationProbability(burlap.oomdp.core.states.State, burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
methods. 
abstract java.util.List<State> 
getAllPossibleObservations()
Returns a
List containing all possible observations. 
abstract java.util.List<ObservationFunction.ObservationProbability> 
getObservationProbabilities(State state,
GroundedAction action)
Returns the observation probability mass/density function for all observations that have nonzero mass/density conditioned on the true MDP state and previous action taken that led to the state.

protected java.util.List<ObservationFunction.ObservationProbability> 
getObservationProbabilitiesByEnumeration(State state,
GroundedAction action)
A superclass method for easily implementing the
getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction) method
that computes observation probability distribution by enumerating all possible observations (as defined by the getAllPossibleObservations() method)
and assigning their probability according to the getObservationProbability(burlap.oomdp.core.states.State, burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method. 
abstract double 
getObservationProbability(State observation,
State state,
GroundedAction action)
Returns the probability that an observation will be observed conditioned on the MDP state and previous action taken that led to the state.

abstract State 
sampleObservation(State state,
GroundedAction action)
Samples an observation given the true MDP state and action taken in the previous step that led to the MDP state.

protected State 
sampleObservationByEnumeration(State state,
GroundedAction action)
A superclass method for easily implementing the
sampleObservation(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction) method that
samples an observation by first getting all nonzero probability observations, as returned by the getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method, and then sampling from the enumerated distribution. 
protected PODomain domain
ObservationFunction
is associated.public ObservationFunction(PODomain domain)
PODomain
object's ObservationFunction
to this object.domain
 the PODomain
with which this ObservationFunction
is associated.public abstract boolean canEnumerateObservations()
getAllPossibleObservations()
and
getObservationProbability(burlap.oomdp.core.states.State, burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
methods.public abstract java.util.List<State> getAllPossibleObservations()
List
containing all possible observations. Observations are represented with a class that implements the State
interface, since observations may consist of multiple observations of distinct objects in the world.List
of all possible observations.public abstract double getObservationProbability(State observation, State state, GroundedAction action)
observation
 the observation, represented by a State
state
 The true MDP state that generated the observation.action
 the action that led to the MDP state and which generated the observationpublic abstract java.util.List<ObservationFunction.ObservationProbability> getObservationProbabilities(State state, GroundedAction action)
List
of ObservationFunction.ObservationProbability
objects,
which is a pair of an observation (represented by a State
and double specifying its mass/density.state
 the true MDP state that generated the observationsaction
 the action that led to the MDP state and which generated the observations.List
of ObservationFunction.ObservationProbability
objects.public abstract State sampleObservation(State state, GroundedAction action)
state
 the true MDP stateaction
 the action that led to the MDP stateState
.protected final java.util.List<ObservationFunction.ObservationProbability> getObservationProbabilitiesByEnumeration(State state, GroundedAction action)
getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method
that computes observation probability distribution by enumerating all possible observations (as defined by the getAllPossibleObservations()
method)
and assigning their probability according to the getObservationProbability(burlap.oomdp.core.states.State, burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method. Note that because this method requires enumerating all observations, it may be more computationally efficient to instead directly implement domain specific code
for the getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method.state
 the true MDP state that generated the observationsaction
 the action that led to the MDP state and which generated the observations.List
of ObservationFunction.ObservationProbability
objects.protected final State sampleObservationByEnumeration(State state, GroundedAction action)
sampleObservation(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method that
samples an observation by first getting all nonzero probability observations, as returned by the getObservationProbabilities(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method, and then sampling from the enumerated distribution. Note that enumerating all observation probabilities may be computationally
inefficient; therefore, it may be better to directly implement the sampleObservation(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method with efficient domain specific code.state
 the true MDP stateaction
 the action that led to the MDP stateState
.