Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resite_ip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
smart_grids
public
resite_ip
Commits
a7c25bde
Commit
a7c25bde
authored
4 years ago
by
David Radu
Browse files
Options
Downloads
Patches
Plain Diff
updated pickle files for planning purposes
parent
eea9b90b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config_model.yml
+2
-1
2 additions, 1 deletion
config_model.yml
src/main.py
+24
-5
24 additions, 5 deletions
src/main.py
with
26 additions
and
6 deletions
config_model.yml
+
2
−
1
View file @
a7c25bde
...
...
@@ -23,7 +23,7 @@ latitude_layer: True
distance_layer
:
False
# for offshore
# Start time and end time of the analysis.
time_slice
:
[
'
2018-01-01T00:00'
,
'
2018-1
2
-31T23:00'
]
time_slice
:
[
'
2018-01-01T00:00'
,
'
2018-
0
1-31T23:00'
]
# List of regions to be considered in the optimization.
regions
:
[
'
EU'
]
# Technologies to deploy.
...
...
@@ -67,6 +67,7 @@ solution_method:
algorithm
:
'
SALSR'
#'GLS'
which_sol
:
'
rand'
#'rand'
seed
:
1
purpose
:
'
planning'
# 'ol'
GRED
:
set
:
False
epsilon
:
0.001
...
...
This diff is collapsed.
Click to expand it.
src/main.py
+
24
−
5
View file @
a7c25bde
...
...
@@ -7,7 +7,7 @@ import time
from
src.helpers
import
read_inputs
,
init_folder
,
custom_log
,
remove_garbage
,
generate_jl_output
from
src.models
import
preprocess_input_data
,
build_model
from
src.tools
import
retrieve_location_dict
,
retrieve_site_data
from
src.tools
import
retrieve_location_dict
,
retrieve_site_data
,
retrieve_location_dict_jl
,
retrieve_index_dict
def
parse_args
():
...
...
@@ -125,6 +125,7 @@ if __name__ == '__main__':
if
not
isinstance
(
parameters
[
'
solution_method
'
][
'
MIRSA
'
][
'
c
'
],
list
):
raise
ValueError
(
'
Values of c have to elements of a list for the heuristic set-up.
'
)
_
,
_
,
_
,
indices
=
retrieve_index_dict
(
parameters
,
input_dict
[
'
coordinates_data
'
])
jl_dict
=
generate_jl_output
(
parameters
[
'
deployment_vector
'
],
criticality_data
,
coordinates_data
)
...
...
@@ -149,11 +150,29 @@ if __name__ == '__main__':
dt
=
(
end
-
start
)
/
noruns
print
(
f
'
Average time per run:
{
dt
}
'
)
output_folder
=
init_folder
(
parameters
,
suffix
=
'
_c
'
+
str
(
c
)
+
'
_MIRSA
'
)
if
parameters
[
'
solution_method
'
][
'
MIRSA
'
][
'
purpose
'
]
==
'
planning
'
:
seed
=
parameters
[
'
solution_method
'
][
'
HEU
'
][
'
seed
'
]
for
i
in
range
(
jl_selected
.
shape
[
0
]):
pickle
.
dump
(
jl_selected
,
open
(
join
(
output_folder
,
'
solution_matrix.p
'
),
'
wb
'
))
pickle
.
dump
(
jl_objective
,
open
(
join
(
output_folder
,
'
objective_vector.p
'
),
'
wb
'
))
pickle
.
dump
(
jl_traj
,
open
(
join
(
output_folder
,
'
trajectory_matrix.p
'
),
'
wb
'
))
output_folder
=
init_folder
(
parameters
,
suffix
=
'
_seed
'
+
str
(
seed
))
seed
+=
1
with
open
(
join
(
output_folder
,
'
config_model.yaml
'
),
'
w
'
)
as
outfile
:
yaml
.
dump
(
parameters
,
outfile
,
default_flow_style
=
False
,
sort_keys
=
False
)
jl_selected_seed
=
jl_selected
[
i
,
:]
jl_objective_seed
=
jl_objective
[
i
]
jl_locations
=
retrieve_location_dict_jl
(
jl_selected_seed
,
parameters
,
input_dict
,
indices
)
retrieve_site_data
(
c
,
parameters
,
coordinates_data
,
criticality_data
,
output_data
,
output_folder
,
jl_locations
,
jl_objective_seed
)
else
:
output_folder
=
init_folder
(
parameters
,
suffix
=
'
_c
'
+
str
(
c
)
+
'
_MIRSA
'
)
pickle
.
dump
(
jl_selected
,
open
(
join
(
output_folder
,
'
solution_matrix.p
'
),
'
wb
'
))
pickle
.
dump
(
jl_objective
,
open
(
join
(
output_folder
,
'
objective_vector.p
'
),
'
wb
'
))
pickle
.
dump
(
jl_traj
,
open
(
join
(
output_folder
,
'
trajectory_matrix.p
'
),
'
wb
'
))
elif
parameters
[
'
solution_method
'
][
'
GRED
'
][
'
set
'
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment