Skip to content

TargetGym

Reach a setpoint. Hold it forever. Against disturbances.
21 JAX environments for target MDPs, the control problems industry actually has.


One example task from each family, under PID control.

21 environments: 9 aircraft, 5 process control, 5 industrial / energy, 2 renewable energy. Every one of them is in the gallery, with its own page, clip and baseline numbers.


pip install target-gym

Or try it in the browser: Colab quickstart.

import jax
import numpy as np
from target_gym import Plane

env = Plane()
pid = env.make_pid()          # the shipped baseline, tuned
obs, state = env.reset(jax.random.PRNGKey(0))

for t in range(200):
    action = np.atleast_1d(pid(np.asarray(obs)))
    obs, state, reward, terminated, truncated, info = env.step(
        jax.random.PRNGKey(t), state, action
    )
    if terminated or truncated:
        break

Browse the twenty-one environments → Getting started →


Why these environments

Holding a setpoint forever breaks differently than reaching a goal once, and these are the failure modes that come with it:

Irrecoverable states A boiler drum that carries water into the turbine, a reactor past runaway, a kiln that has gone cold
Partial observability The furnace hides 6 of 9 states, the reactor 7 of 11, the kiln 64 behind 8 measurements
Non-minimum phase Drum level rises as mass leaves; the four-tank's obvious loop pairing is unstable
Transport delay Half the kiln's response to a fuel change takes a full 25-minute residence time
Multi-timescale Millisecond neutronics against hour-long xenon; sub-second flame gas against 30 h glass residence
Finite budgets A battery whose tracking now costs the ability to track later

Every environment ships a tuned PID, and nineteen of twenty-one also ship an MPC, so a learned policy has something real to beat. And where a baseline is weak, the docs say how weak.

Documentation