Description Usage Arguments Details Value Methods (by generic) Examples
The function CartPole()
creates a CartPole object. The CartPole
class is inherited
from the Env
class.
1 2 3 4 5 6 7 8 9 10 11 |
internal_state |
vector of size 4, representing cart position, cart velocity, pole angle, and pole angular velocity |
rng_state |
the RNG state for non-deterministic evolution |
setting |
a list of constants that controls the setting of the CartPole object, see details. |
x |
an environment-like object |
action |
an action from agent |
The internal state of a CartPole object includes four elements (following OpenAI Gym convention):
Index | Observation |
1 | Cart Position |
2 | Cart Velocity |
3 | Pole Angle |
4 | Pole Angular Velocity |
Note that the θ (index 3 and 4) has the opposite sign to OpenAI Gym. In our definition, anti-clockwise is positive direction.
a CartPole object (class = c("CartPole", "Env")
)
Step
: evolve given left (-1) or right (+1) action
Reset
: reset by uniformly sample from U[-0.05, +0.05]
1 | cp <- CartPole()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.