From c8ed646a3837316ce28635d4be8869a38d9560dd Mon Sep 17 00:00:00 2001 From: william-xue <1596180987+william-xue@users.noreply.github.com> Date: Sun, 31 May 2026 10:42:14 +0800 Subject: [PATCH] docs: clarify reward kernel flags Signed-off-by: william-xue <1596180987+william-xue@users.noreply.github.com> --- docs/user/reward.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user/reward.rst b/docs/user/reward.rst index c439da55..1e617312 100644 --- a/docs/user/reward.rst +++ b/docs/user/reward.rst @@ -31,6 +31,13 @@ Customization of the reward In grid2op you can customize the reward function / reward kernel used by your agent. By default, when you create an environment a reward has been specified for you by the creator of the environment and you have nothing to do: +.. note:: + In the mathematical MDP notation, the reward kernel is often written as a function of the state, + the next state and the action. In grid2op's implementation, reward classes also receive contextual + flags such as `has_error`, `is_illegal` and `is_ambiguous`. These flags make it possible to distinguish + the original action submitted by the agent from the action effectively applied by the environment, for + example when an out-of-bounds redispatching action is replaced by a do-nothing action. + .. code-block:: python import grid2op