diff --git a/Prosumer/scripts/time_series_processing.py b/Prosumer/scripts/time_series_processing.py index 0b148087bd68e63fcbb770d2cdcb5b1f2c6b3c5b..32c63865a450b2cf5958cb5170a2f62d50d1a98d 100644 --- a/Prosumer/scripts/time_series_processing.py +++ b/Prosumer/scripts/time_series_processing.py @@ -135,19 +135,44 @@ def generate_profile(t_start, t_step, t_horizon, prediction='Perfect', **kwargs) elif profile == 'generate_therm_demand_tek': bld_typ = kwargs[profile][0] total_demand = kwargs[profile][1] - weather = kwargs[profile][2] + weather = kwargs[profile][2]['temperature'].values 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) + demands = tek.gen_heat_profile(building_typ=bld_typ, + temperature_profile=weather, + year=year, + yearly_demand=total_demand) + + profile_date = pd.date_range(start=str(year)+"0101", periods=8760, + freq='H') + demands = pd.Series(demands, index=profile_date) + + predictors['therm_demand'] = PredictionGenerator(demands, + method=prediction) + input_profiles['therm_demand'] = predictors['therm_demand'].predict( + str(t_step) + 'H', + t_start, + t_horizon / t_step) elif profile == 'generate_water_demand_tek': bld_typ = kwargs[profile][0] total_demand = kwargs[profile][1] year = int(pd.Timestamp(t_start).year) - input_profiles['hot_water_demand'] = tek.gen_hot_water_profile( + # input_profiles['hot_water_demand'] = tek.gen_hot_water_profile( + # building_typ=bld_typ, year=year, yearly_demand=total_demand) + + demands = tek.gen_hot_water_profile( building_typ=bld_typ, year=year, yearly_demand=total_demand) + profile_date = pd.date_range(start=str(year) + "0101", periods=8760, + freq='H') + demands = pd.Series(demands, index=profile_date) + + predictors['hot_water_demand'] = PredictionGenerator(demands, + method=prediction) + input_profiles['hot_water_demand'] = predictors['hot_water_demand'].predict( + str(t_step) + 'H', + t_start, + t_horizon / t_step) else: # apply prediction methods upon other input profiles (air_temp, irradiance, etc.) predictors[profile] = PredictionGenerator(kwargs[profile], method=prediction)