Module Openai_gym.Gym_client
val env_create : string -> Gym_t.instance_id
env_create env_id
creates an instance of the specified environment (e.g.,"CartPole-v0"
). It returns the instance identifier.
val env_list_all : unit -> (Gym_t.instance_id * string) list
env_list_all ()
lists all the environments running on the server as a pair(instance_id, env_id)
(e.g.[("3c657dbc", "CartPole-v0")]
).
val env_reset : Gym_t.instance_id -> Gym_t.observation
env_reset instance_id
resets the state of the environment and return an initial observation.
val env_step : Gym_t.instance_id -> Gym_t.action -> bool -> Gym_t.step_response
env_step instance_id action render
steps though an environment using an action. Ifrender
is true, a graphical feedback if display by the server.
val env_action_space_info : Gym_t.instance_id -> Gym_t.action_space_info
env_action_space_info instance_id
gets information (name and dimensions/bounds) of the env's action_space.
val env_action_space_sample : Gym_t.instance_id -> Gym_t.action
env_action_space_sample instance_id
samples randomly from the env's action_space.
val env_action_space_contains : Gym_t.instance_id -> int -> bool
env_action_space_contains instance_id x
checks to see if the valuex
is valid in the env's action_space.
val env_observation_space_info : Gym_t.instance_id -> Gym_t.observation_space_info
env_observation_space_info instance_id
gets information (name and dimensions/bounds) of the env's observation_space.
val env_observation_space_contains : Gym_t.instance_id -> Json_t.json -> bool
env_observation_space_contains instance_id params
assesses that the parameters are members of the env's observation_space.
val env_monitor_start : Gym_t.instance_id -> string -> bool -> bool -> unit
env_monitor_start instance_id directory force resume
starts monitoring.force
clears out existing training data from this directory (by deleting every file prefixed withopenaigym.
).resume
retains the training data already in this directory, which will be merged with our new data.
val env_monitor_close : Gym_t.instance_id -> unit
env_monitor_close instance_id
flushes all monitor data to disk.
val env_close : Gym_t.instance_id -> unit
env_close instance_id
stops the environment.