Skip to content
Snippets Groups Projects
Commit 9eece399 authored by Christoph von Oy's avatar Christoph von Oy
Browse files

Unified interfaces

parent da909897
No related branches found
No related tags found
No related merge requests found
Subproject commit bd5068ea7d42868c7187c4afe4fa4e4b48daf1c5
Subproject commit 62dc4f5784caab6ad6bfe3f0103ef2255d5884eb
......@@ -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\tProfile Processing [s]: \t" + str(after_input_processing_time - start_time))
after = time.time()
print("runme:\t\t\tProfile Processing [s]: \t" + str(after - before))
# '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\tProsumer 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\tProsumer 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\tProsumer Size Optimization [s]: " + str(after - before))
prosumer_main.show_results()
before = time.time()
prosumer_main.save_results()
after = time.time()
print("runme:\t\t\tProsumer Results Saving [s]: \t" + str(after - before))
prosumers = prosumer_main.prosumers
after_optimization_time = time.time()
print("runme:\t\t\tProsumer 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\tCommunity 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\tCommunity Assets Constr. [s]: \t" + str(after_community_assets_time - before_community_assets_time))
after = time.time()
print("runme:\t\t\tCommunity Assets Constr. [s]: \t" + str(after - before))
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\tComm. 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\tCommunity 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\tCommunity 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\tCommunity 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\tCommunity Operation Opt. [s]: \t" + str(after - before))
before = time.time()
community_main.save_results()
after = time.time()
print("runme:\t\t\tCommunity Results Saving [s]: \t" + str(after - before))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment