Skip to content

Commit

Permalink
fix the error on capture demand
Browse files Browse the repository at this point in the history
  • Loading branch information
hsvgbkhgbv committed Jan 21, 2022
1 parent eb257c9 commit 81aa2a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions environments/var_voltage_control/voltage_control_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def get_obs(self):
if not( zone in obs_zone_dict.keys() ):
if "demand" in self.state_space:
copy_zone_buses = copy.deepcopy(zone_buses)
copy_zone_buses.loc[sgen_bus]["p_mw"] -= pv
copy_zone_buses.loc[sgen_bus]["q_mvar"] -= q
copy_zone_buses.loc[sgen_bus]["p_mw"] += pv
copy_zone_buses.loc[sgen_bus]["q_mvar"] += q
obs += list(copy_zone_buses.loc[:, "p_mw"].to_numpy(copy=True))
obs += list(copy_zone_buses.loc[:, "q_mvar"].to_numpy(copy=True))
if "pv" in self.state_space:
Expand Down Expand Up @@ -273,8 +273,8 @@ def get_obs(self):
obs = list()
if "demand" in self.state_space:
copy_zone_buses = copy.deepcopy(zone_buses)
copy_zone_buses.loc[sgen_buses]["p_mw"] -= pv
copy_zone_buses.loc[sgen_buses]["q_mvar"] -= q
copy_zone_buses.loc[sgen_buses]["p_mw"] += pv
copy_zone_buses.loc[sgen_buses]["q_mvar"] += q
obs += list(copy_zone_buses.loc[:, "p_mw"].to_numpy(copy=True))
obs += list(copy_zone_buses.loc[:, "q_mvar"].to_numpy(copy=True))
if "pv" in self.state_space:
Expand Down

0 comments on commit 81aa2a3

Please sign in to comment.