Created
January 26, 2018 04:45
-
-
Save JoseRFJuniorLLMs/0895e98bd20ab53fd8b1a20e99ea7c77 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python3 | |
#Rossmo's formula | |
import math | |
crimes=[(5,4), (6,3), (5,3), (7,3)] | |
phi=5 | |
f, g= 2, 2 | |
b=3 | |
a=0 | |
for j in range(10): | |
for i in range(10): | |
for crime in crimes: | |
equation= 0 | |
distance= (i-crime[0])+(j-crime[1]) | |
equation+= (phi/math.pow(distance, f)) | |
numerator= (1-phi)*math.pow(b, 8-f) | |
denominator= math.pow(2*b-distance, g) | |
equation+= (numerator/denominator) | |
a+=equation | |
print(i,',', j,': ', a) | |
a=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment