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

Create Spurious symptoms as objects #29

Merged
merged 43 commits into from
Oct 3, 2024
Merged

Conversation

RobertManningSmith
Copy link
Collaborator

This is part 1 of 2 of the new and tested spurious symptoms/ covid testing PR.

Note that the open pull requests 26 and 27 have been included here, hence the massive number of commits included in this.

This pull request introduces the spurious symptom framework as an object which is created for each person at a given rate. Once created this object will show an "exposed" behaviour node for a week and then revert to a "susceptible" behaviour node. From this point, existing nodes can remain dormant (susceptible) or flare up again.

There is now also a spurious symptom testing suit which is now working.

I should have stopped at just creating these spurious symptoms but i have gone on a bit to include covid testing. The covid testing files are probably subject to change and not worth spending to much time on for now.

Fixed a typo in the parameters
Fixed an issue in logging where districts with no one alive would cause an error
Made coronavirus infection objects pass their tests
…gan to create a spatial component to the covidtesting
@RobertManningSmith
Copy link
Collaborator Author

To help with review:

Files that have had a small change:

Pom xml - just changed a build requirement that caused the maven build to fail for java 8

Demography - created and used a ticks per year parameter
Movement behaviour - changed an import
Location - changed an import
CoronavirusBehaviourFramework - changed a name of a variable
Infection - changed an import
Bulkrun - changed the simulation object to have an extra boolean
ImportExport - changed an import
Params: created new parameters (not imported)
Runmosttravelled: changed the simulation object to have an extra boolean
Singlerun: changed the simulation object to have an extra boolean

All testing files except Covid spurious symptom/testing tests: changed simulation object to handle an extra boolean

Files that need a review:

Person: created properties that determine who has symptoms and who should be tested. Also created corresponding getters and setters

CoronavirusSpuriousSymptom: creates the spurious symptom object class

InfectiousBehaviourFramework: attempted to create a way to generalise disease behaviour frameworks. I didn't manage to do this actually so probably best to discuss

SpuriousSymptomBehaviourFramework: creates the behaviours exhibited by the spurious symptom object

CovidSpuriousSymptoms: handles the steppable functions which control the creation and removal of symptoms

CovidTesting: handles the covid testing administration

DiseaseTesting: an interface for general disease testing, implementation didn't seem to be the best, would be good to discuss

Logging: created an output file for covid testing

SpuriousSymptoms: generalised interface for symptoms

WorldBankCovid19Sim: just changes things to handle spurious symptoms and testing

CovidSpuriousSymptomTesting: test suite for covid symptom objects

CovidTestingTesting: test suite for covid testing

Copy link
Collaborator

@swise5 swise5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! A few minor tweaks as discussed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're going to delete this file for parsimony


SpuriousSymptomNodeTitle(String key) { this.key = key; }

static SpuriousSymptomNodeTitle getValue(String x) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commenting in the rest of this file is great - can we extend to this part too?

if (symptom.host.hasSymptomaticCovid()) {
symptom.setBehaviourNode(susceptibleNode);
symptom.getHost().removeCovidSpuriousSymptoms();
return 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we discussed why 1 rather than returning to the weekly check - it's because we don't know when they'll stop having covid and spurious symptoms could start up again as soon as they stop having covid. This is consistent throughout the file!

if (time >= symptom.timeRecovered) {
action = "recover";
}
switch (action) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertManningSmith wanted to convert these to enums

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing object name from Title to Type after conversation

@@ -296,7 +315,7 @@ public void step(SimState arg0) {
}
};
schedule.scheduleRepeating(reporter, this.param_schedule_reporting, params.ticks_per_day);
random = new MersenneTwisterFast(this.seed());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we had a discussion about why this was here twice, and I'm now of the opinion that the second time was unnecessary and doesn't control for what I wanted it to - so no point including it! Good deletion!

@@ -399,6 +397,10 @@ public void load_testing_locations(String testLocationsFilename) {
admin_zones_to_test_in.add(zone_to_test_in);
}
assert (admin_zones_to_test_in.size() > 0): "Number of admin zone to test in not loaded";
for (String location: admin_zones_to_test_in) {
assert (adminZoneNames.contains(location)): "Location to test in not found in model admin zones";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add the name of the offending location for error checking!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertManningSmith has opened an issue to create a folder to hold tests in resources directory (pending @swise5 figuring out what is happening with test/resources folder)

Copy link
Collaborator

@swise5 swise5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@swise5 swise5 merged commit d9f8a6d into main Oct 3, 2024
@swise5 swise5 deleted the redo_testing_from_scratch branch October 3, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants