-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #442 from laure-crochepierre/assistant_params
Assistant feature (code cleaning + new parameter)
- Loading branch information
Showing
63 changed files
with
1,922 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
grid2op/data_test/l2rpn_idf_2023_with_alert/alerts_info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"fixed": {"west": ["34_35_110", "34_36_111", "33_35_113", "33_36_114", "32_36_112", "36_38_115", "36_39_116", | ||
"38_39_119", "39_40_120", "39_41_121", "40_41_122", "41_48_131", "41_48_132", | ||
"33_42_124", "37_36_179", "37_64_161", "42_43_123", "43_44_125", "44_48_133", | ||
"45_47_128", "44_45_126", "47_48_134", "45_46_127", "46_48_130", | ||
"48_68_170", "46_68_169"], | ||
"east": ["50_51_137", "48_65_164", "48_65_165", "51_52_138", "52_53_139", "48_53_141", "48_53_142", | ||
"48_49_135", "48_50_136", "50_57_149", "49_56_147", "55_57_148", "55_56_146", "54_55_145", | ||
"53_55_144", "53_54_143", "53_58_150", "54_58_154", "55_58_152", "55_58_153", | ||
"62_58_180", "58_59_155", "58_60_156", "62_63_160", "59_60_157", "63_60_181", "60_61_159", | ||
"59_61_158", "63_64_163", "61_66_167", "61_65_166", "65_66_168", "64_65_182"], | ||
"middle": ["41_48_131", "41_48_132", "44_48_133", "47_48_134", "46_48_130", "48_68_170", | ||
"48_65_164", "48_65_165", "48_49_135", "48_50_136", "48_53_141", "48_53_142"] | ||
}, | ||
"is_alert": "True" | ||
} |
Binary file added
BIN
+824 Bytes
grid2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/load_p.csv.bz2
Binary file not shown.
Binary file added
BIN
+835 Bytes
...data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/load_p_forecasted.csv.bz2
Binary file not shown.
Binary file added
BIN
+764 Bytes
grid2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/load_q.csv.bz2
Binary file not shown.
Binary file added
BIN
+767 Bytes
...data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/load_q_forecasted.csv.bz2
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
...2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/maintenance_meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"maintenance_starting_hour": 9 , | ||
"maintenance_ending_hour": 17, | ||
"line_to_maintenance": ["62_58_180", | ||
"62_63_160", | ||
"48_50_136", | ||
"48_53_141", | ||
"41_48_131", | ||
"39_41_121", | ||
"43_44_125", | ||
"44_45_126", | ||
"34_35_110", | ||
"54_58_154"], | ||
"daily_proba_per_month_maintenance": [0.0, 0.0, 0.0, 0.02, 0.02, 0.03, 0.05, 0.06, 0.03, 0.02, 0.0, 0.0], | ||
"max_daily_number_per_month_maintenance": [0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 0, 0] | ||
} |
Binary file added
BIN
+267 Bytes
grid2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/prod_p.csv.bz2
Binary file not shown.
Binary file added
BIN
+286 Bytes
...data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/prod_p_forecasted.csv.bz2
Binary file not shown.
Binary file added
BIN
+151 Bytes
grid2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/prod_v.csv.bz2
Binary file not shown.
1 change: 1 addition & 0 deletions
1
grid2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/start_datetime.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2012-04-01 00:00 |
1 change: 1 addition & 0 deletions
1
grid2op/data_test/l2rpn_idf_2023_with_alert/chronics/Scenario_april_000/time_interval.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
00:05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
from grid2op.Action import PlayableAction, PowerlineSetAction | ||
from grid2op.Reward import AlarmReward | ||
from grid2op.Rules import DefaultRules | ||
from grid2op.Chronics import Multifolder | ||
from grid2op.Chronics import GridStateFromFileWithForecastsWithMaintenance | ||
from grid2op.Backend import PandaPowerBackend | ||
from grid2op.Opponent import GeometricOpponent, BaseActionBudget | ||
from grid2op.operator_attention import LinearAttentionBudget | ||
|
||
lines_attacked = [ | ||
"62_58_180", | ||
"62_63_160", | ||
"48_50_136", | ||
"48_53_141", | ||
"41_48_131", | ||
"39_41_121", | ||
"43_44_125", | ||
"44_45_126", | ||
"34_35_110", | ||
"54_58_154", | ||
] | ||
|
||
opponent_attack_cooldown = 12 # 1 hour, 1 hour being 12 time steps | ||
opponent_attack_duration = 96 # 8 hours at maximum | ||
opponent_budget_per_ts = ( | ||
0.17 # opponent_attack_duration / opponent_attack_cooldown + epsilon | ||
) | ||
opponent_init_budget = 144.0 # no need to attack straightfully, it can attack starting at midday the first day | ||
config = { | ||
"backend": PandaPowerBackend, | ||
"action_class": PlayableAction, | ||
"observation_class": None, | ||
"reward_class": AlarmReward, | ||
"gamerules_class": DefaultRules, | ||
"chronics_class": Multifolder, | ||
"grid_value_class": GridStateFromFileWithForecastsWithMaintenance, | ||
"volagecontroler_class": None, | ||
"names_chronics_to_grid": None, | ||
"thermal_limits": [ | ||
60.9, | ||
231.9, | ||
272.6, | ||
212.8, | ||
749.2, | ||
332.4, | ||
348.0, | ||
414.4, | ||
310.1, | ||
371.4, | ||
401.2, | ||
124.3, | ||
298.5, | ||
86.4, | ||
213.9, | ||
160.8, | ||
112.2, | ||
291.4, | ||
489.0, | ||
489.0, | ||
124.6, | ||
196.7, | ||
191.9, | ||
238.4, | ||
174.2, | ||
105.6, | ||
143.7, | ||
293.4, | ||
288.9, | ||
107.7, | ||
415.5, | ||
148.2, | ||
124.2, | ||
154.4, | ||
85.9, | ||
106.5, | ||
142.0, | ||
124.0, | ||
130.2, | ||
86.2, | ||
278.1, | ||
182.0, | ||
592.1, | ||
173.1, | ||
249.8, | ||
441.0, | ||
344.2, | ||
722.8, | ||
494.6, | ||
494.6, | ||
196.7, | ||
151.8, | ||
263.4, | ||
364.1, | ||
327.0, | ||
370.5, | ||
441.0, | ||
300.3, | ||
656.2, | ||
], | ||
"opponent_attack_cooldown": opponent_attack_cooldown, | ||
"opponent_attack_duration": opponent_attack_duration, | ||
"opponent_budget_per_ts": opponent_budget_per_ts, | ||
"opponent_init_budget": opponent_init_budget, | ||
"opponent_action_class": PowerlineSetAction, | ||
"opponent_class": GeometricOpponent, | ||
"opponent_budget_class": BaseActionBudget, | ||
"kwargs_opponent": { | ||
"lines_attacked": lines_attacked, | ||
"attack_every_xxx_hour": 24, | ||
"average_attack_duration_hour": 4, | ||
"minimum_attack_duration_hour": 1, | ||
}, | ||
"has_attention_budget": True, | ||
"attention_budget_class": LinearAttentionBudget, | ||
"kwargs_attention_budget": { | ||
"max_budget": 3.0, | ||
"budget_per_ts": 1.0 / (12.0 * 16), | ||
"alarm_cost": 1.0, | ||
"init_budget": 2.0, | ||
}, | ||
} |
Oops, something went wrong.