Skip to content
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

COVID-19 Related Updates #931

Merged
merged 25 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
096e180
WIP: Starting work on COVID Vaccines. Documentation and data.
eedrummer Jun 25, 2021
c82a3a2
WIP: Implementing C19 vaccinations through first dose. Not tested.
eedrummer Jul 1, 2021
5419a4f
WIP: Fixing javadoc errors and adding some notes for future me.
eedrummer Jul 1, 2021
b43174c
WIP: Finishing initial implemention of C19 vaccination. No testing yet.
eedrummer Jul 23, 2021
8f377c0
WIP: Adding script to update dose information from the CDC API. Start…
eedrummer Jul 27, 2021
b0d073d
WIP: Most of the vaccination working. Updating case count data.
eedrummer Aug 3, 2021
d0978cb
WIP: Updating module flow so vaccinated people 100x less likely to ge…
eedrummer Aug 10, 2021
f2469d7
Fixing issues where everyone would get their shot right away
eedrummer Aug 25, 2021
19a7c24
Checkstyle clean up on the main code.
eedrummer Aug 26, 2021
b0abcbc
Fixed incorrect comparison when deciding on shot
eedrummer Aug 30, 2021
ab560f0
Unit testing
eedrummer Aug 31, 2021
772488b
Updating COVID data and documenting case count update script
eedrummer Aug 31, 2021
b0cb446
Fix infinite COVID-19
eedrummer Sep 10, 2021
37b4966
Updating case count data and adjusting probabilities
eedrummer Sep 10, 2021
4da5fda
Removing python script as its functionality has now been replaced.
eedrummer Sep 14, 2021
9c823fe
Adding the attribute inventory for COVID-19 module
eedrummer Sep 14, 2021
282afcc
Changes in response to PR comments
eedrummer Sep 14, 2021
7818efd
Checkstyle fixes
eedrummer Sep 14, 2021
6778106
Old test was resetting the wrong property name
eedrummer Sep 14, 2021
b79c561
Yet another fix for the test resetting the property
eedrummer Sep 14, 2021
9d727f9
One more time, with feeling.
eedrummer Sep 14, 2021
01a9889
Updating COVID-19 related data
eedrummer Sep 15, 2021
2db0654
Fixing visibility in response to PR comments
eedrummer Sep 15, 2021
a718211
Thread safe enumerated distros and fixes fo vax encounters
eedrummer Sep 15, 2021
86de12d
Fixing broken link tag in JavaDoc.
eedrummer Sep 15, 2021
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
2 changes: 2 additions & 0 deletions src/main/java/org/mitre/synthea/engine/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.mitre.synthea.modules.LifecycleModule;
import org.mitre.synthea.modules.QualityOfLifeModule;
import org.mitre.synthea.modules.WeightLossModule;
import org.mitre.synthea.modules.covid.C19ImmunizationModule;
import org.mitre.synthea.world.agents.Person;

/**
Expand Down Expand Up @@ -72,6 +73,7 @@ private static Map<String, ModuleSupplier> loadModules() {
retVal.put("Cardiovascular Disease", new ModuleSupplier(new CardiovascularDiseaseModule()));
retVal.put("Quality Of Life", new ModuleSupplier(new QualityOfLifeModule()));
retVal.put("Weight Loss", new ModuleSupplier(new WeightLossModule()));
retVal.put("COVID-19 Immunization Module", new ModuleSupplier(new C19ImmunizationModule()));

Properties moduleOverrides = getModuleOverrides();

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/mitre/synthea/helpers/Attributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.mitre.synthea.modules.Immunizations;
import org.mitre.synthea.modules.LifecycleModule;
import org.mitre.synthea.modules.QualityOfLifeModule;
import org.mitre.synthea.modules.covid.C19ImmunizationModule;
import org.mitre.synthea.world.agents.Person;

/**
Expand Down Expand Up @@ -149,6 +150,7 @@ public static Map<String,Inventory> getAttributeInventory() throws Exception {
Immunizations.inventoryAttributes(attributes);
LifecycleModule.inventoryAttributes(attributes);
QualityOfLifeModule.inventoryAttributes(attributes);
C19ImmunizationModule.inventoryAttributes(attributes);

return attributes;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.mitre.synthea.helpers;

import java.util.List;

import org.apache.commons.math3.distribution.EnumeratedDistribution;
import org.apache.commons.math3.exception.MathArithmeticException;
import org.apache.commons.math3.exception.NotANumberException;
import org.apache.commons.math3.exception.NotFiniteNumberException;
import org.apache.commons.math3.exception.NotPositiveException;
import org.apache.commons.math3.util.Pair;
import org.mitre.synthea.world.agents.Person;

/**
* Class that wraps EnumeratedDistribution for thread safe use in Synthea. In several places in
* Synthea, EnumeratedDistributions are used following a
* <a href="https://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>. One distribution
* is used in a particular aspect of simulation. To support reproducibility of simulations, its
* source of randomness is reseeded for each individual. Since multiple threads may be accessing
* the distribution at the same time, it would be possible to reseed the distribution in one thread
* but sample on that seed in another thread. This class offers a synchronized method to prevent
* that with the handy side benefit that it takes the well-known and loved Synthea Person as a
* source of randomness.
* @param <T> The type to be returned when sampling from the distribiution.
*/
public class SyncedEnumeratedDistro<T> extends EnumeratedDistribution {
/**
* Just calls super. Look at the docs for EnumeratedDistributed for more details.
* @param pmf List of pairs of values and their weight in the distribution.
*/
public SyncedEnumeratedDistro(List<Pair<T, Double>> pmf) throws NotPositiveException,
MathArithmeticException, NotFiniteNumberException, NotANumberException {
super(pmf);
}

/**
* Sample from the distribution after it has been reseeded using the Person provided as a source
* of randomness.
* @param person Where the randomness comes from
* @return a value from the distribution based on a weighted, random selection
*/
public synchronized T syncedReseededSample(Person person) {
reseedRandomGenerator(person.randLong());
return (T) sample();
}
}
Loading