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
7521e006
Commit
7521e006
authored
Jan 6, 2023
by
Christoph von Oy
Browse files
Options
Downloads
Patches
Plain Diff
Remove predictor
parent
0df6694a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Model_Library
+1
-1
1 addition, 1 deletion
Model_Library
Tooling
+1
-1
1 addition, 1 deletion
Tooling
runme_community.py
+5
-16
5 additions, 16 deletions
runme_community.py
with
7 additions
and
18 deletions
Model_Library
@
ebf6f6bb
Compare
7ffe3a6c
...
ebf6f6bb
Subproject commit
7ffe3a6c87b8b360454b0657169bfb42053de
a9
1
Subproject commit
ebf6f6bbbd721cd1a91c1f51bd460896aee297
a9
This diff is collapsed.
Click to expand it.
Tooling
@
d97e5019
Compare
48c245ed
...
d97e5019
Subproject commit
48c245ed54aca35689bffd960030ba1f4422598d
Subproject commit
d97e5019054ed9dbb77750294a60553e5647e5d3
This diff is collapsed.
Click to expand it.
runme_community.py
+
5
−
16
View file @
7521e006
...
@@ -12,11 +12,11 @@ from Model_Library.Prosumer.scripts.results_evaluation.results_evaluation import
...
@@ -12,11 +12,11 @@ from Model_Library.Prosumer.scripts.results_evaluation.results_evaluation import
import
Model_Library.District.main_district
as
main_district
import
Model_Library.District.main_district
as
main_district
def
process_each_prosumer
(
prosumer_name
,
prosumer_specification
,
commentary
,
t_start
,
t_horizon
,
t_step
,
predictions
,
t_history
,
prosumer_strategy
):
def
process_each_prosumer
(
prosumer_name
,
prosumer_specification
,
commentary
,
t_start
,
t_horizon
,
t_step
,
t_history
,
prosumer_strategy
):
try
:
try
:
before_setup
=
time
.
time
()
before_setup
=
time
.
time
()
# Start main programme
# Start main programme
prosumer
=
main
.
Main
(
prosumer_name
,
prosumer_specification
,
t_start
,
t_horizon
,
t_step
,
predictions
,
t_history
,
commentary
)
prosumer
=
main
.
Main
(
prosumer_name
,
prosumer_specification
,
t_start
,
t_horizon
,
t_step
,
t_history
,
commentary
)
after_setup
=
time
.
time
()
after_setup
=
time
.
time
()
print
(
"
process_each_prosumer:
\t
Prosumer Construction [s]:
\t
"
+
str
(
after_setup
-
before_setup
))
print
(
"
process_each_prosumer:
\t
Prosumer Construction [s]:
\t
"
+
str
(
after_setup
-
before_setup
))
...
@@ -61,17 +61,6 @@ if __name__ == "__main__":
...
@@ -61,17 +61,6 @@ if __name__ == "__main__":
ps_strategy
=
[
'
annuity
'
]
ps_strategy
=
[
'
annuity
'
]
# Prediction settings
predictions
=
{
'
demand_electric
'
:
'
ActualData
'
,
'
demand_heat
'
:
'
ActualData
'
,
'
day_ahead_price
'
:
'
ActualData
'
,
'
intraday_price
'
:
'
ActualData
'
,
'
solar_radiation
'
:
'
ActualData
'
,
# currently the method generate_g_t_series takes the same t_start as the prediction -> no historical
# data for the prediction available: easy fix would be to set a minus time delta in the t_start
# argument of generate_g_t_series
'
temperature
'
:
'
ActualData
'
}
reference_results
=
{}
reference_results
=
{}
commentary
=
False
commentary
=
False
parallel_processing
=
False
parallel_processing
=
False
...
@@ -84,12 +73,12 @@ if __name__ == "__main__":
...
@@ -84,12 +73,12 @@ if __name__ == "__main__":
if
parallel_processing
:
if
parallel_processing
:
count_processes
=
len
(
prosumer_dict
.
keys
())
count_processes
=
len
(
prosumer_dict
.
keys
())
pool
=
Pool
(
os
.
cpu_count
())
pool
=
Pool
(
os
.
cpu_count
())
parallel_func
=
partial
(
process_each_prosumer
,
commentary
=
commentary
,
t_start
=
t_start
,
t_horizon
=
t_horizon
,
t_step
=
t_step
,
predictions
=
predictions
,
t_history
=
t_history
,
prosumer_strategy
=
ps_strategy
)
parallel_func
=
partial
(
process_each_prosumer
,
commentary
=
commentary
,
t_start
=
t_start
,
t_horizon
=
t_horizon
,
t_step
=
t_step
,
t_history
=
t_history
,
prosumer_strategy
=
ps_strategy
)
mapped_values
=
list
(
tqdm
(
pool
.
map
(
parallel_func
,
list
(
prosumer_dict
.
keys
()),
list
(
prosumer_dict
.
values
())),
total
=
count_processes
))
mapped_values
=
list
(
tqdm
(
pool
.
map
(
parallel_func
,
list
(
prosumer_dict
.
keys
()),
list
(
prosumer_dict
.
values
())),
total
=
count_processes
))
# Normal processing, one core only
# Normal processing, one core only
else
:
else
:
for
prosumer_name
in
list
(
prosumer_dict
.
keys
()):
for
prosumer_name
in
list
(
prosumer_dict
.
keys
()):
final_prosumer_dict
[
prosumer_name
]
=
process_each_prosumer
(
prosumer_name
,
prosumer_dict
[
prosumer_name
],
commentary
,
t_start
,
t_horizon
,
t_step
,
predictions
,
t_history
,
ps_strategy
)
final_prosumer_dict
[
prosumer_name
]
=
process_each_prosumer
(
prosumer_name
,
prosumer_dict
[
prosumer_name
],
commentary
,
t_start
,
t_horizon
,
t_step
,
t_history
,
ps_strategy
)
after_optimization
=
time
.
time
()
after_optimization
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Optimization [s]:
\t
"
+
str
(
after_optimization
-
before_optimization
))
print
(
"
runme:
\t\t\t
Prosumer Optimization [s]:
\t
"
+
str
(
after_optimization
-
before_optimization
))
...
@@ -121,7 +110,7 @@ print("runme:\t\t\tCommunity Assets Setup [s]: \t" + str(before_community_assets
...
@@ -121,7 +110,7 @@ print("runme:\t\t\tCommunity Assets Setup [s]: \t" + str(before_community_assets
# initialize community component in the same way prosumers are.
# initialize community component in the same way prosumers are.
# The difference is that they are not directly optimized
# The difference is that they are not directly optimized
comm_assets
=
main
.
Main_CA
(
ca_dict
,
t_start
,
t_horizon
,
t_step
,
predictions
,
t_history
,
commentary
)
comm_assets
=
main
.
Main_CA
(
ca_dict
,
t_start
,
t_horizon
,
t_step
,
t_history
,
commentary
)
after_community_assets
=
time
.
time
()
after_community_assets
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Assets Constr. [s]:
\t
"
+
str
(
after_community_assets
-
before_community_assets
))
print
(
"
runme:
\t\t\t
Community Assets Constr. [s]:
\t
"
+
str
(
after_community_assets
-
before_community_assets
))
...
...
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