From 7cd98b4250c225fb27c4fcf8fea31308ee40073c Mon Sep 17 00:00:00 2001 From: Johann Kraft Date: Thu, 29 Feb 2024 13:22:30 +0100 Subject: [PATCH] Fix issue 114. Skip app if func_time or rand_time==0 --- ramp/core/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ramp/core/core.py b/ramp/core/core.py index e21047b2..3f08ec14 100644 --- a/ramp/core/core.py +++ b/ramp/core/core.py @@ -1799,6 +1799,8 @@ def generate_load_profile(self, prof_i, peak_time_range, day_type, power): or (self.pref_index != 0 and self.user.rand_daily_pref != self.pref_index) # checks if the app is allowed in the given yearly behaviour pattern or self.wd_we_type not in [day_type, 2] + # check if the app has a func_time of 0 (fix issue 114) + or self.func_time == 0 ): return @@ -1845,7 +1847,7 @@ def generate_load_profile(self, prof_i, peak_time_range, day_type, power): ] tot_time = 0 - while tot_time <= rand_time: + while tot_time <= rand_time and rand_time!=0: # Check if rand_time is 0 (-> fix issue 114) # one option could be to generate a lot of them at once indexes = self.rand_switch_on_window( rand_time=rand_time, # TODO maybe only consider rand_time-tot_time ...