Module Fehu_envs.Random_walk

One-dimensional random walk.

The agent moves left or right on a line bounded by [-10; 10]. Reward is - |position|. Episodes terminate when the agent reaches a boundary or after 200 steps.

Observation: Fehu.Space.spec.Box of shape [1] in [-10.0; 10.0].

Actions: Fehu.Space.spec.Discrete 2 -- 0 = left, 1 = right.

Render modes: ansi.

type obs = (float, Nx.float32_elt) Nx.t
type act = (int32, Nx.int32_elt) Nx.t
type render = string
val make : ?render_mode:Fehu.Env.render_mode -> unit -> (obs, act, render) Fehu.Env.t

make () is a random walk environment.