You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As reported by @DanielaRichter based on a specific use case:
dt should not be based on the time between the server status change (aka “now”) and the time of the last change, but between now and the time of the next change. When a server changes to “1”, the “busy time” is from now on until it is changed again.
This is true if, and only if, keeping the alignment between time (now) and dt is required. However, it must be noted that 1) time is not used after setting dt, and 2) dplyr::lag is used when in_use is calculated. Therefore, it doesn't change the final result, but it may make sense to use dplyr::lead just to get rid of subsequent calls to dplyr::lag.
Arrivals in a batch lead to problems when calculating dt. Therefore, when multiple arrivals arrive at the same time, i.e. time - lag(time) == 0, the duration for the second sample was always based on the “sibling” arrival before and not on the last timepoint -> resulting in a duration = 0. Thus, whenever I encountered this problem, I copied the duration of the “sibling” before.
Batches shouldn't lead to problems, because the first n-1 arrivals from a batch get a dt=0, so their contribution to in_use (and thus to utilization) is null. In fact, introducing dplyr::filter(!duplicated(time, fromLast=TRUE)) to remove duplicates has no effect in the result.
I realized that I got durations counted when the capacity of the resource was 0: thus I multiplied the duration with a 0/1 capacity helper variable. (actually that was one of the first things I did. It might be obsolete due to some other changes).
This makes sense: if the resource is closed (aka capacity=0), utilization is not defined. This time shouldn't count for its calculation. This is an easy fix.
The text was updated successfully, but these errors were encountered:
@DanielaRichter Please, feel free to keep discussing this, here or over email. I'll give this a few days, and if no further issues are found, I plan to send a new release to CRAN.
As reported by @DanielaRichter based on a specific use case:
This is true if, and only if, keeping the alignment between
time
(now) anddt
is required. However, it must be noted that 1)time
is not used after settingdt
, and 2)dplyr::lag
is used whenin_use
is calculated. Therefore, it doesn't change the final result, but it may make sense to usedplyr::lead
just to get rid of subsequent calls todplyr::lag
.Batches shouldn't lead to problems, because the first
n-1
arrivals from a batch get adt=0
, so their contribution toin_use
(and thus toutilization
) is null. In fact, introducingdplyr::filter(!duplicated(time, fromLast=TRUE))
to remove duplicates has no effect in the result.This makes sense: if the resource is closed (aka
capacity=0
),utilization
is not defined. This time shouldn't count for its calculation. This is an easy fix.The text was updated successfully, but these errors were encountered: