djgroen / facs Goto Github PK
View Code? Open in Web Editor NEWFACS: Flu And Coronavirus Simulator
Home Page: https://facs.readthedocs.io
License: BSD 3-Clause "New" or "Revised" License
FACS: Flu And Coronavirus Simulator
Home Page: https://facs.readthedocs.io
License: BSD 3-Clause "New" or "Revised" License
Mutations currently support changes in infection rate, but should contain complete disease definitions.
The infection function should weight between mutations, and select the specific disease properties depending on the disease being spread.
mutations/ strains do not have to remain identical between infection events, as that could add extra bias to the code (we seldom know where mutations are exactly introduced)
Currently hard coded.
Currently, households have members with a completely random age. This can lead to households with only children for example.
We should introduce a method to generate more realistic households.
My suggestion would be to make the first member 18+ by default, and then to change the probability of child / adult generation for the other household members to ensure that the distributed in demographics.csv is fully adhered to.
To do this, we need to probably split the eco.ages structure into two distributions, one for ages 0-17 and one for ages 18+.
Hi Derek,
Here is the output that I get.
fabsim localhost facs_locationplot:klaipeda_localhost_1
[loading plugin] FabDummy ...
[loading plugin] FabCovid19 ...
Error: failed to import settings module ((<class 'SyntaxError'>, SyntaxError('invalid syntax', ('/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/plugins/FabCovid19/VVP/facs_VVP_ensemble_validation.py', 143, 22, ' facs_vvp_sif,\n')), <traceback object at 0x7f59956ff0c0>))
The FabCovid19 ensemble VVP functionalities are not imported as a result.
[Executing task] facs_locationplot
calling task facs_locationplot from plugin FabCovid19
╭───── New/Updated environment variables from FabCovid19 plugin ─────╮
│ env : │
│ --- facs_location : /home/arindam/Dropbox/Brunel/FACS/facs/facs/ │
│ +++ facs_location : /home/arindam/Dropbox/Brunel/FACS/facs │
│ env : │
│ +++ facs_args is a new added key │
│ env : │
│ +++ facs_validation is a new added key │
╰────────────────────────────────────────────────────────────────────╯
calling task locate_results_dir from plugin FabCovid19
╭─ New/Updated environment variables from FabCovid19 plugin ─╮
│ │
╰────────────────────────────────────────────────────────────╯
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1 ['RUNS'] ['klaipeda-extend-lockdown-1.html']
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS ['extend-lockdown-1-0.475_1', 'extend-lockdown-1-0.475_2', 'extend-lockdown-1-0.475_4', 'extend-lockdown-1-0.475_3', 'extend-lockdown-1-0.475_5'] []
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_1 ['covid_data'] ['covid_out_deaths_0.csv', 'env.log', 'covid_out_infections_0.csv', 'covid_out_recoveries_0.csv', 'out.csv', 'offices.csv', 'simsetting.csv', 'env.yml', 'covid_out_hospitalisations_0.csv', 'klaipeda_localhost_1_extend-lockdown-1-0.475_1.sh']
file found at: /home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_1/covid_out_infections_0.csv
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/fabsim/base/decorators.py:127: DtypeWarning: Columns (0,1,2) have mixed types.Specify dtype option on import or set low_memory=False.
return func(*args, **kwargs)
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_1/covid_data [] ['needs.csv', 'measures_uk.yml', 'age-distr.csv', 'vaccinations_example.yml', 'test_cases.csv', 'disease_covid19.yml', 'building_types_map.yml', 'klaipeda_buildings.csv']
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_2 ['covid_data'] ['covid_out_deaths_0.csv', 'env.log', 'covid_out_infections_0.csv', 'covid_out_recoveries_0.csv', 'out.csv', 'offices.csv', 'simsetting.csv', 'env.yml', 'covid_out_hospitalisations_0.csv', 'klaipeda_localhost_1_extend-lockdown-1-0.475_2.sh']
file found at: /home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_2/covid_out_infections_0.csv
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_2/covid_data [] ['needs.csv', 'measures_uk.yml', 'age-distr.csv', 'vaccinations_example.yml', 'test_cases.csv', 'disease_covid19.yml', 'building_types_map.yml', 'klaipeda_buildings.csv']
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_4 ['covid_data'] ['covid_out_deaths_0.csv', 'env.log', 'covid_out_infections_0.csv', 'covid_out_recoveries_0.csv', 'out.csv', 'offices.csv', 'simsetting.csv', 'klaipeda_localhost_1_extend-lockdown-1-0.475_4.sh', 'env.yml', 'covid_out_hospitalisations_0.csv']
file found at: /home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_4/covid_out_infections_0.csv
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_4/covid_data [] ['needs.csv', 'measures_uk.yml', 'age-distr.csv', 'vaccinations_example.yml', 'test_cases.csv', 'disease_covid19.yml', 'building_types_map.yml', 'klaipeda_buildings.csv']
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_3 ['covid_data'] ['covid_out_deaths_0.csv', 'env.log', 'covid_out_infections_0.csv', 'covid_out_recoveries_0.csv', 'out.csv', 'offices.csv', 'simsetting.csv', 'env.yml', 'covid_out_hospitalisations_0.csv', 'klaipeda_localhost_1_extend-lockdown-1-0.475_3.sh']
file found at: /home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_3/covid_out_infections_0.csv
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_3/covid_data [] ['needs.csv', 'measures_uk.yml', 'age-distr.csv', 'vaccinations_example.yml', 'test_cases.csv', 'disease_covid19.yml', 'building_types_map.yml', 'klaipeda_buildings.csv']
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_5 ['covid_data'] ['covid_out_deaths_0.csv', 'env.log', 'covid_out_infections_0.csv', 'covid_out_recoveries_0.csv', 'out.csv', 'offices.csv', 'simsetting.csv', 'env.yml', 'covid_out_hospitalisations_0.csv', 'klaipeda_localhost_1_extend-lockdown-1-0.475_5.sh']
file found at: /home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_5/covid_out_infections_0.csv
/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475_5/covid_data [] ['needs.csv', 'measures_uk.yml', 'age-distr.csv', 'vaccinations_example.yml', 'test_cases.csv', 'disease_covid19.yml', 'building_types_map.yml', 'klaipeda_buildings.csv']
Traceback (most recent call last):
File "/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/fabsim/bin/fabsim", line 46, in
sys.exit(fabsim_main.main())
File "/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/fabsim/base/fabsim_main.py", line 150, in main
env.exec_func(*env.task_args, **env.task_kwargs)
File "/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/fabsim/base/decorators.py", line 74, in wrapper
return func(*args, **kwargs)
File "/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/fabsim/base/decorators.py", line 127, in wrapper
return func(*args, **kwargs)
File "/home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/plugins/FabCovid19/visualisation/PlotByLocationType.py", line 63, in facs_locationplot
for i in range(pdf['time'].min(), pdf['time'].max()):
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/generic.py", line 10827, in min
return NDFrame.min(self, axis, skipna, level, numeric_only, **kwargs)
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/generic.py", line 10350, in min
return self._stat_function(
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/generic.py", line 10345, in _stat_function
return self._reduce(
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/series.py", line 4391, in _reduce
return op(delegate, skipna=skipna, **kwds)
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/nanops.py", line 155, in f
result = alt(values, axis=axis, skipna=skipna, **kwds)
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/nanops.py", line 410, in new_func
result = func(values, axis=axis, skipna=skipna, mask=mask, **kwargs)
File "/home/arindam/.local/lib/python3.8/site-packages/pandas/core/nanops.py", line 1017, in reduction
result = getattr(values, meth)(axis)
File "/home/arindam/.local/lib/python3.8/site-packages/numpy/core/_methods.py", line 44, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
TypeError: '<=' not supported between instances of 'int' and 'str'
This is useful for vis and analysis purposes :).
When household choose parks, shops etc., size should also play a partial role, in addition to distance.
@mzrghorbani I figured this could be a good issue to describe what you are adding or changing to FACS to support measles modelling? We can spin off separate issues here if you need support on the implementation of specific features (or selective disablement of other ones) :).
I am not attaching this to the FACS 2.0 milestone for now.
The individual deaths and recoveries of agents needs to be included in the simulation outputs
fabsim archer2 validate_facs:cores=24
and see what the error is.The additional simulation configurations should be added here: https://github.com/djgroen/FabCovid19/tree/master/config_files/facs_validation/SWEEP
Expose the following constants as runtime parameters in run.py and run_grid.py:
read_building_csv.read_building_csv(e, building_file, "{}/building_types_map.yml".format(data_dir), house_ratio=house_ratio, workspace=20, office_size=2500, household_size=household_size, work_participation_rate=0.5)
Not necessary for STAMINA trial, but desirable on the medium term.
It seems that hospitals are chosen randomly based on only size and is not influenced by distance. Is this intended?
Line 739 in e3b34ee
In this issue, I am going to list all the things we would like to update in FACS this time around:
This is to enable model execution with start point after the initial outbreak of the pandemic as a whole.
Currently, persons go to the nearest medical facility when either visiting or being hospitalised. Sometimes these facilities are rather small, creating asymmetric effects.
My aim is to implement the following:
Imran, what to do you think of this approach?
New mutant variants may have levels of immune evasiveness. Some people immune to one variant may not be immune to other variants.
check that vac_no_symptoms and vac_no_transmission are in range 0.0--1.0.
As a proof of concept, I tried to multiply each of the school areas by a thousand in the region of Kent (and named it test_kent) in FabCovid19 repo. The results did not change qualitatively. This is similar to the result reported by Tasin (@1702609) on Teams when he was working with Turkey.
What could be causing this issue?
When the starting_infections argument has a leading 0, we should read it as a float and use it as a ratio.
As per Maziar's suggestion, we should split off the source code a bit such that facs.py is a bit less overwhelming in size, and the code is easier to navigate for people other than me ;).
Add support for care homes as a location type in FACS.
This is a request to introduce new infections in a specific location or area in FACS.
@arindamsaha1507 before I proceed with designing and implementing this, could you give me a few ideas on how you would like to define this in a run.
E.g. would you like an input Yaml file in a certain format for this? Feel free to propose something :).
Hospitalised people should not propagate infections across their household as much as non-hospitalised people.
Can the blood type be an agent parameter?
Continuation of issue #34
Go through the course and remove unused functions, reduce coupling etc.
Integration of Measles into FACS is a significant step towards enhancing our disease modeling capabilities. This integration will allow us to leverage Measles disease parameters and expand the scope of our simulations.
Goals and Objectives:
Key Steps:
Timeline:
Responsibility:
I'll be overseeing this integration, and I'm open to collaboration. If you have specific expertise or insights to contribute, please feel free to join in.
Feedback and Collaboration:
Your feedback, suggestions, and concerns are invaluable. Let's keep the communication flowing in this thread as we make progress.
Hi Derek,
I have been getting this bug while running the code via FabSim:
RuntimeError:
local() encountered an error (return code 2)while executing 'ssh -Y -p 22 arindam@localhost '/bin/true || true && /home/arindam/Dropbox/Brunel/FACS/FabSim/FabSim3/localhost_exe/FabSim/results/klaipeda_localhost_1/RUNS/extend-lockdown-1-0.475/klaipeda_localhost_1_extend-lockdown-1-0.475.sh''
The exact command I ran was
fabsim localhost covid19_ensemble:cheshire_east,TS='extend-lockdown',TM='1',cores=1,replicas=1,ci_multipliers=0.3,simulation_period=100
I see this bug since the update to the code about 4 days ago.
Line 23 in c9a09b2
The above-mentioned line results in the covid_out files to be written in the current directory. Would it not be better if they are written in the results directory?
Dear Dr Derek Groen,
I am Shakir Bilal working at University of South Florida, In Tampa. Our group has been working on a C++ based ABM simulator and seeks to perform sensistvty analysis using the facs tool that you have developed. I have been working with Dr Arindam Saha while he was here at USF last year.
The current issue is with installing the facs on my machine with python 3.8.10 on Ubuntu. The installation process is stuck with the following two issues:
`
allgatherv.c: In function ‘MPI_Allgatherv’:
allgatherv.c:50:1: internal compiler error: in init_alias_analysis, at alias.c:3468
50 | }
| ^
allgatherv.c:50:1: internal compiler error: Segmentation fault
0x7fba204e408f ???
/build/glibc-wuryBv/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-9/README.Bugs for instructions.
make[2]: *** [Makefile:1876: allgatherv.lo] Error 1
make[2]: Leaving directory '/home/shakir/Downloads/openmpi-4.1.2/ompi/contrib/libompitrace'
make[1]: *** [Makefile:3555: all-recursive] Error 1
make[1]: Leaving directory '/home/shakir/Downloads/openmpi-4.1.2/ompi'
make: *** [Makefile:1901: all-recursive] Error 1
Collecting mpi4py
Using cached mpi4py-3.1.5.tar.gz (2.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mpi4py
Building wheel for mpi4py (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for mpi4py (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [242 lines of output]
'
2)
'
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command '/home/shakir/sfw/MPICH/bin/mpicc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects'
They are long overdue...
Suggestions are welcome here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.