Decay functions¶
A suite of decay functions to simulate demand dropoff as distance increases.
All decay functions operate on one-dimensional numpy arrays.
-
aceso.decay.
gaussian_decay
(distance_array, sigma)[source]¶ Transform a measurement array using a normal (Gaussian) distribution.
Some sample values. Measurements are in multiple of
sigma
; decay value are in fractions of the maximum value:measurement decay value 0.0 1.0 0.7582 0.75 1.0 0.60647 1.17 0.5 2.0 0.13531
-
aceso.decay.
get_decay_function
(name)[source]¶ Return the decay function with the given name.
Parameters: name (str) – The name of the requested decay function.
- Available names:
'uniform'
'raised_cosine'
'gaussian'
'parabolic'
-
aceso.decay.
parabolic_decay
(distance_array, scale)[source]¶ Transform a measurement array using the Epanechnikov (parabolic) kernel.
Some sample values. Measurements are in multiple of
scale
; decay value are in fractions of the maximum value:measurement decay value 0.0 1.0 0.25 0.9375 0.5 0.75 0.75 0.4375 1.0 0.0
-
aceso.decay.
raised_cosine_decay
(distance_array, scale)[source]¶ Transform a measurement array using a raised cosine distribution.
Some sample values. Measurements are in multiple of
scale
; decay value are in fractions of the maximum value:measurement decay value 0.0 1.0 0.25 0.853553 0.5 0.5 0.75 0.146447 1.0 0.0
-
aceso.decay.
uniform_decay
(distance_array, scale)[source]¶ Transform a measurement array using a uniform distribution.
The output is 1 below the scale parameter and 0 above it.
Some sample values. Measurements are in multiple of
scale
; decay value are in fractions of the maximum value:measurement decay value 0.0 1.0 0.25 1.0 0.5 1.0 0.75 1.0 1.0 1.0