Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion epymorph/data/mm/centroids.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def dispersal_kernel(self) -> NDArray[np.float64]:
centroid = self.data("centroid")
phi = self.data("phi")
distance = pairwise_haversine(centroid)
return row_normalize(1 / np.exp(distance / phi))
prob = np.exp(-np.clip(distance / phi, a_min=None, a_max=100.0))
return row_normalize(prob)

def evaluate(self, tick: Tick) -> NDArray[np.int64]:
pop = self.data("population")
Expand Down
Loading