Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to version 1.2.0 #139

Merged
merged 50 commits into from
Aug 3, 2020
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bc4f01d
Create RandomRedispatchAgent.py
marota Jul 15, 2020
9373619
Adds randomredispatchAgent to init for export and fix gen selected
Tezirg Jul 15, 2020
48fde7a
Cleanup RandomRedispatchAgent
Tezirg Jul 16, 2020
f87daa1
RandomRedispatchAgent docstrings and typing
Tezirg Jul 16, 2020
0422968
RandomRedispatchAgent: Forgot to import numpy
Tezirg Jul 16, 2020
8eda8ea
Changelog update for randomredip agent
Jul 17, 2020
f9acf4c
Removes a docstring: Issue #127
Jul 17, 2020
d489d7e
EpisodeData #129: Removes one to game over count of environment actions
Jul 17, 2020
8ceeb89
fixing issue #125
BDonnot Jul 17, 2020
6eb21c0
Faster redispatchable gen selection
Tezirg Jul 19, 2020
1239536
Merge branch 'marota-randomRedispatchAgent' of github.com:BDonnot/Gri…
Tezirg Jul 19, 2020
b13e8da
Renames RandopmRedispatchAgen to DeltaRedispatchRandomAgent
Tezirg Jul 19, 2020
480d3f0
CHANGELOG: Updated for DeltaRedispatchRandomAgent
Tezirg Jul 19, 2020
74d7118
Add space_prng argument for sampling actions, as it is a missing posi…
Tezirg Jul 20, 2020
43c4555
Merge branch 'marota-randomRedispatchAgent' into zrg-1.1.2
Tezirg Jul 20, 2020
d89b8aa
CHANGELOG: Log fixed issues
Tezirg Jul 20, 2020
b32d1c5
Observation get forecast from dict instread of action to fix issue #131
Jul 22, 2020
355a0d0
Fixed backend iadd actions: Fix for issue #134
Jul 22, 2020
2e70500
Adds unittest for issue #131
Jul 22, 2020
2ba5af0
refactoring the test to reflect the github issue when one is associat…
BDonnot Jul 29, 2020
49cbbf1
Merge pull request #98 from BDonnot/bd_dev
Tezirg Jul 30, 2020
d5d2372
Changelog merge conflicts
Tezirg Jul 30, 2020
06bb0d4
Moves issue134 tests to BaseBackendTest
Tezirg Jul 30, 2020
33410f0
grid2op.Action: Removes action space sample logic from action class, …
Tezirg Jul 30, 2020
a4fef65
Changelog: Reference solved issue #134
Tezirg Jul 30, 2020
f091a42
Merge pull request #97 from BDonnot/zrg-1.1.2
BDonnot Jul 30, 2020
0b6bcef
Fix issue #126: No longer check env actions ambiguity on episode load…
Tezirg Jul 30, 2020
3121f2b
Changelog issue fixed update
Tezirg Jul 30, 2020
4b67208
Followup to #126: Do not set internal env modifications action for re…
Tezirg Jul 30, 2020
c351875
improve support for gym see issue #16
BDonnot Jul 30, 2020
44374ac
Merge branch 'master' into gym_space
BDonnot Jul 30, 2020
ca291e8
Merge pull request #99 from BDonnot/zrg-1.1.2
BDonnot Jul 30, 2020
42dad21
Merge branch 'master' into gym_space
BDonnot Jul 30, 2020
b27cb84
adding the possibility to converter the idtoact as a gym space
BDonnot Jul 30, 2020
3417245
refactoring the test for the gym converter
BDonnot Jul 30, 2020
a6bb84e
adding documentation for #16
BDonnot Jul 30, 2020
ff7ad99
SerializableActionSpace.sample()
Tezirg Jul 31, 2020
26cd95b
Docstring for actionspace.sample + tests fixed seed
Tezirg Jul 31, 2020
2b79dc3
Merge pull request #100 from BDonnot/zrg-1.1.2
BDonnot Jul 31, 2020
1dec57c
finishing the gym conversion for converters of type ToVect, further i…
BDonnot Jul 31, 2020
d98bb86
Merge branch 'master' into gym_space
BDonnot Jul 31, 2020
19968b2
Merge pull request #101 from BDonnot/gym_space
Tezirg Jul 31, 2020
77fe54e
new method to connect / disconnect powerline based on setting the bus…
BDonnot Jul 31, 2020
00c1c3f
rationalizing the API after the bug rte-france#134 and robustify back…
BDonnot Jul 31, 2020
3d3c1c0
fixing a bug caused by the wrong reading of the powerline status in s…
BDonnot Jul 31, 2020
78871fc
adding documentation for combinescaled reward
BDonnot Aug 3, 2020
bb3b8a9
adding test for the behaviour of action that impacts line status + no…
BDonnot Aug 3, 2020
9d83788
improving the help for the action to reflect new change
BDonnot Aug 3, 2020
b8979e9
improving documentation
BDonnot Aug 3, 2020
e057b90
Merge pull request #102 from BDonnot/co_disco
BDonnot Aug 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding documentation for combinescaled reward
  • Loading branch information
BDonnot committed Aug 3, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 78871fccc933fd1951d7fcaad554d89377463867
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@ Change Log
otherwise it affects the substations but not the powerline). Changing the bus of an extremity of
a powerline if this powerline is connected has no impact on its status and therefor it considers
it only affects the corresponding substation.
- [IMPROVED] added documentation and usage example for `CombineReward` and `CombineScaledReward`

[1.1.1] - 2020-07-07
---------------------
6 changes: 6 additions & 0 deletions grid2op/Environment/BaseEnv.py
Original file line number Diff line number Diff line change
@@ -1022,6 +1022,12 @@ def _get_reward(self, action, has_error, is_done, is_illegal, is_ambiguous):
}
return res, other_rewards

def get_reward_instance(self):
"""
Returns the instance of the object that is used to compute the reward.
"""
return self.reward_helper.template_reward

def _is_done(self, has_error, is_done):
no_more_data = self.chronics_handler.done()
return has_error or is_done or no_more_data
29 changes: 28 additions & 1 deletion grid2op/Reward/CombinedReward.py
Original file line number Diff line number Diff line change
@@ -9,9 +9,36 @@
from grid2op.Reward.BaseReward import BaseReward
from grid2op.dtypes import dt_float


class CombinedReward(BaseReward):
"""
This class allows to combine multiple rewards, by summing them for example.
This class allows to combine multiple pre defined reward. The reward it computes will
be the sum of all the sub rewards it is made of.

Each sub reward is identified by a key.

It is used a bit differently that the other rewards. See the section example for more information.

Examples
--------

.. code-block:: python

import grid2op
from grid2op.Reward import GameplayReward, FlatReward, CombinedReward

env = grid2op.make(..., reward_class=CombinedReward)
cr = self.env.get_reward_instance()
cr.addReward("Gameplay", GameplayReward(), 1.0)
cr.addReward("Flat", FlatReward(), 1.0)
cr.initialize(self.env)

obs = env.reset()
obs, reward, done, info = env.step(env.action_space())

# reward here is computed by summing the results of what would have
# given `GameplayReward` and the one from `FlatReward`

"""
def __init__(self):
BaseReward.__init__(self)
25 changes: 24 additions & 1 deletion grid2op/Reward/CombinedScaledReward.py
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
from grid2op.Reward.CombinedReward import CombinedReward
from grid2op.dtypes import dt_float


class CombinedScaledReward(CombinedReward):
"""
This class allows to combine multiple rewards.
@@ -19,7 +20,29 @@ class CombinedScaledReward(CombinedReward):
from the range [min_sum; max_sum] to [reward_min; reward_max]

min_sum and max_sum are computed from the weights and ranges of registered rewards.
See `Reward.BaseReward` for setting the output range.
See :class:`Reward.BaseReward` for setting the output range.

Examples
--------

.. code-block:: python

import grid2op
from grid2op.Reward import GameplayReward, FlatReward, CombinedScaledReward

env = grid2op.make(..., reward_class=CombinedScaledReward)
cr = self.env.get_reward_instance()
cr.addReward("Gameplay", GameplayReward(), 1.0)
cr.addReward("Flat", FlatReward(), 1.0)
cr.initialize(self.env)

obs = env.reset()
obs, reward, done, info = env.step(env.action_space())

# reward here is computed by summing the results of what would have
# given `GameplayReward` and the one from `FlatReward`


"""

def __init__(self):
2 changes: 2 additions & 0 deletions grid2op/tests/test_Reward.py
Original file line number Diff line number Diff line change
@@ -78,10 +78,12 @@ class TestLoadingL2RPNSandBoxScore(TestLoadingReward, unittest.TestCase):
def _reward_type(self):
return L2RPNSandBoxScore


class TestLoadingLinesCapacityReward(TestLoadingReward, unittest.TestCase):
def _reward_type(self):
return LinesCapacityReward


class TestDistanceReward(TestLoadingReward, unittest.TestCase):
def _reward_type(self):
return DistanceReward