Skip to content

Commit

Permalink
Fix issue 114. Skip app if func_time or rand_time==0
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann Kraft committed Feb 29, 2024
1 parent 06d07b7 commit 7cd98b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ramp/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 ...
Expand Down

0 comments on commit 7cd98b4

Please sign in to comment.