smartgrid.scenarii

A few pre-defined scenarii to quickly launch simulations without coding anything.

These scenarii are, contrary to the rest of the code, not meant to be easily extensible or flexible, just to provide a few pre-defined environment setups that can be leveraged in a single import, rather than having to define them “by hand”. In this sense, they are by no means exhaustive.

They offer the additional advantage of serving as examples for writing your own custom setups: please feel free to read their source code and copy-paste at will!

It currently contains the following scenarii:

(The “small + annual” is already handled in the “basic” (default) environment, see make_basic_smartgrid().)

To use one of these scenarii, simply instantiate a new environment by invoking one of the functions, and use this environment through the classic interaction loop. For example:

from smartgrid.scenarii import medium_annual_scenario
env = medium_annual_scenario(max_step=10)

done = False
obs = env.reset()
while not done:
    actions = [
        agent.profile.action_space.sample()
        for agent in env.unwrapped.agents
    ]
    obs, rewards, terminated, truncated, _ = env.step(actions)
    done = all(terminated) or all(truncated)
members:

Functions

medium_annual_scenario([max_step])

A scenario with a medium neighborhood and annual profiles of consumption.

medium_daily_scenario([max_step])

A scenario with a medium neighborhood and daily profiles of consumption.

small_daily_scenario([max_step])

A scenario with a small neighborhood and daily profiles of consumption.