Parameters

The challenge “learning to run a power network” offers different _parameters to be customized, or to learn an grid2op.BaseAgent that will perform better for example.

This class is an attempt to group them all inside one single structure.

For now, Parameters have default value, but the can be read back / from json. Other serialization method will come soon.

class grid2op.Parameters.Parameters(parameters_path=None)[source]

Main classes representing the _parameters of the game. The main paratemeters are describe bellow.

Note that changing the values of these _parameters might not be enough. If these _parameters are not used in the grid2op.RulesChecker, then modifying them will have no impact at all.

NO_OVERFLOW_DISCONNECTION

If set to True then the grid2op.Environment will not disconnect powerline above their thermal limit. Default is False

Type

bool

NB_TIMESTEP_POWERFLOW_ALLOWED

Number of timesteps for which a soft overflow is allowed, default 2. This means that a powerline will be disconnected (if NO_OVERFLOW_DISCONNECTION is set to False) after 2 time steps above its thermal limit. This is called a “soft overflow”.

Type

int

NB_TIMESTEP_RECONNECTION

Number of timesteps a powerline disconnected for security motives (for example due to NB_TIMESTEP_POWERFLOW_ALLOWED or HARD_OVERFLOW_THRESHOLD) will remain disconnected. It’s set to 10 timestep by default.

Type

int

NB_TIMESTEP_LINE_STATUS_REMODIF

When someone acts on a powerline by changing its status (connected / disconnected) this number indicates how many timesteps the grid2op.BaseAgent.BaseAgent has to wait before being able to modify this status again. For examle, if this is 1, this means that an BaseAgent can act on status of a powerline 1 out of 2 time step (1 time step it acts, another one it cools down, and the next one it can act again). Having it at 0 it equivalent to deactivate this feature (default).

Type

int

NB_TIMESTEP_TOPOLOGY_REMODIF

When someone changes the topology of a substations, this number indicates how many timesteps the grid2op.BaseAgent.BaseAgent has to wait before being able to modify the topology on this same substation. It has the same behaviour as Parameters.NB_TIMESTEP_LINE_STATUS_REMODIF. To deactivate this feature, put it at 0 (default).

Type

int

HARD_OVERFLOW_THRESHOLD

If a the powerflow on a line is above HARD_OVERFLOW_THRESHOLD * thermal limit (and NO_OVERFLOW_DISCONNECTION is set to False) then it is automatically disconnected, regardless of the number of timesteps it is on overflow). This is called a “hard overflow”

Type

float

ENV_DC

Whether or not making the simulations of the environment in the “direct current” approximation. This can be usefull for early training of agent, as this mode is much faster to compute than the corresponding “alternative current” powerflow. It is also less precise. The default is False

Type

bool

FORECAST_DC

Whether to use the direct current approximation in the grid2op.BaseObservation.forecasts() method. Default is False. This can speed up the computation.

Type

bool

MAX_SUB_CHANGED

Maximum number of substations that can be reconfigured between two consecutive timesteps by an grid2op.BaseAgent. Default value is 1.

Type

int

MAX_LINE_STATUS_CHANGED: int

Maximum number of powerlines statuses that can be changed between two consecutive timestetps by an grid2op.BaseAgent. Default value is 1.

init_from_dict(dict_)[source]

Initialize the object given a dictionary. All keys are optional. If a key is not present in the dictionnary, the default parameters is used.

Parameters

dict (dict) – The dictionary representing the parameters to load.

staticmethod init_from_json(json_path)[source]

Initializes the _parameters from a json path.

Parameters

json_path (str) – The complete (ie. path + filename) where the json file is located.

Returns

res – The _parameters initialized

Return type

Parameters

to_dict()[source]

Serialize all the _parameters as a dictionnary; Usefull to write it in json format.

Returns

res – A representation of these _parameters in the form of a dictionnary.

Return type

dict

If you still can’t find what you’re looking for, try in one of the following pages: