Giter Club home page Giter Club logo

asfvmodel's Introduction

ASFVModel

Numba accelerated and multiprocess simulation of propagation of the African Swine Fever Virus using Gillespie Algorithm [1] implemented in the same way as this project.

This model is a replication of the model explained in [2] with a few differences:

  • Correction of an error in the original paper: the correct transition rate for exposed pigs is Beta * S * (I + epsilon * C) / N instead of Beta * S * (I + epsilon * C) , with N the total of live pigs.
  • No modelling of a vaccination plan for ASFV, only biosecurity measures are taken into account.
  • Emphasis on the speed of the implementation to be able to run the model on a larger population (tens of thousands of pigs instead of 500) within a reasonnable amount of time.

Implementation

To run the model on a larger scale while maintaining a reasonnable runtime, a few keypoints were necessary.

Firstly, Numba is used to accelerate the gillespie_direct() and the propensity() function. This step alone allows the model to run 10 times faster than a normal python implementation.

Secondly, in order to exploit a multicore processor, a multiprocessed approach was used. The workload was divided and fed to the available cores. The result is stored in shared memory for the main process to use. Due to the overhead of creating processes, this approach is especially useful when a large number of simulations on a big population are computed. Indeed for 100 simulations on a population of 100000 pigs, the multiprocessed approach runs 2 times faster the the single process approach whereas 1000 simulations on the same population is 3 times faster with the multiprocessed approach. The CPU used was a quadcore i5.

The amount of data can become quite large and thus saturate the RAM available, thus the results are subsampled to feed matplotlib and create the graphs.

Results

Results of the simulation on a population of 100000 pigs. Orange curves: stochastic simulations. Black curve: ODE resolution. Blue line: Day of implementation of bio-security measures.

References

[1] Exact stochastic simulation of coupled chemical reactions : https://pubs.acs.org/doi/abs/10.1021/j100540a008

[2] A Mathematical Model that Simulates Control Options for African Swine Fever Virus (ASFV) : https://doi.org/10.1371/journal.pone.0158658

Authors

Guillaume Demaude

Ninon Lavignasse

asfvmodel's People

Contributors

gdemaude avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.