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
9eece399
Commit
9eece399
authored
2 years ago
by
Christoph von Oy
Browse files
Options
Downloads
Patches
Plain Diff
Unified interfaces
parent
da909897
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
+39
-25
39 additions, 25 deletions
runme.py
with
40 additions
and
26 deletions
Model_Library
@
62dc4f57
Compare
bd5068ea
...
62dc4f57
Subproject commit
bd5068ea7d42868c7187c4afe4fa4e4b48daf1c5
Subproject commit
62dc4f5784caab6ad6bfe3f0103ef2255d5884eb
This diff is collapsed.
Click to expand it.
runme.py
+
39
−
25
View file @
9eece399
...
...
@@ -9,7 +9,6 @@ class SimulationScope(Enum):
PROSUMER
=
1
COMMUNITY
=
2
start_time
=
time
.
time
()
simulation_scope
=
SimulationScope
.
COMMUNITY
t_start
=
pd
.
Timestamp
(
"
2019-05-10 00:00:00
"
)
# start time of simulation
t_horizon
=
240
# number of time steps to be simulated
...
...
@@ -32,9 +31,10 @@ input_profile_dict = {'irradiance_1': ['irradiance', 'input_files/data/irradianc
'
demand_hot_water_3
'
:
[
'
hot_water_demand
'
,
'
generate
'
,
0
,
'
temperature_3
'
],
'
elec_price_1
'
:
[
'
elec_price
'
,
'
input_files/data/prices/day-ahead/hourly_price.csv
'
]}
before
=
time
.
time
()
input_profiles
=
Tooling
.
input_profile_processor
.
input_profile_processor
.
process_input_profiles
(
input_profile_dict
,
t_start
,
t_horizon
,
t_step
)
after
_input_processing_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Profile Processing [s]:
\t
"
+
str
(
after
_input_processing_time
-
start_tim
e
))
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Profile Processing [s]:
\t
"
+
str
(
after
-
befor
e
))
# 'config_path': path to global configurations like prices, injection prices, emission costs, etc.
# 'topology_path': path to directory that contains the matrices that define the prosumer topology
...
...
@@ -50,43 +50,57 @@ prosumer_dict = {'SCN2_CAT1_PV11_3000_6000':{'config_path': 'input_files/models/
'
therm_cns
'
:
'
demand_heat_2
'
,
'
dhw_dmd
'
:
'
demand_hot_water_2
'
}}}
prosumer_strategy
=
'
annuity
'
before_optimization_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Setup [s]:
\t\t
"
+
str
(
before_optimization_time
-
after_input_processing_time
))
before
=
time
.
time
()
prosumer_main
=
main
.
Main
(
prosumer_dict
,
input_profiles
,
t_horizon
,
t_step
)
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Construction [s]:
\t
"
+
str
(
after
-
before
))
prosumer_main
.
run_optimization
(
prosumer_strategy
)
before
=
time
.
time
()
prosumer_sizing_strategy
=
'
annuity
'
prosumer_main
.
optimize_sizing
(
prosumer_sizing_strategy
)
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Size Optimization [s]:
"
+
str
(
after
-
before
))
prosumer_main
.
show_results
()
before
=
time
.
time
()
prosumer_main
.
save_results
()
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Results Saving [s]:
\t
"
+
str
(
after
-
before
))
prosumers
=
prosumer_main
.
prosumers
after_optimization_time
=
time
.
time
()
print
(
"
runme:
\t\t\t
Prosumer Optimization [s]:
\t
"
+
str
(
after_optimization_time
-
before_optimization_time
))
if
simulation_scope
==
SimulationScope
.
PROSUMER
:
exit
()
start_community_time
=
time
.
time
()
community_assets_dict
=
{
'
ca_bat
'
:
{
'
config_path
'
:
'
input_files/models/district_models/example_CA/config.csv
'
,
'
topology_path
'
:
'
input_files/models/district_models/example_CA
'
,
'
profiles
'
:
{
'
elec_cns_ca_bat
'
:
'
demand_electric_3
'
}}}
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
))
before
=
time
.
time
()
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_tim
e
))
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Assets Constr. [s]:
\t
"
+
str
(
after
-
befor
e
))
community_dict
=
{
'
community
'
:
{
'
config_path
'
:
'
input_files/models/district_models/example_community/config.csv
'
,
'
profiles
'
:
{
'
elec_price
'
:
'
elec_price_1
'
}}}
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_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
))
before
=
time
.
time
()
community_main
=
main_district
.
MainDistrict
(
community_dict
,
prosumers
,
community_assets
,
input_profiles
,
t_horizon
,
t_step
)
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Construction [s]:
\t
"
+
str
(
after
-
before
))
before
=
time
.
time
()
community_sizing_strategy
=
'
sizing_max_operational_profit
'
community_main
.
optimize_sizing
(
community_sizing_strategy
)
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Size Opt. [s]:
\t
"
+
str
(
after
-
before
))
before
=
time
.
time
()
community_operation_strategy
=
'
max_operational_profit
'
community_main
.
optimize_operation
(
t_horizon
,
community_operation_strategy
)
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Operation Opt. [s]:
\t
"
+
str
(
after
-
before
))
before
=
time
.
time
()
community_main
.
save_results
()
after
=
time
.
time
()
print
(
"
runme:
\t\t\t
Community Results Saving [s]:
\t
"
+
str
(
after
-
before
))
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