-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into geo_messaging
- Loading branch information
Showing
12 changed files
with
1,213 additions
and
9 deletions.
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This model evenly weights the probability of movement to all other nodes. | ||
# It uses parameter 'commuter_proportion' to determine how many people should | ||
# be moving, based on the total normal population of each node. | ||
|
||
[move-steps: per-day=2; duration=[1/3, 2/3]] | ||
|
||
[predef: function= | ||
def flat_predef(): | ||
ones = np.ones((dim.nodes, dim.nodes)) | ||
np.fill_diagonal(ones, 0) | ||
dispersal_kernel = row_normalize(ones) | ||
return { 'dispersal_kernel': dispersal_kernel } | ||
] | ||
|
||
# Assume a percentage of the population move around, | ||
# evenly weighted to all other locations. | ||
[mtype: days=all; leave=1; duration=0d; return=2; function= | ||
def flat_movement(t): | ||
n_commuters = np.floor(geo['population'] * params['commuter_proportion']).astype(SimDType) | ||
return np.multinomial(n_commuters, predef['dispersal_kernel']) | ||
] |
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
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
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
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
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