Module Fehu_envs.Mountain_car

Mountain car with sparse reward (MountainCar-v0).

A car sits in a valley between two hills. The engine is too weak to climb the right hill directly; the agent must build momentum by rocking back and forth. Reward is -1.0 per step. The episode terminates when the car reaches position >= 0.5 with non-negative velocity, and truncates at 200 steps.

Observation: Fehu.Space.spec.Box of shape [2] -- position, velocity.

Actions: Fehu.Space.spec.Discrete 3 -- 0 = push left, 1 = coast, 2 = push 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 mountain car environment.