1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use StepResult;
/// The core environment interface.
///
/// This trait defines the minimal contract for reinforcement learning
/// environments. It has **no supertraits** — concrete types derive
/// `Clone`, `Debug`, `Serialize`, etc. as needed.
///
/// # Gymnasium compliance
///
/// Maps to Python Gymnasium's `gymnasium.Env` with Rust-idiomatic signatures:
///
/// | Gymnasium | gymnasia |
/// |-----------|----------|
/// | `step(action) → (obs, reward, term, trunc, info)` | `step(action) → StepResult<Obs>` |
/// | `reset(seed, options) → (obs, info)` | `reset(seed, options) → Obs` |
/// | `close()` | `close()` |
/// | `action_space` | `action_space()` |
/// | `observation_space` | `observation_space()` |
///
/// **Info** is intentionally absent from `StepResult`. Wrappers that track
/// metadata (e.g. episode statistics) expose it via typed methods on the
/// wrapper itself — see the `wrappers` module.