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
6c015180
Commit
6c015180
authored
Jan 12, 2023
by
Christoph von Oy
Browse files
Options
Downloads
Patches
Plain Diff
Unified interfaces
parent
626f5c07
Branches
Branches containing commit
Tags
Tags containing commit
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_community.py
+6
-6
6 additions, 6 deletions
runme_community.py
with
7 additions
and
7 deletions
Model_Library
@
bb535eb1
Compare
eca62129
...
bb535eb1
Subproject commit
eca62129623fbfd0e202b75150402ea50a4d62e
8
Subproject commit
bb535eb1c0d4a227071cc94ed34d7b6f7cf2810
8
This diff is collapsed.
Click to expand it.
runme_community.py
+
6
−
6
View file @
6c015180
...
...
@@ -8,9 +8,9 @@ from multiprocessing import Pool
from
tqdm
import
tqdm
import
os
def
process_each_prosumer
(
prosumer_name
,
prosumer_specification
,
input_profiles
,
t_start
,
t_horizon
,
t_step
,
prosumer_strategy
):
def
process_each_prosumer
(
prosumer_name
,
prosumer_specification
,
input_profiles
,
t_horizon
,
t_step
,
prosumer_strategy
):
start_time
=
time
.
time
()
prosumer
=
main
.
Main
(
prosumer_name
,
prosumer_specification
,
input_profiles
,
t_start
,
t_horizon
,
t_step
)
prosumer
=
main
.
Main
(
prosumer_name
,
prosumer_specification
,
input_profiles
,
t_horizon
,
t_step
)
after_setup_time
=
time
.
time
()
print
(
"
process_each_prosumer:
\t
Prosumer Construction [s]:
\t
"
+
str
(
after_setup_time
-
start_time
))
...
...
@@ -75,12 +75,12 @@ prosumers = dict.fromkeys(prosumer_dict.keys())
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_start
=
t_start
,
t_horizon
=
t_horizon
,
t_step
=
t_step
,
prosumer_strategy
=
prosumer_strategy
)
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_start
,
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
()
print
(
"
runme:
\t\t\t
Prosumer Optimization [s]:
\t
"
+
str
(
after_optimization_time
-
before_optimization_time
))
...
...
@@ -97,7 +97,7 @@ community_assets_strategy = 'sizing_max_operational_profit'
before_community_assets_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Assets Setup [s]:
\t
"
+
str
(
before_community_assets_time
-
start_community_time
))
community_assets
=
main
.
Main_CA
(
community_assets_dict
,
input_profiles
,
t_start
,
t_horizon
,
t_step
)
community_assets
=
main
.
Main_CA
(
community_assets_dict
,
input_profiles
,
t_horizon
,
t_step
)
.
community_assets
after_community_assets_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Assets Constr. [s]:
\t
"
+
str
(
after_community_assets_time
-
before_community_assets_time
))
...
...
@@ -108,6 +108,6 @@ community_strategy = ['max_operational_profit']
before_community_optimization_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Comm. Optimization Setup [s]:
\t
"
+
str
(
before_community_optimization_time
-
after_community_assets_time
))
community_main
=
main_district
.
MainDistrict
(
community_dict
,
prosumers
,
community_assets
,
input_profiles
,
t_start
,
t_horizon
,
t_step
,
community_assets_strategy
,
community_strategy
)
community_main
=
main_district
.
MainDistrict
(
community_dict
,
prosumers
,
community_assets
,
input_profiles
,
t_horizon
,
t_step
,
community_assets_strategy
,
community_strategy
)
after_community_optimization_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Optimization [s]:
\t
"
+
str
(
after_community_optimization_time
-
before_community_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