-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when daily functioning time of an appliance is 0 #114
Comments
Hello @JW-Kraft, thank you for this issue. The solution you propose make sense to me. I think we should throw a warning instead of an error, because of you trick to set the @FLomb @mohammadamint do you see a problem with the proposed solution? A test or two to check that the warning is issued and to make sure the appliance is not used |
A warning makes more sense that an Error that stops the simulation. |
@Bachibouzouk @mohammadamint |
I think you are right, we don't want to issue warnings for each days, but we could issue warning when appliance is created that func_time is 0 and I think this warning would be related to this issue and I would implement it (not the warnings for other strange user inputs) |
This was solved with #116 |
I just noticed this when testing a case in which an appliance can have a functioning time of 0. In my case this happens because I dynamically create
UseCases
based on survey data. Each month is represented by an individualUseCase
to represent seasonality of use.In some months, an appliance is not used at all, which I want to model by giving that appliances a
func_time=0
. I still want to add the appliance to theUseCase
to keep consistent output for every month (I return each appliances load profile individually)If a user defines an
Appliance
time_fraction_random_variability
to be 1, this error might also occur, since the randomized time of use of a appliance for a day could turn out to be 0.The error occurs in the function:
Appliance.generate_load_profile
:while tot_time <= rand_time:
executes the loop, when rand_time of an appliance is 0.self.rand_switch_on_window(rand_time)
then returns an empty array ofindexes
indexes[0], indexes[-1]
whileindexes
is an empty arrayWhy is this a problem?
func_time
is set to 0. One could argue that this shouldn't be done anyway but then we should throw an error already when an appliance is defined. Currently the default value offunc_time
of an appliance is 0.time_fraction_random_variability
is set to 1 because in this case, all of the definedfunc_time
is subject to random variation.An easy solution:
while tot_time <= rand_time and rand_time!=0::
-> this way it does not run whenrand_time=0
and no use of this appliance is trying to be simulated.The text was updated successfully, but these errors were encountered: