gym_power_res.envs

Submodules

Package Contents

Classes

OutageManage

Distribution system restoration class

RestorationDisEnv

Restoration env for imitation learning

RestorationDisEnvRL

Restoration env for StableBaseline3 (reinforcement learning algorithm collections)

RestorationDisEnv119

Restoration env for imitation learning

RestorationDisVarConEnv

Restoration env with tieline and reactive power dispatch control

class gym_power_res.envs.OutageManage

Distribution system restoration class

BigM = 100
FicFlowBigM = 100
epsilon = 0.1
BasePower = 1000
data_preparation(self, ppc, line_damaged, VS=1.05, dV=0.05)

read data of distribution network and vehicle routing problem Data is in the format of dictionary

solve_network_restoration_varcon(self, Total_Step, Line_Initial, VarCon_Initial, Load_Initial)

solve a full-step restoration problem with reactive power dispatch :param Total_Step: total step of the problem :param Line_Initial: initial line status :return: restoration plan

solve_network_restoration(self, Total_Step, Line_Initial, Load_Initial)

solve a full-step restoration problem :param Total_Step: total step of the problem :param Line_Initial: initial line status :return: restoration plan

solve_load_pickup(self, line_status, load_status=None)

Given fixed line status, obtain optimal load status – line status should be a dict with “key” as line name and “int or array” describing status over time interval

solve_load_pickup_varcon(self, line_status, varcon, load_status=None)

Given fixed line status and reactive power dispatch, obtain optimal load status – line status should be a dict with “key” as line name and “int or array” describing status over time interval

get_solution_2d(self, VariableName, NameKey, ListIndex, SolDict=None)

get solution and store into a one name key structured dictionary :param VariableName: variable name in string format :param NameKey: desired key set in list or range format that you would like to retrieve :param ListIndex: desired index range in list format that you would like to retrieve :param SolDict: dictionary object with plot methods :return: SolDict

class gym_power_res.envs.RestorationDisEnv(max_disturbance, min_disturbance)

Bases: gym.Env

Restoration env for imitation learning

metadata
seed(self, seed=None)
reset(self, disturbance=None)

Here we should setup the episode control for the total time horizon, which will be independent of individual segment simulation

step(self, action)

Apply the given actions to the environment for one step

dict2list(self, dict)

convert an order dict to a list

render(self, mode='human')
close(self)
class gym_power_res.envs.RestorationDisEnvRL(max_disturbance, min_disturbance)

Bases: gym.Env

Restoration env for StableBaseline3 (reinforcement learning algorithm collections)

metadata
seed(self, seed=None)
reset(self, disturbance=None)

Here we should setup the episode control for the total time horizon, which will be independent of individual segment simulation

step(self, action)

Apply the given actions to the environment for one step

dict2list(self, dict)

convert an order dict to a list

render(self, mode='human')
close(self)
class gym_power_res.envs.RestorationDisEnv119(max_disturbance, min_disturbance)

Bases: gym.Env

Restoration env for imitation learning

metadata
seed(self, seed=None)
reset(self, disturbance=None)

Here we should setup the episode control for the total time horizon, which will be independent of individual segment simulation

step(self, action)

Apply the given actions to the environment for one step

dict2list(self, dict)

convert an order dict to a list

render(self, mode='human')
close(self)
class gym_power_res.envs.RestorationDisVarConEnv(max_disturbance, min_disturbance)

Bases: gym.Env

Restoration env with tieline and reactive power dispatch control

metadata
seed(self, seed=None)
reset(self, disturbance=None)

Here we should setup the episode control for the total time horizon, which will be independent of individual segment simulation

step(self, action, logger=None)

Apply the given actions to the environment for one step Action here is a dictionary with “tieline” and “varcon”

view_grid(self)
render(self, mode='human')
close(self)