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

Remove predictor

parent 0df6694a
Branches
Tags
No related merge requests found
Subproject commit 7ffe3a6c87b8b360454b0657169bfb42053dea91 Subproject commit ebf6f6bbbd721cd1a91c1f51bd460896aee297a9
Subproject commit 48c245ed54aca35689bffd960030ba1f4422598d Subproject commit d97e5019054ed9dbb77750294a60553e5647e5d3
...@@ -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:\tProsumer Construction [s]: \t" + str(after_setup - before_setup)) print("process_each_prosumer:\tProsumer 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\tProsumer Optimization [s]: \t" + str(after_optimization - before_optimization)) print("runme:\t\t\tProsumer 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\tCommunity Assets Constr. [s]: \t" + str(after_community_assets - before_community_assets)) print("runme:\t\t\tCommunity Assets Constr. [s]: \t" + str(after_community_assets - before_community_assets))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment