Skip to content

Commit

Permalink
updating expertAgent for grid2op 1.6.4 and expertOp4Grid 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
marota committed Jan 7, 2022
1 parent ec6e198 commit a3c59d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions l2rpn_baselines/ExpertAgent/ExpertAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def act(self, observation, reward, done=False):
subsInCooldown = [i for i in range(observation.n_sub) if (observation.time_before_cooldown_sub[
i] >= 1)] # if you can not run an action currently on a susbtation, so no need to simulate on it

timestepsOverflowAllowed = observation._obs_env.parameters.NB_TIMESTEP_OVERFLOW_ALLOWED
timestepsOverflowAllowed = self.observation_space.obs_env.parameters.NB_TIMESTEP_OVERFLOW_ALLOWED
isManyOverloads = (n_overloads > timestepsOverflowAllowed)

ltcAlreadyConsidered = []
Expand Down Expand Up @@ -234,7 +234,7 @@ def save(self, path):

# we order overloads by usage rate but also by criticity giving remaining timesteps for overload before disconnect
def getRankedOverloads(self, observation):
timestepsOverflowAllowed = observation._obs_env.parameters.NB_TIMESTEP_OVERFLOW_ALLOWED
timestepsOverflowAllowed = self.observation_space.obs_env.parameters.NB_TIMESTEP_OVERFLOW_ALLOWED

sort_rho = -np.sort(-observation.rho) # sort in descending order for positive values
sort_indices = np.argsort(-observation.rho)
Expand Down

0 comments on commit a3c59d9

Please sign in to comment.