(self, backend="positional", **kwargs)
| 10 | |
| 11 | class Cartpole(PipelineEnv): |
| 12 | def __init__(self, backend="positional", **kwargs): |
| 13 | sys = mjcf.load(f"{mbd.__path__[0]}/assets/cartpole.xml") |
| 14 | |
| 15 | n_frames = 2 |
| 16 | |
| 17 | if backend in ["spring", "positional"]: |
| 18 | sys = sys.replace(dt=0.005) |
| 19 | n_frames = 4 |
| 20 | |
| 21 | kwargs["n_frames"] = kwargs.get("n_frames", n_frames) |
| 22 | |
| 23 | super().__init__(sys=sys, backend=backend, **kwargs) |
| 24 | |
| 25 | def reset(self, rng: jax.Array) -> State: |
| 26 | """Resets the environment to an initial state.""" |
nothing calls this directly
no outgoing calls
no test coverage detected