diff --git a/Pv_mod/Source.cpp b/Pv_mod/Source.cpp index 3e5c6725943263e04cab595041ef9e4457e3521f..76cd0ff6ea1567a6c643bcd470f4326587fa80de 100644 --- a/Pv_mod/Source.cpp +++ b/Pv_mod/Source.cpp @@ -7,7 +7,7 @@ /// Institut Pasteur /// /// michael.white@pasteur.fr /// /// /// -/// With contributions from Dr Thomas Obadia /// +/// With contributions from Dr Thomas Obadia and Diggory Hardy /// /// /// /// Please feel free to use and modify if you wish. However, /// /// please provide appropriate acknowledgement and get in touch /// @@ -16,44 +16,49 @@ /// /// /// There is a prize of a pint for reporting any serious bugs or /// /// finding something new that results in >20% speed up. /// +/// First prize to this goes to Diggory who achieved >80% speeed up, /// +/// which will earn him 4 pints or his chosen equivalent. /// /// /// +/// Model code is split up into multiple files as follows: /// /// /// -/// The code below is structured as follows: /// +/// 1.1. Source.cpp /// +/// This file /// /// /// -/// 0. SETTING UP STRUCTURES AND CLASSES /// -/// All parameter values are stored in a structure called params. /// -/// A class is created which stores all the information of a /// -/// single individual. /// -/// A structure called population stores all individuals. /// -/// The time-dependent output of the model is stored in a /// -/// structure called simulation. /// +/// 2.1. Params.h /// +/// 2.2. Params.cpp /// +/// The Params structure stores input parameters and has /// +/// associated code for reading parameters from input files. /// /// /// -/// 1. MAIN - SIMULATION /// -/// Here we read in parameters from files (model parameters, /// -/// mosquito parameters, intervention parameters). /// -/// A population of individuals is created at equilibrium and /// -/// then simulated. /// +/// 3.1. Intervention.h /// +/// 3.2. Intervention.cpp /// +/// The Intervention struct stores intervention parameters. /// /// /// -/// 2. FUNCTIONS /// -/// Useful functions needed for model simulations. /// -/// Mosquitoes are simulated using a deterministic ODE solver. /// -/// The functions for simulating a population of individuals are /// -/// provided here - note that the model itself appears in Section 4. /// +/// 4.1. Individual.h /// +/// 4.2 Individual.cpp /// +/// A class is created which stores all the information of a /// +/// single individual. /// +/// Details of the stochastic individual-based model for each /// +/// person. Transitions occur with a fixed time step according to /// +/// compting hazards /// /// /// -/// 3. EQUILIBRIUM SETUP /// -/// This set of functions calculates the equilibrium set up of the /// -/// population. It is only called once while the population is /// -/// being initialised. /// +/// 5.1. Population.h /// +/// 5.2. Population.cpp /// +/// A structure called Population stores all individuals. /// +/// This set of functions calculates the equilibrium set up of the /// +/// population. It is only called once while the population is /// +/// being initialised. /// /// /// -/// 4. INDIVIDUAL-BASED MODEL /// -/// Details of the stochastic individual-based model for each /// -/// person. Transitions occur with a fixed time step according to /// -/// compting hazards /// +/// 6.1. Mosquito.cpp /// +/// Mosquitoes are simulated using a deterministic ODE solver. /// /// /// +/// 7.1. Simulation.h /// +/// 7.2. Simulation.cpp /// +/// Creation of class for storing simulation output, running /// +/// and writing output /// +/// /// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// - #include "Simulation.h" #include <iostream> @@ -62,6 +67,11 @@ #include "randlib.h" +//////////////////////////////////////////// +// // +// 1.1.1. Initiate main object // +// // +//////////////////////////////////////////// int main(int argc, char** argv) { @@ -73,7 +83,7 @@ int main(int argc, char** argv) //////////////////////////////////////////// // // - // 1.1 Read in file names // + // 1.1.2. Read in file names // // // //////////////////////////////////////////// @@ -98,21 +108,20 @@ int main(int argc, char** argv) //////////////////////////////////////////// // // - // 1.2. Initialise objects // + // 1.1.2. Initialise objects // // // //////////////////////////////////////////// Population PNG_pop; Params Pv_mod_par; - - - //////////////////////////////////////////// - // // - // 1.3. Read in model parameters // - // // - //////////////////////////////////////////// + /////////////////////////////////////////////// + // // + // 1.1.3. Read in model parameters // + // and create an intervention object // + // // + /////////////////////////////////////////////// SimTimes times = Pv_mod_par.read(parameter_File, mosquito_File); PNG_pop.N_pop = Pv_mod_par.N_pop; @@ -122,9 +131,9 @@ int main(int argc, char** argv) /////////////////////////////////////////////////////////////////////////// // // - // 1.8. Initialise Population of individuals // - // Note that they begin with exponential age distribution // - // and susceptible without immunity // + // 1.1.4. Initialise Population of individuals // + // Note that they begin with exponential age distribution // + // and susceptible without immunity // // // /////////////////////////////////////////////////////////////////////////// @@ -139,7 +148,7 @@ int main(int argc, char** argv) ///////////////////////////////////////////////////////////////////////// // // - // 1.9. Create simulation object // + // 1.1.5. Create Simulation object // // // ///////////////////////////////////////////////////////////////////////// @@ -148,7 +157,7 @@ int main(int argc, char** argv) ////////////////////////////////////////////////////// // // - // 1.10. Begin stochastic simulations // + // 1.1.6. Begin stochastic simulations // // // ////////////////////////////////////////////////////// @@ -162,7 +171,7 @@ int main(int argc, char** argv) ////////////////////////////////////////////////////// // // - // 1.11. Output to file // + // 1.1.7. Output to file // // // //////////////////////////////////////////////////////