averbraeck / medlabs

Agent-Based Simulation for Disease Spread in Cities and Regions
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Make a default implementation for DiseaseMonitor.reportInfection(...) #4

Closed averbraeck closed 6 months ago

averbraeck commented 6 months ago

Following on issue #3 to calculate the offspring, the DiseaseMonitor class can make a default implementation of reporting the offspring into a csv-file.

averbraeck commented 6 months ago

Columns can be as follows (initial idea -- can be refined later):

averbraeck commented 6 months ago

A file that aggregates this data per day could have the following columns:

Note: to calculate this, we should also report the persons without offspring. This has to be added to the disease transmission model: who leaves a location and did not infect anyone else in that location?

averbraeck commented 6 months ago

The infections file has been created:

"Time(h)","infectiousPersonId","infectiousPersonType","infectiousPersonAge","infectiousPersonGender","infectiousPersonDiseasePhase","infectedPersonId","infectedPersonType","infectedPersonAge","infectedPersonGender","locationId","locationType"
60.444076028956566,46514,"Pensioner",65,"M","Exposed",32051,"Pensioner",66,"M",139745,"Recreation"
60.71664105122261,527906,"PrimarySchoolStudent",6,"F","Exposed",525016,"PrimarySchoolStudent",9,"F",142226,"PrimarySchool"
60.838599157765955,404599,"PrimarySchoolStudent",4,"F","Exposed",350279,"PrimarySchoolStudent",7,"M",139595,"PrimarySchool"
60.838599157765955,404599,"PrimarySchoolStudent",4,"F","Exposed",388190,"PrimarySchoolStudent",6,"F",139595,"PrimarySchool"
61.14347061106971,118774,"SecondarySchoolStudent",12,"M","Exposed",139344,"SecondarySchoolStudent",16,"F",139625,"SecondarySchool"
61.442541274586766,282306,"SecondarySchoolStudent",16,"M","Exposed",226239,"SecondarySchoolStudent",12,"F",140858,"SecondarySchool"
61.48033232130378,64135,"PrimarySchoolStudent",8,"F","Exposed",100529,"PrimarySchoolStudent",5,"M",138459,"PrimarySchool"
61.625075913907246,46514,"Pensioner",65,"M","Infected-Asymptomatic",34533,"Pensioner",66,"M",139745,"Recreation"
62.50803350889705,374221,"Pensioner",71,"F","Exposed",373986,"Pensioner",65,"F",138472,"Recreation"
62.62614319149331,167310,"Worker",24,"F","Exposed",263711,"Worker",33,"M",96048,"Workplace"
63.09356036206421,231081,"WeekendWorker",31,"F","Exposed",227005,"Worker",33,"M",140924,"Supermarket"
63.18320706041287,167836,"Worker",20,"F","Exposed",172827,"Worker",23,"M",141542,"Supermarket"
63.40728046750814,346014,"EssentialWorker",46,"M","Exposed",116718,"Worker",49,"F",140182,"Supermarket"
63.659083388332505,508093,"Worker",59,"M","Exposed",511468,"Worker",46,"F",141724,"Supermarket"
63.70594596185697,218450,"Worker",35,"M","Exposed",220632,"Worker",17,"M",138440,"Supermarket"
63.75978287406785,508093,"Worker",59,"M","Exposed",511031,"Worker",49,"F",141724,"Supermarket"
63.79863439810504,192182,"Worker",39,"F","Exposed",190135,"Worker",53,"M",137844,"Supermarket"
averbraeck commented 6 months ago

The offspring file has been created:

"Time(h)","infectiousPersonId","infectiousPersonType","infectiousPersonAge","infectiousPersonGender","infectiousPersonDiseasePhase","locationType","nrInfectedPersons"
24.0,553274,"PrimarySchoolStudent",6,"F","Exposed","None",0
24.0,552077,"WeekendWorker",17,"M","Exposed","None",0
24.0,532209,"Pensioner",69,"M","Exposed","None",0
24.0,528719,"SecondarySchoolStudent",16,"M","Exposed","None",0
...
96.0,1428,"Worker",59,"M","Infected-Symptomatic","FoodBeverage",6
96.0,11784,"Worker",36,"F","Infected-Symptomatic","Supermarket",10
96.0,13885,"EssentialWorker",24,"M","Infected-Asymptomatic","Police",3
96.0,28729,"Worker",34,"F","Infected-Asymptomatic","FoodBeverage",2
96.0,56011,"PrimarySchoolStudent",9,"F","Infected-Asymptomatic","PrimarySchool",4
96.0,64135,"PrimarySchoolStudent",8,"F","Infected-Asymptomatic","PrimarySchool",4
96.0,70227,"Pensioner",74,"F","Infected-Asymptomatic","Supermarket",1
96.0,82355,"Worker",27,"M","Infected-Asymptomatic","Supermarket",2
96.0,113129,"Pensioner",67,"F","Infected-Symptomatic","Supermarket",1
96.0,118774,"SecondarySchoolStudent",12,"M","Infected-Asymptomatic","SecondarySchool",1
96.0,138035,"Worker",20,"F","Infected-Symptomatic","Workplace",1
96.0,151583,"Worker",47,"F","Infected-Symptomatic","BarRestaurant",3
96.0,166403,"Worker",53,"F","Infected-Asymptomatic","Supermarket",1
96.0,172747,"Worker",19,"F","Infected-Symptomatic","FoodBeverage",1
96.0,172747,"Worker",19,"F","Infected-Symptomatic","Workplace",2
96.0,176353,"UniversityStudent",56,"F","Infected-Asymptomatic","BarRestaurant",2
96.0,192182,"Worker",39,"F","Infected-Symptomatic","Workplace",1
96.0,194396,"Worker",55,"M","Infected-Symptomatic","Supermarket",1
96.0,204926,"Pensioner",90,"F","Infected-Symptomatic","Supermarket",4
96.0,210928,"UniversityStudent",57,"M","Infected-Symptomatic","FoodBeverage",3
96.0,216687,"UniversityStudent",43,"M","Infected-Asymptomatic","FoodBeverage",1
96.0,229912,"Worker",56,"M","Infected-Asymptomatic","Supermarket",1
96.0,231081,"WeekendWorker",31,"F","Infected-Asymptomatic","FoodBeverage",1
96.0,239104,"Worker",49,"M","Infected-Asymptomatic","Supermarket",2
96.0,249273,"Worker",31,"F","Infected-Symptomatic","Workplace",2
96.0,250668,"Worker",45,"F","Infected-Asymptomatic","Pharmacy",2
96.0,271502,"Worker",20,"F","Infected-Symptomatic","FoodBeverage",1
96.0,282306,"SecondarySchoolStudent",16,"M","Infected-Symptomatic","SecondarySchool",1
averbraeck commented 6 months ago

These two lines in the offspring.csv file show that the offspring is detailed per location type:

96.0,172747,"Worker",19,"F","Infected-Symptomatic","FoodBeverage",1
96.0,172747,"Worker",19,"F","Infected-Symptomatic","Workplace",2

This means that this worker infected three persons in day 4 (time 96 hours = end of day 4), one at a food place, and 2 at work. Exposed or infectious persons who did not infect anyone are listed with location type "None" and 0 infected persons at the end of each day as well in the file.

averbraeck commented 6 months ago

Files are written as part of every experiment.