Skip to content

Instantly share code, notes, and snippets.

@phargogh
Created March 22, 2022 22:30
Show Gist options
  • Select an option

  • Save phargogh/9e8d35c0533352aabe64e09ea1ed1159 to your computer and use it in GitHub Desktop.

Select an option

Save phargogh/9e8d35c0533352aabe64e09ea1ed1159 to your computer and use it in GitHub Desktop.
Trying out decay types for my updated version of HRA
import matplotlib.pyplot as plt
import numpy
BUFFER_DIST = 500
DISTANCE = numpy.arange(BUFFER_DIST+100)
NONE = (DISTANCE < BUFFER_DIST)
LINEAR = numpy.maximum(1 - (DISTANCE / BUFFER_DIST), 0)
EXPONENTIAL = numpy.exp(-DISTANCE / BUFFER_DIST) * NONE
OLD_HRA_EXPONENTIAL = (1 - numpy.exp((numpy.log(1e-6) / DISTANCE))) * NONE
plt.plot(LINEAR, label='linear')
#plt.plot(EXPONENTIAL, label='exp')
plt.plot(OLD_HRA_EXPONENTIAL, label='exponential')
plt.plot(NONE, label='none')
plt.legend()
plt.title('Decay types over 500m buffer distance')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment