Behavior, robustness and reward hacking
Analyze learned locomotion, joint use and sensitivity to pushes, observation noise and physical changes; investigate reward hacking and produce a reproducible report with curves, intervals and videos.
After this lesson you can
- Visualize joint trajectories and gait patterns of locomotion policies.
- Evaluate robustness to pushes, sensor noise and mass changes with degradation curves.
- Search for and document reward-hacking cases in standard and custom environments.
- Write a reproducible report with results, intervals and videos.
Before you start
- P09Sample efficiency comparisonDomain randomizationReward shaping design
- 30Corruption and natural-shift robustnessUncertainty evaluation under dataset shiftAI risk management frameworks
- 12Principal component analysist-distributed stochastic neighbor embeddingUMAP objective
- 31Repeatability, reproducibility, replicability and robustnessReproducibility checklistResults table design
Return does not show gait
Two policies can obtain the same return with very different movements. One may advance steadily; another may fall, exploit an unexpected posture, or produce large actions and compensate later. Before deciding which fulfills the intent, watch complete episodes and record joint positions, velocities, contacts and actions. Return is one reported variable, not a description of behavior.
Behavior analysis starts with a measurement contract: algorithm, environment version, checkpoint, normalization used by that policy, reset seed and evaluation mode. To compare gaits, align episodes by physical event, such as foot contact, as well as by time. An unaligned time average can erase opposite phases. PCA projections help explore patterns, but depend on scale and the distribution used to fit them; they do not by themselves prove stability or causality.
To analyze a gait cycle, record at least torso height, joint positions and velocities, actions and each foot’s contacts. Alternating contacts can indicate a periodic gait, while the same return can result from hopping or dragging. Contact requires a threshold and convention: treating a tiny force as contact can turn numerical oscillation into false events. Also show complete episodes; averaging a few selected cycles can conceal a subsequent fall.
A PCA projection is fitted on a set of states and then transforms others using the same mean, scale and components. Fitting a different PCA for each policy changes the position and orientation of the axes, so clouds in separate plots are not directly comparable. Normalizing each variable by its fitting-set standard deviation asks a different question from using original physical units: a large-scale joint no longer dominates for that reason alone, but a nearly constant noisy signal may be amplified. Publish the fitting data and retain the original series to interpret what the projection hides.
One recorded trajectory is not a representative sample by itself. Choose seeds and a criterion for examples in advance, such as the median episode and a lower-tail episode, and retain results for every episode. Selecting only an impressive recovery after watching the videos illustrates a mechanism; it does not estimate recovery probability. When an agent falls, align playback with the push and indicate what happened before and after; timing helps formulate a hypothesis, although a single trajectory does not prove causation.
Perturb one variable at a time
Robustness and reward hacking evaluation separates three interventions. An external force on the torso changes the dynamics; observation noise changes the policy input; changing torso mass and inertia changes a physical parameter. Keep the original reward in all three cases to compare returns, and also record falls, duration and movement signals. A force for supplies approximate impulse if constant; do not confuse newtons with newton-seconds.
A degradation curve needs a magnitude axis, multiple evaluation seeds and an unperturbed reference. Compare policies using the same held-out seeds, without choosing them after seeing results. If you have multiple training runs per algorithm, first summarize episodes per policy and then show variation between runs. Five episodes of one checkpoint are not five independent training runs. State the resampling unit and which source of uncertainty the interval excludes.
A perturbation can also come from another agent. Gleave and colleagues studied adversarial policies in zero-sum games between simulated robots: an opponent learns to produce observations that harm the victim through its own actions. This interactive attack is not equivalent to the independent random push in our sweep. A result against one perturbation family does not certify resistance to an adaptive adversary.
One way to retain this structure is to resample training seeds first and evaluation episodes within each seed. This hierarchical bootstrap reflects two sources of variation under the chosen sampling model. With only three training runs, even thousands of replicates create no extra information: the interval may be unstable and sensitive to one run. Show individual points alongside the band, and do not turn a small difference between means into a conclusive claim when the sample is small.
A shared seed helps pair initial conditions but does not guarantee identical physical sequences for two policies: a fall ends an episode early and actions change system evolution. For a paired comparison, calculate the difference between perturbed and nominal conditions for each seed of the same checkpoint, then summarize those differences. To measure uncertainty between training runs, you also need multiple training seeds and grouping that respects each policy’s episodes. A narrow band from many episodes of one policy does not measure training variation.
With one policy per algorithm, an episode bootstrap can summarize observed variation under those policies as long as seed pairs are retained when computing differences. It does not measure variation between training runs. If all thirty observed differences are exactly zero, every bootstrap replicate is also zero: the degenerate interval describes the resampled data, not proof that a real difference is impossible. For a fall proportion, show the count and a binomial interval such as Wilson, explaining that it depends on the sampling protocol.
Fix the direction of the difference before reading the plot. If you use perturbed return minus nominal return, a negative value indicates degradation in that pair; when comparing policies, specify which is subtracted from which. The mean of paired differences equals the difference of means when precisely the same pairs are used, but uncertainty can differ because pairing preserves the relationship between episodes with the same seed. If an episode is missing or a seed repeated, correct or declare the missing data instead of pairing rows by file position.
Push duration and application point are part of its definition. A constant force of 20 N for 0.1 s supplies approximately 2 N·s in the applied direction; the same force for 0.02 s supplies 0.4 N·s. If force is applied once per controller step, record the actual environment interval, which can include several internal integrator steps. A sideways and a forward push can have equal magnitude and different consequences. For an initial diagnosis vary one direction and magnitude, reserving combined perturbation distributions for a separate test.
Observation noise also needs units. A standard deviation of 0.1 applied indiscriminately to angles, velocities and normalized signals has a different physical interpretation for each component. State whether it is added before or after normalization, whether errors are independent at each step and whether all variables or just one sensor are contaminated. For mass, scaling the inertia tensor too is consistent with changing the density of a rigid body of fixed geometry; a localized load has a different distribution and needs a different model.
The denominator matters. If nominal return is positive, relative drop can be defined as . If is zero, the ratio is undefined; if negative, its interpretation is misleading. In those cases show absolute differences or a justified normalization. Fall rate complements return but does not alone establish that the gait meets every desired constraint.
When plotting a curve, retain individual returns as well as the mean. Two policies with the same mean can differ in the tail: one may almost always recover but suffer a few very severe falls. The fraction of episodes with a fall and a low return quantile make that difference visible, always with sample size. If an episode reaches the time limit without falling, mark it truncated; do not automatically convert it into a fall or physical terminal event.
Look for an exploitable reward
Reward hacking occurs when maximizing the specified signal does not match the intended behavior. A high return is not necessarily a hack: show a concrete trajectory, the calculation of its reward terms and a measure independent of the intention. A policy advancing with an unexpected locomotion mode may be acceptable if the task only requires displacement; it is undesirable if it also requires, for example, an orientation or contact limits omitted from the reward.
To investigate a suspected case, break down return by term and plot the signal alongside the state it should represent. If a bonus is paid each step, a policy may prolong the episode near the condition triggering it. If the goal is evaluated only at the end, a fast movement that ends early may appear worse than a long wait. Then compare an external metric such as final distance or binary success and rerun the episode with the same seed. This sequence separates a poorly designed function from a logging error or a mistaken interpretation of the video.
For the pushing environment, a controlled test compares a trajectory that holds the tip near the disk with one that moves the disk toward the goal. If a per-step proximity reward favors the former, document both returns, final distance and duration. This demonstrates the reward design tested; it does not imply that a trained policy discovered the behavior unless observed. The effects of misspecified objectives are discussed by Amodei and colleagues.
In our own run of the previous lesson’s MuJoCo prototype, we evaluated a deliberately flawed alternative reward: one point per step with the tip within 10 cm of the disk, plus ten on reaching the goal. The episode ends at the goal or after 100 steps. Two programmed controllers receive the same ten seeds: one waits and the other tries to push. Neither was trained with this alternative reward. For seed 0, waiting scored 100 without success, with final distance 0.152849 m; pushing scored 71 with success, with distance 0.029612 m. Success requires distance below 0.03 m. Waiting is favored because it collects proximity points for more steps, not because the disk reaches the goal better.
The arithmetic identifies the incentive. If the tip stays close for all 100 steps without finishing, return is 100. An episode reaching the goal after steps can receive at most under this reward: if it ends before step 90, even collecting proximity on every step scores less than waiting. This does not imply every successful trajectory scores less, since a later finish can accumulate more bonuses. In the recorded episode success arrived at step 61, and 61 proximity points plus ten for success totaled 71. Changing the horizon or bonus weight changes the comparison and must be part of the experiment.
import numpy as np
# Retornos medidos en MuJoCo para semillas 0 a 9, en el orden indicado.
esperar = np.array([100, 100, 100, 100, 100, 100, 100, 100, 100, 100])
empujar = np.array([71, 70, 68, 68, 73, 68, 69, 69, 90, 78])
print('semillas:', list(range(10)))
print('retorno esperar:', esperar.tolist(), 'éxitos: 0 de 10')
print('retorno empujar:', empujar.tolist(), 'éxitos: 10 de 10')
print('medianas:', np.median(esperar), np.median(empujar))These ten seeds were used to develop the programmed controller; they are not an independent performance estimate. The comparison establishes a counterexample to this particular reward, not that an RL policy learned to exploit it. Evaluating frozen policies on held-out conditions answers that other question.
To repeat the case, copy and execute in this same kernel the two cells that prepare Panda and define PandaPush in the previous lesson. The next cell records each step and recalculates the alternative reward without modifying the base environment reward. It is an explicit execution because it needs the local MuJoCo model and the previous definition.
if 'PandaPush' not in globals():
raise RuntimeError('Ejecuta en este kernel las celdas del entorno de la lección 7')
def reward_counterexample(strategy, seed):
env = PandaPush(horizon=100)
obs, _ = env.reset(seed=seed)
phase, total, trace = 0, 0., []
try:
for _ in range(100):
tip, puck, goal = obs[:2], obs[2:4], obs[4:6]
if strategy == 'esperar':
action = np.zeros(2)
else:
direction = (goal - puck) / (np.linalg.norm(goal - puck) + 1e-9)
behind = puck - .05 * direction
if phase == 0 and np.linalg.norm(tip - behind) < .012: phase = 1
target = behind if phase == 0 else puck + .06 * direction
action = np.clip((target - tip) * 4, -1, 1)
obs, _, done, truncated, info = env.step(action)
near = float(np.linalg.norm(obs[:2] - obs[2:4]) < .10)
reward_bad = near + 10 * float(done)
total += reward_bad
trace.append({'tip': obs[:2].tolist(), 'puck': obs[2:4].tolist(), 'goal': obs[4:6].tolist(),
'near': near, 'success': bool(done), 'reward_bad': reward_bad})
if done or truncated: break
return {'strategy': strategy, 'seed': seed, 'steps': len(trace), 'return_bad': total,
'success': bool(done), 'distance': float(info['distance']), 'trace': trace}
finally:
env.close()
examples = [reward_counterexample(strategy, seed) for seed in range(10) for strategy in ('esperar', 'empujar')]
for example in examples:
print({k: v for k, v in example.items() if k != 'trace'})npm run lab and open the connection link.After changing a reward to correct a failure, remeasure all metrics and test other conditions. Adding a penalty can reduce unwanted behavior while creating another, or make the task unsolvable for every policy. Also keep a reference outside the reward to detect that regression. Robustness to perturbations and reproducibility require saving configuration, seeds, code, weights and raw results alongside figures.
Lab: measurable perturbations
The final policies saved in lessons 5 and 6 use Hopper and HalfCheetah, not Walker2d. For the Walker2d viewer and comparison we do not assume a nonexistent checkpoint: new policies are trained with Stable-Baselines3 and identified as such. The following class applies torso force for one control step, Gaussian observation noise and mass and inertia scaling. It clears the force after every step, including on an exception. The three perturbations can be configured separately.
import gymnasium as gym
import mujoco
import numpy as np
from gymnasium.utils import RecordConstructorArgs
class Perturb(gym.Wrapper, RecordConstructorArgs):
def __init__(self, env, force=0., probability=.05, sensor_std=0., mass_scale=1.):
RecordConstructorArgs.__init__(self, force=force, probability=probability,
sensor_std=sensor_std, mass_scale=mass_scale)
gym.Wrapper.__init__(self, env)
if force < 0 or not 0 <= probability <= 1 or sensor_std < 0 or mass_scale <= 0:
raise ValueError('parámetros inválidos')
self.force, self.probability, self.sensor_std, self.mass_scale = force, probability, sensor_std, mass_scale
self.m, self.d = self.unwrapped.model, self.unwrapped.data
self.torso = mujoco.mj_name2id(self.m, mujoco.mjtObj.mjOBJ_BODY, 'torso')
if self.torso < 0: raise ValueError('sin torso')
self.mass0 = self.m.body_mass[self.torso].copy()
self.inertia0 = self.m.body_inertia[self.torso].copy()
def noisy(self, observation):
if self.sensor_std == 0: return observation
return (observation + self.np_random.normal(0, self.sensor_std, size=observation.shape)).astype(observation.dtype)
def reset(self, **kwargs):
self.m.body_mass[self.torso] = self.mass0 * self.mass_scale
self.m.body_inertia[self.torso] = self.inertia0 * self.mass_scale
mujoco.mj_setConst(self.m, self.d)
observation, info = self.env.reset(**kwargs)
return self.noisy(observation), info
def step(self, action):
force = 0.
if self.np_random.random() < self.probability:
force = self.force * self.np_random.choice((-1., 1.))
self.d.xfrc_applied[self.torso, 0] = force
try:
observation, reward, done, truncated, info = self.env.step(action)
finally:
self.d.xfrc_applied[self.torso, 0] = 0.
info['push_force'] = float(force)
return self.noisy(observation), reward, done, truncated, info
from gymnasium.utils.env_checker import check_env
probe = Perturb(gym.make('Walker2d-v5'), force=100., probability=.2, sensor_std=.01, mass_scale=1.2)
check_env(probe, skip_render_check=True)
obs, _ = probe.reset(seed=7)
forces = []
for _ in range(10):
obs, reward, done, truncated, info = probe.step(np.zeros(probe.action_space.shape))
forces.append(info['push_force'])
if done or truncated: break
assert probe.d.xfrc_applied[probe.torso, 0] == 0
print('fuerzas aplicadas:', forces, '| fuerza residual:', probe.d.xfrc_applied[probe.torso, 0])
probe.close()npm run lab and open the connection link.The push uses a horizontal force with random sign and probability 0.05 each step, not constant force throughout the episode. Friction stays fixed in this sweep to avoid mixing interventions. Noise is expressed in the observed components’ units; since their scales differ, interpret each value with that limitation. The same seed identifier fixes reset and perturbation sequence for a configuration, but different-length trajectories do not receive exactly the same subsequent events.
If exactly steps are observed and each step’s draw is independent, the number of pushes is binomial with parameters and . In 100 steps its expectation is five and the probability of at least one push is , approximately 99.4%. This does not mean every episode has five pushes or that an early-falling trajectory received the same events as a long one. When duration depends on falling, calculate the number actually applied per episode instead of substituting the distribution for a fixed horizon.
horizon, probability = 100, 0.05
print('empujes esperados:', horizon * probability)
print('probabilidad de al menos uno:', round(1 - (1 - probability)**horizon, 4))import hashlib, json, os
from pathlib import Path
import stable_baselines3 as sb3
RUNS = Path(os.environ.get('ATLAS_RUNS', 'atlas_runs')) / 'p09-l08'
def train_walker(algorithm, seed, steps=1_000_000):
folder = RUNS / f'{algorithm.lower()}-{seed}'
folder.mkdir(parents=True, exist_ok=True)
env = gym.make('Walker2d-v5')
try:
policy = getattr(sb3, algorithm)('MlpPolicy', env, seed=seed, device='cpu', verbose=0)
policy.learn(total_timesteps=steps, progress_bar=False)
policy.save(folder / 'model')
digest = hashlib.sha256((folder / 'model.zip').read_bytes()).hexdigest()
manifest = {'algorithm': algorithm, 'seed': seed, 'requested_steps': steps,
'actual_steps': policy.num_timesteps, 'checkpoint_sha256': digest,
'gymnasium': gym.__version__, 'mujoco': mujoco.__version__, 'sb3': sb3.__version__}
(folder / 'manifest.json').write_text(json.dumps(manifest, indent=2), encoding='utf-8')
return manifest
finally:
env.close()
def evaluate_walker(policy, parameters, seed, trace=False):
env = Perturb(gym.make('Walker2d-v5'), **parameters)
observation, _ = env.reset(seed=seed)
total, steps, frames, forces = 0., 0, [], []
try:
while True:
action, _ = policy.predict(observation, deterministic=True)
observation, reward, done, truncated, info = env.step(action)
total += float(reward); steps += 1
if trace:
frames.append(env.d.xpos[1:8][:, [0, 2]].copy().tolist())
forces.append(info['push_force'])
if done or truncated: break
return {'seed': seed, 'return': total, 'length': steps, 'fell': bool(done),
'positions': frames if trace else None, 'forces': forces if trace else None}
finally:
env.close()
print('versiones:', 'Gymnasium', gym.__version__, 'MuJoCo', mujoco.__version__, 'SB3', sb3.__version__)npm run lab and open the connection link.PPO may complete its last rollout and exceed the requested count, so the manifest saves requested and actual steps. The code uses SB3 defaults, not the checkpoints or all implementation details of the previous lessons. The following campaign is long: one policy per algorithm with training seed 0 and 30 episodes per sweep point. It runs explicitly, not when opening the page.
for algorithm in ('PPO', 'SAC'):
train_walker(algorithm, seed=0)
cases = [('force', x, {'force': x}) for x in (0., 50., 100., 200.)]
cases += [('noise', x, {'sensor_std': x}) for x in (.01, .05, .10)]
cases += [('mass', x, {'mass_scale': x}) for x in (.5, 1.5, 2.)]
for algorithm in ('PPO', 'SAC'):
folder = RUNS / f'{algorithm.lower()}-0'
manifest = json.loads((folder / 'manifest.json').read_text(encoding='utf-8'))
digest = hashlib.sha256((folder / 'model.zip').read_bytes()).hexdigest()
if digest != manifest['checkpoint_sha256']: raise ValueError('El checkpoint no coincide con el manifiesto')
policy = getattr(sb3, algorithm).load(folder / 'model.zip', device='cpu')
rows = []
for kind, magnitude, parameters in cases:
for j in range(30):
row = evaluate_walker(policy, parameters, 10000+j, trace=(j == 0 and kind == 'force'))
row.update(algorithm=algorithm, training_seed=0, kind=kind, magnitude=magnitude,
checkpoint_sha256=digest)
rows.append(row)
(folder / 'evaluation.json').write_text(json.dumps(rows, indent=2), encoding='utf-8')npm run lab and open the connection link.For each configuration retain all 30 rows per checkpoint, not just the mean. An interval resampling those episodes describes evaluation variation for one frozen policy; it does not measure variation across training runs. Pair the same reset seeds, report both rates, and avoid treating these two policies as a universal algorithm ranking. The trace=True episode saves seven body positions and forces to reconstruct motion; for additional human inspection record video with the local renderer and retain the seed and model version.
An initial PPO run on CPU requested one million steps and completed 1,001,472 because the final experience batch has fixed size. The campaign was saved in blocks and resumed once after the first, retaining model, optimizer and Python, NumPy and PyTorch generators but resetting the simulator episode; consequently continuous execution of the cell does not guarantee bit-for-bit reproduction of those weights. With 30 held-out seeds, mean return without pushes was 1698.7 with 19 falls; with maximum force 200 N it was 1199.8 with 25 falls. Doubling torso mass and inertia with other interventions disabled yielded mean return 518.9, and all 30 episodes ended in falls. These figures describe one checkpoint; they cannot rank PPO against SAC or identify which movement caused the return loss. Episodes and seeds are retained for paired analysis of the full sweep.
For those three counts, two-sided 95% Wilson intervals for fall proportion are approximately 45.5% to 78.1%, 66.4% to 92.7%, and 88.6% to 100%, respectively. Each summarizes episodes of the frozen policy under the stated condition; none includes uncertainty between training runs. Because seeds are paired, comparing overlap of individual intervals does not replace calculating paired differences.
The SAC actor trained with the same seed completed exactly 1,000,000 steps. Training resumed after 100,000 steps with the model, optimizers, buffer and Python, NumPy and PyTorch generators retained and the episode reset. For the two final checkpoints, the following table summarizes three conditions; every cell uses the same 30 evaluation seed identifiers and shows mean return and fall count.
| Condition | PPO: return, falls | SAC: return, falls |
|---|---|---|
| No perturbation | 1698.7, 19/30 | 4097.6, 0/30 |
| Maximum force 200 N | 1199.8, 25/30 | 3155.5, 14/30 |
| Torso mass and inertia ×2 | 518.9, 30/30 | 1744.2, 29/30 |
For these two policies, SAC retains higher mean return under the conditions in the table, although both show many falls with a torso twice as heavy. No universal algorithm ranking follows: there is only one training seed, small differences in actual steps and implementation decisions specific to each method. The bands below resample episodes, not training runs. The nominal point is shared with the noise and mass sweeps.
In both nominal trajectories shown, both policies reached the horizon and the torso advanced 10.63 m with PPO and 24.98 m with SAC from the first recorded frame. The lower plot tracks the height of both foot bodies during the episode. Their origin can lie below zero: it is the body position, not a measurement of foot penetration or contact. These examples help inspect movement patterns but cannot characterize the entire gait. Inspection of these standard trajectories and episodes under force found no verifiable case of reward exploitation; a fall or unexpected posture alone does not demonstrate reward hacking. The counterexample documented above belongs to the custom environment and specified alternative reward.
For seed 10000 and maximum force 200 N, the recorded PPO trajectory ended in a fall after 258 steps; SAC reached the 1000-step horizon. The videos below show the same measured positions as two-dimensional skeletons with the camera following the torso. They do not show exact geometry or contacts. One frame is retained every four 0.008 s control steps and played at 30 frames per second, approximately real time. The selection illustrates one pair, not the proportion of recoveries.
To audit the table and reconstruct the curves, download PPO and SAC episodes, the final PPO and SAC models, and their PPO and SAC manifests. Each episode identifies its checkpoint hash; manifests record versions, seed, requested budget and actual steps. Return intervals in the figure are percentiles of 2000 episode bootstrap replicates; falls use Wilson intervals. Neither measures variation between training runs.
The following function summarizes a group and calculates a paired difference against the reference. The percentile bootstrap is approximate; if all observations are identical, it can yield a zero-width interval. Seeds are the pairing keys, not each row’s file position.
import numpy as np
def report_group(rows, reference, seed=1608, replicas=2000):
by_seed = {row['seed']: row for row in rows}
base = {row['seed']: row for row in reference}
if not rows or len(by_seed) != len(rows) or len(base) != len(reference) or by_seed.keys() != base.keys():
raise ValueError('Se necesitan parejas únicas con las mismas semillas')
keys = sorted(by_seed)
returns = np.array([by_seed[k]['return'] for k in keys], dtype=float)
differences = returns - np.array([base[k]['return'] for k in keys], dtype=float)
rng = np.random.default_rng(seed)
draws = rng.integers(0, len(keys), size=(replicas, len(keys)))
return {'n': len(keys), 'mean': float(returns.mean()),
'mean_interval': np.quantile(returns[draws].mean(axis=1), [0.025, 0.975]).tolist(),
'paired_difference': float(differences.mean()),
'paired_interval': np.quantile(differences[draws].mean(axis=1), [0.025, 0.975]).tolist(),
'falls': sum(bool(by_seed[k]['fell']) for k in keys)}
reference = [{'seed': 1, 'return': 10., 'fell': False}, {'seed': 2, 'return': 20., 'fell': False}]
changed = [{'seed': 2, 'return': 18., 'fell': True}, {'seed': 1, 'return': 8., 'fell': False}]
assert report_group(changed, reference)['paired_difference'] == -2
print('diferencia media del ejemplo:', report_group(changed, reference)['paired_difference'])After running the long sweep, these lines produce a report for each condition without reselecting the checkpoint. Replicate count and generator seed are explicit; intervals can differ slightly from the figure if different generators are used.
for algorithm in ('PPO', 'SAC'):
folder = RUNS / f'{algorithm.lower()}-0'
rows = json.loads((folder / 'evaluation.json').read_text(encoding='utf-8'))
nominal = [row for row in rows if row['kind'] == 'force' and row['magnitude'] == 0]
report = []
for kind, magnitude, _ in cases:
group = [row for row in rows if row['kind'] == kind and row['magnitude'] == magnitude]
report.append({'kind': kind, 'magnitude': magnitude, **report_group(group, nominal)})
(folder / 'report.json').write_text(json.dumps(report, indent=2), encoding='utf-8')npm run lab and open the connection link.Exercises
import gymnasium as gym
class RandomPush(gym.Wrapper):
def __init__(self, env, body_id, magnitude):
super().__init__(env)
self.body_id, self.magnitude = body_id, magnitude
def step(self, action):
pass