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)
FullStateModel
Action
is applied in State
s. The returned
list only needs to include transitions that have non-zero probability of occurring.stateTransitions
in interface FullStateModel
s
- the source statea
- the action to be applied in the source stateStateTransitionProb
objects.public State sample(State s, Action a)
SampleStateModel
State
from a state transition function.sample
in interface SampleStateModel
s
- the source statea
- the action to be executed in the source stateState
protected 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)