Created
March 22, 2022 22:30
-
-
Save phargogh/9e8d35c0533352aabe64e09ea1ed1159 to your computer and use it in GitHub Desktop.
Trying out decay types for my updated version of HRA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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