public static class GridWorldDomain.GridWorldModel extends java.lang.Object implements FullStateModel
FullStateModel.Helper| Modifier and Type | Field and Description |
|---|---|
protected java.util.Random |
rand |
protected double[][] |
transitionDynamics
Matrix specifying the transition dynamics in terms of movement directions.
|
| Constructor and Description |
|---|
GridWorldModel(int[][] map,
double[][] transitionDynamics) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
actionInd(java.lang.String name) |
protected State |
move(State s,
int xd,
int yd)
Attempts to move the agent into the given position, taking into account walls and blocks
|
State |
sample(State s,
Action a)
Samples and returns a
State from a state transition function. |
java.util.List<StateTransitionProb> |
stateTransitions(State s,
Action a)
|
protected double[][] transitionDynamics
protected java.util.Random rand
public java.util.List<StateTransitionProb> stateTransitions(State s, Action a)
FullStateModelAction is applied in State s. The returned
list only needs to include transitions that have non-zero probability of occurring.stateTransitions in interface FullStateModels - the source statea - the action to be applied in the source stateStateTransitionProb objects.public State sample(State s, Action a)
SampleStateModelState from a state transition function.sample in interface SampleStateModels - the source statea - the action to be executed in the source stateStateprotected State move(State s, int xd, int yd)
s - the current statexd - the attempted new X position of the agentyd - the attempted new Y position of the agentprotected int actionInd(java.lang.String name)