E1h.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * @file malaria/Si.cpp
  3. *
  4. * This file is part of VLE, a framework for multi-modeling, simulation
  5. * and analysis of complex dynamical systems
  6. * http://www.vle-project.org
  7. *
  8. * Copyright (c) 2011 INRA http://www.inra.fr
  9. *
  10. * See the AUTHORS or Authors.txt file for copyright owners and contributors
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. /* @@tagdepends: vle.extension.differential-equation @@endtagdepends
  26. @@tagdynamic@@ */
  27. #include <vle/extension/DifferentialEquation.hpp>
  28. #include <iostream>
  29. #include <sstream>
  30. namespace malariaspread {
  31. namespace ved = vle::extension::differential_equation;
  32. class E1h :
  33. public ved::DifferentialEquation
  34. {
  35. public:
  36. E1h(const vle::devs::DynamicsInit& model,
  37. const vle::devs::InitEventList& events) :
  38. ved::DifferentialEquation(model,events)
  39. {
  40. //k_1 = events.getDouble("k_1"); // = ???
  41. //beta_1 = events.getDouble("beta_1"); // = ???
  42. b_1 = events.getDouble("b_1"); // = ???
  43. delta_H1 = events.getDouble("delta_H1"); // = ???
  44. d1_H1 = events.getDouble("d1_H1"); // = ???
  45. H_1 = events.getDouble("H_1"); // = ???
  46. phi_e1 = events.getDouble("phi_e1"); // = ???
  47. phi_e2 = events.getDouble("phi_e2"); // = ???
  48. _E1h = createVar("E1h");
  49. _S1h = createExt("S1h");
  50. _I1v = createExt("I1v");
  51. //_Pth1 = createExt("Pth1");
  52. _E2h= createExt("E2h");
  53. /*_S1v= createExt("S1v");
  54. _E1v= createExt("E1v"); */
  55. }
  56. virtual ~E1h()
  57. { }
  58. void compute(const vle::devs::Time& /* time */)
  59. {
  60. // V_1 = grad(_S1v) + grad(_E1v) + grad(_I1v); //current size of all compartments at time t
  61. grad(_E1h) = phi_e2*_E2h() - phi_e1*_E1h() + b_1*_S1h()*_I1v()/H_1 - delta_H1*_E1h() - d1_H1*_E1h();
  62. }
  63. private:
  64. //contact proportion between a human belonging to the patch 1 and a mosquitoe belonging to the patch 1
  65. //double beta_1;
  66. //average number of that contact per unit time for that patch 1
  67. //double k_1;
  68. //inoculation rate of patch 1
  69. double b_1;
  70. // transition rate from E -> I for the patch 1 of the host population
  71. double delta_H1;
  72. // natural death rate of E in the host population for the patch 1
  73. double d1_H1;
  74. // size of host population for the patch 1
  75. double H_1;
  76. // migration rate of Infected (E) of host population of the patch 1 that left to patch 2 (Go)
  77. double phi_e1;
  78. // migration rate of Infected (E) of host population of the patch 2 that come to patch 1 (Come)
  79. double phi_e2;
  80. Var _E1h;
  81. Ext _S1h;
  82. Ext _I1v;
  83. //Ext _Pth1;
  84. Ext _E2h;
  85. /* Ext _S1v;
  86. Ext _E1v; */
  87. };
  88. } // namespace malariaspread
  89. DECLARE_DYNAMICS(malariaspread::E1h)