This page explains the calculation methods of the Scaling 8.0 operator. The calculation method for an operation is set by the parameter "Calculation method" of the operator.
A calculation method determines
- whether a data interval is allocated to a scale interval (incrementing the value of the "Result" or "CNT_" fields of the result table), and
- the values in the "Value" columns of the result table based on the "Value" columns in the input table.
A data interval and a scale interval can overlap. In particular, the data interval can start or end in, or completely overlap a scale interval (see introduction of Scaling 8.0 for examples). The decision of whether a data interval is allocated to a scale interval depends on this relation. Depending on the calculation method, it can happen that a data interval is allocated to zero, one, or many scale intervals and vice versa.
If a data interval is allocated to a scale interval, then the data interval's values can influence the scale interval's values in different ways. For example, the values of the scale interval can be the sums of the values of the data intervals allocated to the scale interval . Other methods consider the percentage to which one interval overlaps the other.
The calculation methods can be divided in two categories: Methods, that focus on (1.) the allocation condition for a data interval to a scale interval, and methods, that focus on (2.) the calculation of the values. Methods of the former category calculate the values in the same way and methods of the latter category have the same allocation condition (TODO stimmt das?).
The next section gives an intuitive overview on the different calculation methods with respect to the allocation of data intervals and the determination of the values in a scale interval. It is followed by a section defining the methods in a more formal way.
Intuitive overview
The following table gives an intuitive overview over the currently implemented calculation methods and some possible extensions.
In the table, we abbreviate the data interval by d
and the scale interval by s
. The first nine methods differ in their allocation condition. The other methods all allocate a data interval to a scale interval if they overlap. These methods differ in the calculation of the values.
Name in version 7.0 | Proposed name for version 8.0 | d is allocated to s if... | d allocated to s ? | d can be allocated to how many s ? | Formal condition for (if and only if) | ||||
---|---|---|---|---|---|---|---|---|---|
( | ( | (s overlaps 100% of d) | ( | ||||||
50% in scale | 50% of scale interval in data interval | d overlaps at least 50% of s or s overlaps 100% of d | (note solid red line) | ( | (note solid red line) | Zero, one, or many | overlap (s ,d ) / s_{length} >= 0.5 or s_{start} <= d_{start} ,d_{end} <= s_{end} | ||
100% in scale | 100% of scale interval in data interval | d overlaps 100% of s | - | - | - | Zero, one, or many | d_{start} <= s_{start} ,s_{end} <= d_{end} | ||
New, see FLEX-349 | 50% of data interval in scale interval | s overlaps at least 50% of d , allocation to earlier scale interval in case of a tie | n/a | - (tie, allocation of | n/a | n/a | Zero or one | overlap (s ,d ) / d_{length} >= 0.5 | |
Possible addition related to FLEX-349 | 100% of data interval in scale interval | s overlaps 100% of d | - | - | - | Zero or one | |||
Possible addition | Largest part of data interval in scale interval | s overlaps largest part of d , allocation to earliest scale interval in case of a tie | - (tie, allocation of | Exactly one | |||||
Start time in scale | Start time in scale interval or overlaps 100% of scale interval | d starts in s or d overlaps 100% of s | - | At least one | s_{start} <= d_{start} < s_{end } or d_{start} <= s_{start} ,s_{end} <= d_{end} | ||||
End time in scale | End time in scale interval or overlaps 100% of scale interval | d ends in s or d overlaps 100% of s | - | At least one | s_{start} < d_{end} <= s_{end} or d_{start} <= s_{start} ,s_{end} <= d_{end} | ||||
Count start time only | Start time in scale interval | d starts in s | - | - | Exactly one | s_{start} <= d_{start} < s_{end} | |||
Count final time only | End time in scale interval | d ends in s | - | - | Exactly one | s_{start} < d_{end} <= s_{end} | |||
Proportional time*value | Value proportional to data in scale | d overlaps s | At least one | overlap (s ,d ) > 0 | |||||
Proportional value | Overlap in hours | d overlaps s | At least one | overlap (s ,d ) > 0 | |||||
Distribute value in pattern | ? | d overlaps s | At least one | overlap (s ,d ) > 0 | |||||
Smallest value in the pattern | Smallest value of allocated data | d overlaps s | At least one | overlap (s ,d ) > 0 | |||||
Largest value in pattern | Largest value of allocated data | d overlaps s | At least one | overlap (s ,d ) > 0 |
Name in version 7.0 | Condition for d to be allocated to s | Calculation of s_{val} depending on d_{val} of all allocated d 's | Notable error behaviour |
---|---|---|---|
50% in scale | If and only if overlap (s ,d ) / s_{length} >= 0.5 or s_{start} <= d_{start} ,d_{end} <= s_{end} | s_{val}^{i }= If parameter "Count" is not set, then these columns are omitted. | |
100 % in scale | If and only if d_{start} <= s_{start} ,s_{end} <= d_{end} | As in option "50% in scale" | |
Start time in scale | If and only if | As in option "50% in scale" | |
End time in scale | If and only if s_{start} <= dend < s_{end} or d_{start} <= s_{start} ,s_{end} <= d_{end} | As in option "50% in scale" | |
Count start time only | If and only if s_{start} <= d_{start} < s_{end} | As in option "50% in scale" | |
Count final time only | If and only if s_{start} <= d_{end} < s_{end} | As in option "50% in scale" | |
Proportional time*value | If and only if overlap (s ,d ) > 0 | s_{val}^{i }= overlap(s,d)/s_{length} * d_{val}^{i} for all indices i of s_{val} | Error if no value column defined |
Proportional value | If and only if overlap (s ,d ) > 0 | s_{val}^{i }= overlap(s,d)/d_{length} * d_{val}^{i} for all indices i of s_{val} | Error if no value column defined |
Distribute value in pattern | If and only if overlap (s ,d ) > 0 | Like "Proportional value"?? | Error if no value column defined |
Smallest value in the pattern | If and only if overlap (s ,d ) > 0 | If no value column defined, then input table is returned with additional "Result" and "CNT_" columns | |
Largest value in pattern | If and only if overlap (s ,d ) > 0 | If no value column defined, then input table is returned with additional "Result" and "CNT_" columns | |
Hours to staffing | |||
Staffing to hours | |||
Maximum duration of the data row | If and only if overlap (s ,d ) > 0 | s_{val}^{i }= d_{val}^{i} for all indices i of s_{val} |