-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.py
More file actions
24 lines (21 loc) · 1.02 KB
/
agent.py
File metadata and controls
24 lines (21 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class Agent:
def __init__(self, status, location, days_with_status=0, vaccinated=False, vaccine_efficacy=0, days_since_vaccination=0, targetable=True, immunodeficient=False):
self.status = status
self.location = location
self.days_with_status = days_with_status
self.vaccinated = vaccinated
self.vaccine_efficacy = vaccine_efficacy
self.days_since_vaccination = days_since_vaccination
self.targetable = targetable
self.immunodeficient = immunodeficient
def reset_days_with_status(self):
self.days_with_status = 0
def increase_days_with_status(self):
self.days_with_status += 1
if self.vaccinated:
self.days_since_vaccination += 1
self.update_vaccine_efficacy()
def update_vaccine_efficacy(self):
# Update vaccine efficacy based on time since vaccination
if self.days_since_vaccination > 180:
self.vaccine_efficacy *= 0.98 # after one year, the efficacy is 0.95 * 0.98**185 = 2.26%