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

Network-based interactions #24

Merged
merged 29 commits into from
Dec 11, 2024
Merged

Network-based interactions #24

merged 29 commits into from
Dec 11, 2024

Conversation

ptheywood
Copy link
Member

@ptheywood ptheywood commented Nov 19, 2024

Implements network-based interactions and other changes/fixes:

  • Implements Random household generation
    • Households are of a randomised size based on model parameters
    • Age demographics within a household are random, to match the target global population age demographics.
    • Note: Demographics within a household may be unrealistic, see Realistic household age-distributions #29.
  • Implements workplaces and workplace interactions
    • Individuals are assigned to a workplace network, based on their age demographic and for adults parameters controlling the adult to non-adult ratios for non-adult workplaces
    • 5 work place categories:
      • Schools for 0-9 year olds, with a target ratio of adults to children
      • Schools for 10-19 year olds, with a target ratio of adults to children
      • General adult (20-69) workplace population
      • Retirement network for 70-79, with a target ratio of adults
      • Elderly network for 80+, with a target ratio of adults
    • Each workplace network is constructed as a Watts-Strogatz small world network, with individuals
      interacting with a subset of their neighbours per day, and networks designed to achieve a target number of interactions based on the network type
  • Random daily interactions
    • Re-generated per day (in serial on the host, so costly)
    • Fixed upper limit defined at compile time due to FLAME GPU 2 limitations on agent varable arrays (they are std::array-like rather than std::vector)
    • Individuals have a target number of daily interactions, sampled from a random distribution based on their age demographic
    • Generation is potentailyl somewhat unrealistic, deferred to Random Network generation Improvements #30
  • Significant increase in model parameters, to allow control of new behaviours
  • Adds optional per-individual file output, controlled by CLI parameter
    • Adds associated simple script showing use of post processing data
  • Identified several bugs in FLAME GPU 2, which have been worked-around for now
    • 1 fixed upstream, 1 fix in review
  • Addresses compatibility with GCC 8
  • Includes refactoring and additional testing
  • Visualisation adjusted to be household centric

Closes #4
Closes #6
Closes #7
Closes #12


Hosuehold-centric Visualisation:

image

Per-individual plotting demonstration for arbitrary model input:

individual_file

Time-series demo plots for arbitrary model input:

timeseries

timeseries-per-demographic

@ptheywood ptheywood force-pushed the initial-network-interactions branch from 0ae4710 to 64bd319 Compare November 25, 2024 17:04
This is useful for double checking household and workplace sizes
The maximum bucket index will need changing in future implementations

Due to flamegpu limitations, the max value will have to be a worst-case value, i.e. the number of individuals rather than the actual number of households

For individual simualtions with some restructuring we could make this the correct value, but for ensembles it would not be possible, as the maximum value is shared for all instances of the ensemble
This will simplify future household genration improvement, improves legibility and adds some tests
@ptheywood ptheywood force-pushed the initial-network-interactions branch from 7f561d7 to 6262e2d Compare November 29, 2024 14:55
- Per day generation of random interactions via host layer function(s)
- Target number per individual generated once at start of simulation, from a normal distribution from model parameters
- Not all target amounts will lead to valid interaction combinations, leading to less actual interactions than intended
- Does not exclude self interactions yet
- Does not exclude repeat interactions on a given day (but this would increase the likelihood of exposure)
- Implemented in serial on the CPU - will not scale well, but GPU implementation non-trivial.
- Possible encountered a FLAME GPU 2 bug / limitation, tobe investigated and reported
- Not implemented binomeal sampling (yet)
- Added CMAKE configuraiton option for the maximum number
- Could improve perf by changing this implementation, to be investigated
- Finishes implementing small world networks and uses the resulting graph for interactions within the workplace
  - Includes several new parameters to influence workplace network generation
  - Now (and in prev commits) 5 workplace networks
- Refactors code, including the graph data structure once again. More refactoring to come.
- Expands test suite
- Switches to agent generation in an init function, but workarounds are required due to bugs in flame gpu 2, of which a PR is already in place to address at least one of.
- Vis adjustments
@ptheywood ptheywood force-pushed the initial-network-interactions branch from ff299c1 to 622fe82 Compare December 11, 2024 09:26
@ptheywood ptheywood changed the title Initial network interactions Network-based interactions Dec 11, 2024
@ptheywood ptheywood marked this pull request as ready for review December 11, 2024 09:48
@ptheywood ptheywood merged commit 4f8bf68 into main Dec 11, 2024
6 checks passed
@ptheywood ptheywood deleted the initial-network-interactions branch December 11, 2024 09:49
@ptheywood ptheywood restored the initial-network-interactions branch December 11, 2024 09:49
@ptheywood ptheywood mentioned this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant