sustaingym.envs.evcharging.discrete_action_wrapper#

Implements a wrapper supporting discrete actions in EVChargingEnv.

Module Contents#

Classes#

DiscreteActionWrapper

Discrete action wrapper.

class sustaingym.envs.evcharging.discrete_action_wrapper.DiscreteActionWrapper(env: sustaingym.envs.evcharging.env.EVChargingEnv)[source]#

Bases: gymnasium.ActionWrapper

Discrete action wrapper.

This wrapper maps discrete actions to normalized continuous actions on the EVChargingEnv. Using discrete actions guarantees that non-zero actions will not get zeroed out as in the continuous case (see EVChargingEnv._to_schedule()).

Parameters:

env (sustaingym.envs.evcharging.env.EVChargingEnv) – EV charging environment

action_space#

MultiDiscrete action space

action(act: numpy.ndarray) numpy.ndarray[source]#

Converts {0, 1, 2, 3, 4} to {0.0, 0.25, 0.5, 0.75, 1.0}.

Parameters:

act (numpy.ndarray) –

Return type:

numpy.ndarray