public class MCRandomStateGenerator extends java.lang.Object implements StateGenerator
MountainCar
states with the x-position between some specified range and the velocity between some specified range. By default, the ranges are the
full ranges supported by the domain, but they can be individually changed.Constructor and Description |
---|
MCRandomStateGenerator(double xmin,
double xmax,
double vmin,
double vmax)
Initializes for the given boundaries in which random states will be created
|
MCRandomStateGenerator(MountainCar.MCPhysicsParams params)
Initializes for the
MountainCar Domain object for which states will be generated. |
Modifier and Type | Method and Description |
---|---|
State |
generateState()
Returns a new state object.
|
java.util.Random |
getRandomObject()
Returns the random object used for generating states
|
double |
getVmax()
Returns the maximum velocity that a generated state can have.
|
double |
getVmin()
Returns the minimum velocity that a generated state can have.
|
double |
getXmax()
Returns the maximum x-value that a generated state can have.
|
double |
getXmin()
Returns the minimum x-value that a generated state can have.
|
void |
setRandomObject(java.util.Random rand)
Sets the random object used for generating states
|
void |
setVmax(double vmax)
Sets the maximum velocity that a generated state can have.
|
void |
setVmin(double vmin)
Sets the minimum velocity that a generated state can have.
|
void |
setVRange(double vmin,
double vmax)
Sets the random velocity range that a generated state can have.
|
void |
setXmax(double xmax)
Sets the maximum x-value that a generated state can have.
|
void |
setXmin(double xmin)
Sets the minimum x-value that a generated state can have.
|
void |
setXRange(double xmin,
double xmax)
Sets the random x-value range that a generated state can have.
|
public MCRandomStateGenerator(MountainCar.MCPhysicsParams params)
MountainCar
Domain
object for which states will be generated. By default, the random x and velocity ranges will be
the full range used by the domain.params
- the mountain car physics parameters specifying the boundariespublic MCRandomStateGenerator(double xmin, double xmax, double vmin, double vmax)
xmin
- the minimum x position valuexmax
- the maximum x position valuevmin
- the minimum velocity valuevmax
- the maximum velocity valuepublic double getXmin()
public void setXmin(double xmin)
xmin
- the minimum x-value that a generated state can have.public double getXmax()
public void setXmax(double xmax)
xmax
- the maximum x-value that a generated state can have.public double getVmin()
public void setVmin(double vmin)
vmin
- the minimum velocity that a generated state can have.public double getVmax()
public void setVmax(double vmax)
vmax
- the maximum velocity that a generated state can have.public void setXRange(double xmin, double xmax)
xmin
- the miniimum x-valuexmax
- the maximum x-valuepublic void setVRange(double vmin, double vmax)
vmin
- the minimum velocityvmax
- the maximum velocitypublic java.util.Random getRandomObject()
public void setRandomObject(java.util.Random rand)
rand
- the random object used for generating statespublic State generateState()
StateGenerator
generateState
in interface StateGenerator