ojwatson / magenta Goto Github PK
View Code? Open in Web Editor NEWMalaria Genomic Transmission Model
Home Page: https://ojwatson.github.io/magenta/index.html
License: Other
Malaria Genomic Transmission Model
Home Page: https://ojwatson.github.io/magenta/index.html
License: Other
Just generating a simple reprex for profiling magenta
against malariasimulation
library(malariasimulation)
library(magenta)
library(tictoc)
EIR <- 50
ft <- 0.5
N <- 500000
timesteps = 30
# malariasimulation should have individual mosquiotes on for fair comparison
params <- malariasimulation::get_parameters(overrides = list("human_population" = N, "individual_mosquitoes" = TRUE)) |>
malariasimulation::set_equilibrium(init_EIR = EIR)
# set the mosquito limit the same so not populating unnecessary of mosquitoes
params$mosquito_limit <- params$total_M
#Update parameter set with chosen drug-specific parameters (AL)
drug_params <- malariasimulation::set_drugs(params, list(AL_params))
# Set treatment program for AL (drug index = 1)
treatment_params <- malariasimulation::set_clinical_treatment(
parameters = drug_params,
drug = 1,
timesteps = c(0), # Treatment coverage at day 0 = ft
coverages = c(ft))
# Use set_equilibrium to update the parameter set for a given initial EIR
treatment_params <- malariasimulation::set_equilibrium(treatment_params, EIR)
tictoc::tic()
test_sim_eq <- malariasimulation::run_simulation(timesteps = timesteps, parameters = treatment_params)
tictoc::toc()
#> 80.06 sec elapsed
# here we compare against magenta, with update_save on (rendering) and update_length set to 1 (to render every day)
tictoc::tic()
test_simmag <- magenta::pipeline(EIR = EIR, ft = ft, N = N, update_save = TRUE, update_length = 1, years = timesteps/365)
#> Seed set to 222651067
#> magenta v1.3.5
#> Starting Stochastic Simulation for 0.0821917808219178 years
tictoc::toc()
#> 45.777 sec elapsed
Created on 2024-07-10 with reprex v2.0.2
At the moment only a few model parameters are passed to c++.
Everything in model_param_list_create
should be able to be passed in and checked for existence. Make this into a new C++ file to no clutter simulation_init
.
make the get and the saved_init work with most recent extra parameters etc added.
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.