diff --git a/Prosumer/main.py b/Prosumer/main.py index e22fa3296a3332f5ccfcd7af3d03d341a48d9706..55a4406534ee281f556a4afc2ca62e1a6ddeb5c8 100644 --- a/Prosumer/main.py +++ b/Prosumer/main.py @@ -141,13 +141,28 @@ class Main: input_profiles[self.name_list]['demand_electricity'] = \ ts.generate_profile(self.t_begin_profile, self.t_step, self.t_profile_length, generate_elec_demand=('h0', self.elec_demand_yearly)) - elif path_item == 'demand_heat': input_profiles[self.name_list]['demand_heat'] = \ ts.generate_profile(self.t_begin_profile, self.t_step, self.t_profile_length, generate_therm_demand=('EFH', self.therm_demand_yearly, input_profiles[self.name_list]['temperature']), generate_water_demand=('EFH', self.hot_water_demand_yearly, input_profiles[self.name_list]['temperature'])) - + elif path_item == 'demand_heat_tek': + input_profiles[self.name_list]['demand_heat'] = \ + ts.generate_profile(self.t_begin_profile, + self.t_step, + self.t_profile_length, + generate_therm_demand_tek=( + 'Verwaltungsgebäude', + self.therm_demand_yearly, + input_profiles[ + self.name_list][ + 'temperature']), + generate_water_demand_tek=( + 'Verwaltungsgebäude', + self.hot_water_demand_yearly, + input_profiles[ + self.name_list][ + 'temperature'])) # Generate prediction time series # todo: nicer coding required. generic code for all input timeseries for path_item in prosumer_data_path_dict[self.name_list]: @@ -163,7 +178,8 @@ class Main: self.t_start_loop:self.t_start_loop + pd.Timedelta(hours=self.t_current_value_length - 1)] # Add timseries to prosumer model self.prosumer[self.name_list].add_profile(predict_electric_demand) - elif path_item == 'demand_heat': + elif path_item == 'demand_heat' or path_item == \ + 'demand_heat_tek': predict_heat_demand = ts.generate_profile( self.t_start_loop, self.t_step, self.t_horizon, therm_demand=input_profiles[self.name_list]['demand_heat']['therm_demand'], @@ -374,7 +390,8 @@ class Main: for components in all_comp['Components']: comp_object = all_comp['Components'][components] comp_type = comp_object.get_type() - if comp_type == 'Storage': + if comp_type == 'Storage' and all_results.iloc[ + amount_results-1][('cap', components[0])] != 0: self.charge_status[name_list][components[0]] = all_results.iloc[amount_results-1][('energy', components[0])]\ /all_results.iloc[amount_results-1][('cap', components[0])] except ValueError: diff --git a/Prosumer/scripts/time_series_processing.py b/Prosumer/scripts/time_series_processing.py index 68d39abc7c07523f7ee971051fd370c712b18413..0b148087bd68e63fcbb770d2cdcb5b1f2c6b3c5b 100644 --- a/Prosumer/scripts/time_series_processing.py +++ b/Prosumer/scripts/time_series_processing.py @@ -29,6 +29,7 @@ from datetime import datetime from Tooling.predictor.PredictionGenerator import PredictionGenerator from Tooling.demand_generator.electrical_demand.ElectricalDemand import ElectricalDemand from Tooling.demand_generator.thermal_demand.ThermalDemand import ThermalDemand +import Tooling.demand_generator.tek_data.gen_heat_profile as tek def generate_profile(t_start, t_step, t_horizon, prediction='Perfect', **kwargs): @@ -135,10 +136,18 @@ def generate_profile(t_start, t_step, t_horizon, prediction='Perfect', **kwargs) bld_typ = kwargs[profile][0] total_demand = kwargs[profile][1] weather = kwargs[profile][2] + year = int(pd.Timestamp(t_start).year) + + input_profiles['therm_demand'] = tek.gen_heat_profile( + building_typ=bld_typ, temperature_profile=weather, year=year, + yearly_demand=total_demand) elif profile == 'generate_water_demand_tek': bld_typ = kwargs[profile][0] total_demand = kwargs[profile][1] - weather = kwargs[profile][2] + year = int(pd.Timestamp(t_start).year) + + input_profiles['hot_water_demand'] = tek.gen_hot_water_profile( + building_typ=bld_typ, year=year, yearly_demand=total_demand) else: # apply prediction methods upon other input profiles (air_temp, irradiance, etc.) predictors[profile] = PredictionGenerator(kwargs[profile], method=prediction)