MCPcopy Create free account
hub / github.com/LeCAR-Lab/model-based-diffusion / __init__

Method __init__

mbd/envs/cartpole.py:12–23  ·  view source on GitHub ↗
(self, backend="positional", **kwargs)

Source from the content-addressed store, hash-verified

10
11class 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."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected