Learn R Programming

gym (version 0.1.0)

env_step: Step though an environment using an action.

Description

Step though an environment using an action.

Usage

env_step(x, instance_id, action, render = FALSE)

Arguments

x
An instance of class "GymClient"; this object has "remote_base" as an attribute.
instance_id
A short identifier (such as "3c657dbc") for the environment instance.
action
An action to take in the environment.
render
Whether to render the environment. Defaults to FALSE.

Value

A list consisting of the following: action; an action to take in the environment, observation; an agent's observation of the current environment, reward; the amount of reward returned after previous action, done; whether the episode has ended, and info; a list containing auxiliary diagnostic information.

Examples

Run this code
## Not run: 
# remote_base <- "http://127.0.0.1:5000"
# client <- create_GymClient(remote_base)
# env_id <- "CartPole-v0"
# instance_id <- env_create(client, env_id)
# action <- env_action_space_sample(client, instance_id)
# env_step(client, instance_id, action)
# ## End(Not run)

Run the code above in your browser using DataLab