Skip to content

Update simulation.py #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
18 changes: 16 additions & 2 deletions simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def callback(self):
self.population[0][10] = 1


def run(self):
def run(self, simulation_ad):
'''run simulation'''

i = 0
Expand Down Expand Up @@ -200,13 +200,26 @@ def run(self):
print('total infectious: %i' %len(self.population[(self.population[:,6] == 1) |
(self.population[:,6] == 4)]))
print('total unaffected: %i' %len(self.population[self.population[:,6] == 0]))

simulation_ad.runad()


def plot_sir(self, size=(6,3), include_fatalities=False,
title='S-I-R plot of simulation'):
plot_sir(self.Config, self.pop_tracker, size, include_fatalities,
title)

class simulation_():
def __init__(self):
pass
def run_(self):
pass

class adapter:
def __init__(self):
self.simulation_ = simulation_()
def runad(self):
self.simulation_.run_()


if __name__ == '__main__':
Expand Down Expand Up @@ -239,4 +252,5 @@ def plot_sir(self, size=(6,3), include_fatalities=False,
#sim.population_init() #reinitialize population to enforce new roaming bounds

#run, hold CTRL+C in terminal to end scenario early
sim.run()
adapter = adapter()
sim.run(adapter)