public class ObservationUtilities
extends java.lang.Object
ObservationFunction
and DiscreteObservationFunction
objects.Constructor and Description |
---|
ObservationUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<ObservationProbability> |
probabilitiesByEnumeration(DiscreteObservationFunction of,
State state,
Action action)
A helper method for easily implementing the
DiscreteObservationFunction.probabilities(State, Action) method
that computes observation probability distribution by enumerating all possible observations (as defined by the DiscreteObservationFunction.allObservations() method)
and assigning their probability according to the ObservationFunction.probability(State, State, Action)
method. |
static State |
sampleByEnumeration(DiscreteObservationFunction of,
State state,
Action action)
A helper method for easily implementing the
ObservationFunction.sample(State, Action) method that
samples an observation by first getting all non-zero probability observations, as returned by the DiscreteObservationFunction.probabilities(State, Action)
method, and then sampling from the enumerated distribution. |
public static java.util.List<ObservationProbability> probabilitiesByEnumeration(DiscreteObservationFunction of, State state, Action action)
DiscreteObservationFunction.probabilities(State, Action)
method
that computes observation probability distribution by enumerating all possible observations (as defined by the DiscreteObservationFunction.allObservations()
method)
and assigning their probability according to the ObservationFunction.probability(State, State, Action)
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 DiscreteObservationFunction.probabilities(State, Action)
method.of
- the ObservationFunction
to use.state
- the true MDP state that generated the observationsaction
- the action that led to the MDP state and which generated the observations.List
of ObservationProbability
objects.public static State sampleByEnumeration(DiscreteObservationFunction of, State state, Action action)
ObservationFunction.sample(State, Action)
method that
samples an observation by first getting all non-zero probability observations, as returned by the DiscreteObservationFunction.probabilities(State, Action)
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 ObservationFunction.sample(State, Action)
method with efficient domain specific code.of
- the ObservationFunction
to use.state
- the true MDP stateaction
- the action that led to the MDP stateState
.