public class MountainCar extends java.lang.Object implements DomainGenerator
Domain
, changing the physics parameters of this DomainGenerator
will
not affect how the previously generated domain behaves, only future generated ones.
1. Singh, Satinder P., and Richard S. Sutton. "Reinforcement learning with replacing eligibility traces." Machine learning 22.1-3 (1996): 123-158.Modifier and Type | Class and Description |
---|---|
static class |
MountainCar.ClassicMCTF
A Terminal Function for the Mountain Car domain that terminates when the agent's position is >= the max position in the world.
|
static class |
MountainCar.MCPhysicsParams |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTIONBACKWARDS
A constant for the name of the backwards action
|
static java.lang.String |
ACTIONCOAST
A constant for the name of the coast action
|
static java.lang.String |
ACTIONFORWARD
A constant for the name of the forward action
|
static java.lang.String |
ATTV
A constant for the name of the velocity attribute
|
static java.lang.String |
ATTX
A constant for the name of the x attribute
|
static java.lang.String |
CLASSAGENT
A constant for the name of the agent class
|
MountainCar.MCPhysicsParams |
physParams
The physics parameters for mountain car.
|
Constructor and Description |
---|
MountainCar() |
Modifier and Type | Method and Description |
---|---|
Domain |
generateDomain()
Returns a newly instanced Domain object
|
State |
getCleanState(Domain domain)
Returns a new state with the agent in the bottom of the hill valley not moving.
|
static State |
getCleanState(Domain domain,
MountainCar.MCPhysicsParams physParms)
Returns a new state with the agent in the bottom of the hill valley not moving according to the hill design
specified in the provided
MountainCar.MCPhysicsParams |
State |
getState(Domain domain,
double x,
double v)
Returns a state with the agent in the specified position at the specified velocity.
|
static void |
main(java.lang.String[] args)
Will launch a visual explorer for the mountain car domain that is controlled with the a-s-d keys.
|
static State |
move(State s,
int dir,
MountainCar.MCPhysicsParams physParms)
Changes the agents position in the provided state using car engine acceleration in the specified direction.
|
static void |
setAgent(State s,
double x,
double v)
Sets the agent position in the provided state to the given position and with the given velocity.
|
public static final java.lang.String ATTX
public static final java.lang.String ATTV
public static final java.lang.String CLASSAGENT
public static final java.lang.String ACTIONFORWARD
public static final java.lang.String ACTIONBACKWARDS
public static final java.lang.String ACTIONCOAST
public MountainCar.MCPhysicsParams physParams
public Domain generateDomain()
DomainGenerator
generateDomain
in interface DomainGenerator
public static State move(State s, int dir, MountainCar.MCPhysicsParams physParms)
s
- the state in which the agents position should be modifieddir
- the direction of accelerationpublic State getCleanState(Domain domain)
domain
- the domain object in which the state is associatedpublic static State getCleanState(Domain domain, MountainCar.MCPhysicsParams physParms)
MountainCar.MCPhysicsParams
domain
- the domain object in which the state is associatedphysParms
- object specifying the physics and hill design, which indicates where the valley is.public State getState(Domain domain, double x, double v)
domain
- the domain object in which the state is associatedx
- the position of the agentv
- the velocity of the agentpublic static void setAgent(State s, double x, double v)
s
- the state in which the agent should be set.x
- the position of the agent.v
- the velocity of the agent.public static void main(java.lang.String[] args)
args
- empty arguments.