Skip to content

Commit

Permalink
added correct leaving time distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Paytonco committed Jan 30, 2022
1 parent 1ca842c commit 4d00cd8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions evac_percent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
e2 = [22712, 34864, 17599, 6119, 13332, 13400, 4636, 17850]
e3 = [76165, 115761, 57483, 20105, 43531, 44517, 15493, 58874]

e1 = np.array(e1)
e1perc = e1/sum(e1)
e4 = [76165, 57880.5, 57880.5, 38794, 38794, 22012, 22012, 22012, 22012, 15493, 58874]

newlist = np.zeros(e1perc.shape)
for i in range(len(e1perc)):
newlist[i] = sum(e1perc[0:i+1])
e4 = np.array(e4)
e4perc = e4/sum(e4)

newlist = np.zeros(e4perc.shape)
for i in range(len(e4perc)):
newlist[i] = sum(e4perc[0:i+1])

print(e1perc)

print(e4perc)
print(newlist)

3 changes: 2 additions & 1 deletion evacsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def isempty(self):

class neighborhood:
#Rate people leave, in fraction per timestep.
leavingrates = [.10, .2, .3, .2, .15, .05]
leavingrates = [0.175458, 0.260899, 0.135025, 0.0476705, 0.10025, 0.10624, 0.0339434, 0.140516]


def __init__(self, numpeople, out):
self._numpeopleleft = numpeople
Expand Down
Binary file added figures/neighborhoods.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d00cd8

Please sign in to comment.