Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bi-Level_EVA
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Strach
Bi-Level_EVA
Commits
61056e9a
Commit
61056e9a
authored
Jan 30, 2023
by
Christoph von Oy
Browse files
Options
Downloads
Patches
Plain Diff
Removed old parallelisation
parent
a9c0e49e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Model_Library
+1
-1
1 addition, 1 deletion
Model_Library
runme.py
+3
-16
3 additions, 16 deletions
runme.py
with
4 additions
and
17 deletions
Model_Library
@
d9149201
Compare
842c38c6
...
d9149201
Subproject commit
842c38c62fea72093415c476e92916fac9a1a45e
Subproject commit
d914920165330f710c732de4417c29db7bd067b8
This diff is collapsed.
Click to expand it.
runme.py
+
3
−
16
View file @
61056e9a
...
@@ -3,10 +3,6 @@ import pandas as pd
...
@@ -3,10 +3,6 @@ import pandas as pd
import
Tooling.input_profile_processor.input_profile_processor
import
Tooling.input_profile_processor.input_profile_processor
import
Model_Library.Prosumer.main
as
main
import
Model_Library.Prosumer.main
as
main
import
Model_Library.District.main_district
as
main_district
import
Model_Library.District.main_district
as
main_district
from
functools
import
partial
from
multiprocessing
import
Pool
from
tqdm
import
tqdm
import
os
from
enum
import
Enum
from
enum
import
Enum
class
SimulationScope
(
Enum
):
class
SimulationScope
(
Enum
):
...
@@ -69,20 +65,11 @@ prosumer_dict = {'SCN2_CAT1_PV11_3000_6000':{'topology_path': 'input_files/model
...
@@ -69,20 +65,11 @@ prosumer_dict = {'SCN2_CAT1_PV11_3000_6000':{'topology_path': 'input_files/model
'
dhw_dmd
'
:
'
demand_hot_water_2
'
}},}
'
dhw_dmd
'
:
'
demand_hot_water_2
'
}},}
prosumer_strategy
=
'
annuity
'
prosumer_strategy
=
'
annuity
'
parallel_processing
=
False
before_optimization_time
=
time
.
time
()
before_optimization_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Setup [s]:
\t\t
"
+
str
(
before_optimization_time
-
after_input_processing_time
))
print
(
"
runme:
\t\t\t
Prosumer Setup [s]:
\t\t
"
+
str
(
before_optimization_time
-
after_input_processing_time
))
# Run multiple independent prosumers in parallel on multiple cores
prosumers
=
dict
()
prosumers
=
dict
.
fromkeys
(
prosumer_dict
.
keys
())
for
prosumer_name
in
prosumer_dict
:
if
parallel_processing
:
count_processes
=
len
(
prosumer_dict
.
keys
())
pool
=
Pool
(
os
.
cpu_count
())
parallel_func
=
partial
(
process_each_prosumer
,
input_profiles
=
input_profiles
,
t_horizon
=
t_horizon
,
t_step
=
t_step
,
prosumer_strategy
=
prosumer_strategy
)
mapped_values
=
list
(
tqdm
(
pool
.
map
(
parallel_func
,
list
(
prosumer_dict
.
keys
()),
list
(
prosumer_dict
.
values
())),
total
=
count_processes
))
# Normal processing, one core only
else
:
for
prosumer_name
in
list
(
prosumer_dict
.
keys
()):
prosumers
[
prosumer_name
]
=
process_each_prosumer
(
prosumer_name
,
prosumer_dict
[
prosumer_name
],
input_profiles
,
t_horizon
,
t_step
,
prosumer_strategy
)
prosumers
[
prosumer_name
]
=
process_each_prosumer
(
prosumer_name
,
prosumer_dict
[
prosumer_name
],
input_profiles
,
t_horizon
,
t_step
,
prosumer_strategy
)
after_optimization_time
=
time
.
time
()
after_optimization_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Optimization [s]:
\t
"
+
str
(
after_optimization_time
-
before_optimization_time
))
print
(
"
runme:
\t\t\t
Prosumer Optimization [s]:
\t
"
+
str
(
after_optimization_time
-
before_optimization_time
))
...
...
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