Randomize Time
Goal
Write randomize
rule logic to
- Takes the original values of the type time, and adds random noise
- Specify the random noise by using the
offset
andflat-noise
parameters (percentage-noise
excluded)
Ano Structure and Example
- Structure
- Update Example
...
randomize <column> <rule-name>
type time
format %tT
convert String2Time
offset <offset>
flat-noise <flat-noise>
...
table BOOKING
...
column time EARLIESTCHECKINTIME
...
...
task ... {
update BOOKING
randomize EARLIESTCHECKINTIME
type time
format %tT
convert String2Time
offset 10.0
flat-noise 10.0
...
}
- type:
time
- format:
%tT
- time format - convert: String2Time - a built-in conversion function.
- offset: A fixed (double) value, in seconds, that is added to the original value.
- flat-noise: A fixed noise value, in seconds, that is multiplied with the random number r
- large flat-noise - larger spread of generated values
Noise Formula
- A random number r is drawn (at runtime) from the Standard Normal (Gaussian) Distribution Function
- We use r, together with given noise parameters to add noise to the original value
Noise formula for time
original_value + offset + (flat-noise * r)