Coupling equation based models and agent-based models: example of a multi-strains and switch SIR toy model

Modeling in ecology or epidemiol ogy gener all y opposes two classes of models, Equa tion Based Models and Agent Based Models. Mathema tical models all ow predicting the long-term dynamics of the studied systems. However, the variability betw een individ uals is di ﬃ cult to represen t, wha t makes these more suitable models for larg e and homog eneous popula tions. Multi-agent models all ow represen ting the attributes and beha vior of each individ ual and theref ore provide a grea ter lev el of detail. In return, these systems are more di ﬃ cult to anal yze. These approaches have often been compared, but rarel y used simultaneousl y. We propose a hybrid approach to couple equa tions models and agent-based models, as well as its implemen tation on the modeling pla tform Gama [8]. We focus on the represen tation of a classical theoretical epidemiol ogical model (SIR model) and we illustr ate the construction of a class of models based on it.


Introduction
Agent Based Modeling and Equa tion Based Modeling are tw o common modeling approaches for dynamical systems.Equa tion Based Models (EBMs) usuall y describe the dynamical processes at the gl obal scale (at the popula tion lev el in ecol ogy) while Agent Based Models (ABMs) describe the same processes at the local scale (at the individ ual lev el in ecol ogy).Each approach offers di fferen t adv antag es and drawbacks.The scale at which the processes are represen ted determines the way the model is constructed: gl obal processes, a small number of par ameters and no individ ual variability for the EBMs; individ ual processes, high lev el of detail # Please ensure tha t you use the most up to da te class file available from EAI at http://doc.eai.eu/publications/transactions/latex/ * Corresponding author .Email: tri.nguyen-huu@ens-lyon.fr for ABMs.EBMs do not take into accoun t individ ual variability , assuming tha t mean fie d approxima tions convenien tl y describe the dynamics at the gl obal lev el.ABMs are relev ant when this individ ual variability has strong effect on the dynamics emerging at the gl obal lev el.Additionall y they all ow explicit represen tations of the inter action netw ork of individ uals when its topol ogy has consequences on the dynamics of the system and the emerg ence of properties at the gl obal lev el.ABMs also offer the possibility of an easy integr ation of GIS and social netw ork inf orma tion.
Apart from conceptual aspects, the comm unity of the modeler has a strong inf uence on which approach will be chosen.A strong knowledg e in ma thema tics is needed to understand and buil d equa tions for the EBM approach.As a coun terpart , ma thema tics offer pow erful tools to anal yse EBMs, providing a lot of in-depth inf orma tion about the dynamics, such as equilibria and long term dynamics.ABM approach is more intuitiv e, and pla tf orms such as Netl ogo or Gama propose modeling tools aiming at a wide audience.A few papers have been dev olved to the comparison or the coupling of both approaches.As an exam ple of a coupling of EBMs with ABMs, we ref er to some particle transport models [10 ] based an oceanic curren t model based on ph ysics and Partial Differen tial Equa tion, which output is used in a ABM tha t describes the dispersal of fis larv a.How ev er, to our knowledg e, there are very few models of strong coupling of an ABM with an EBM, in the sense tha t both models use the outputs of the other .Such a model has been dev el oped by [1] for a model of pedestrian mov emen ts.The model is based on an ABM describing the mov emen ts of individ uals in the streets of a city.Each road segmen t betw een tw o crossroads can be replaced by a ma thema tical transport model in order to red uce the amoun t of resources needed for the sim ula tions.At each intersection, the ABM feeds the EBM with the number of individ uals entering the road segmen t, then the EBM gener ates ag ents at its end.
In this article, we ill ustr ate the benefit of hybrid models embedding equa tions inside ag ents with a specifi class of models: epidemiol ogy models with mul tiple str ains for the virus.Epidemiol ogy models describe the ev olution with time of epidemics within a host popula tion.Usuall y, the host popula tion is divided in sev eral categ ories: susceptible individ uals (hosts without disease but which can get inf ected), inf ected individ uals, recov ered individ uals (hosts imm une to the disease).Many categ ories can be added depending on the disease and the model requiremen t, such as quar antined individ uals, inf ected but still not inf ectious, etc.Both classes of models are commonl y used: the firs and most famous, the SIR model by Kermack & McKendrick [9] being an EBM.Epidemiol ogy EBMs consider the popula tion at the gl obal scale: they are compartmen t models, each compartmen t corresponding to a variable represen ting the popula tion size in a giv en categ ory, or the density at a giv en location.Ev olution of the popula tion size (demogr aph y and transition from one compartmen t to another , such as newl y inf ected individ uals being transf erred from the susceptible compartmen t to the inf ected compartmen t) in a compartmen t is governed by di fferen tial equa tions.Such contin uous models also have discrete equiv alen ts.ABMs represen t each host individ uall y.Hosts can chang e sta te (e.g.susceptible to inf ected) over time, giv en probabilistic and al gorithmic rules.
In epidemiol ogy, EBMs often rela te to biol ogical or theoretical studies and have been used to model potential public heal th outcomes bef ore testing str ategies directl y on popula tions.As an exam ple, Shul gin et al. [17 ] discuss the benefit of a pulse vaccina tion using a classical SIR model.ABM focus more on studies with sociol ogical aspects using graphs theory: they all ow examining the role of social netw orks, transporta tion systems, and responses to changing contexts on the ev olution of epidemics [11 ].As an exam ple, we ref er to Auerbach et al. [2] study the propag ation of HIV in a sexual contact netw ork of 40 men.Usuall y, both approaches are used separ atel y.In this article, we focus on a particular class of epidemiol ogy models: models with str ain-pol ymorphic pa thog ens.Mul ti-str ains models with ev olutionary processes and inter actions are a major concern in epidemiol ogy.EBM and ABM approaches have both been used: as an exam ple, Roche et al. [16 ] propose an ABM of inf uenza with str ainpol ymorphic pa thog ens, based on an EBM model.Roche et al. decided to use an ABM beca use the original EBM fails to foll ow co-inf ections and consequen tl y to incorpor ate re-assortmen t.One of the main challeng es is to defin proper ly the nature of str ains space [20 ].A common approach is to consider a linear space of par ameters.Ev olution can be contin uous, in which case the possible of str ain is infinite or discrete.In the la ter case, models found in the liter ature use a finit number of str ains.This approach is relev ant for pa thog ens for which the di fferen t str ains can be enumer ated.In EBMs, the number of str ains is usuall y constr ained by the nature of systems of di fferen tial equa tions, which use a fi and finit number of equa tions.But ev olution and pol ymorphism can giv e rise to unf oreseen types of str ains, which can chang e the number of possible str ains.In order to release this constr ain t, we introd uce a sim ple epidemiol ogy model with dynamical chang e of the number of str ains.

Related Work
In this part , we presen t the curren t sta te of the art of coupling the Agent-Based Modeling approach and Equa tion-Based Modeling approach.Although these tw o approaches aim at a common objectiv e, they are distinct by their modeling formalism.The necessity of coupling and comparing the tw o approaches has been raised in sev eral research studies.They use a common methodol ogy: expl oration is alw ays done by implemen ting an ag ent-base model beside an equa tionbased without the support of an ag ent-based modeling framew ork neither an equa tion-based framew ork.

Equation-based model
The equa tion-based models [5] predict the long-term dynamics of the studied systems.they use ma thema tical formalism based on Ordinary Differen tial Equa tions or Partial Differen tial Equa tions.The modelling approach is gener all y driv en by the principle of parsimon y (or Occam's razor), which means tha t the model shoul d be kept as sim ple as possible, with as few par ameters as possible.Although, if a stochastic approach is possible, a deterministic approach is pref erable when possible.In addition, processes are considered at a gl obal scale (e.g. in ecol ogy: at the popula tion lev el instead of the individ ual lev el), assuming tha t the processes tha t govern the system at such a scale can be determined (often using mean fie d approxima tion).For exam ple, the demogr aphic dynamics of a popula tion can be described at the gl obal lev el using a par ameter call population growth rate, which can be deriv ated from the mean of offsprings per individ ual per time unit.Due to such approxima tions, the variability betw een individ uals is di fficul t to represen t, making these models more suitable for larg e and homog eneous popula tions.Mathema tics often provide useful anal ytical tools to fin the properties of ODE models, such as equilibria and asym ptotic dynamics.The ev olution of the system can be determined from ma thema tical proofs, which are more robust than just sim ula tions.For those reasons, such models can be easil y anal ysed and are useful for making predictions.On the contrary, transla ting the studied processes into equa tions requires a good knowledg e of similar ph ysics or ma thema tical models.Processes also have to be su fficien tl y smooth in order to fi their ma thema tical description.As a summary , such models require a larg e amoun t of work upstreams, but they offer conceptuall y good possibilities of anal ysis downstreams (the technical issues tha t coul d be encoun tered in ma thema tical proofs is not discussed here).
EBMs have been widel y used for epidemiol ogy modeling.A pr agma tic reason is tha t ma thema tical anal ysis methods were the onl y available methods, as computers and EBM were not available to Kermack and McKendrick in 1927.How ev er, there are man y conceptual reasons wh y EBM are a reasonable choice for modeling epidemics.Firstl y, epidemics arise in larg e popula tions, and the transmission and remission rates variability among individ uals can be easil y represen ted according to familiar distribution la ws, making such processes easy to describe at the popula tion lev el using mean fie d approxima tions.Secondl y, the anal ysis of the equa tions provide useful prediction tools for epidemiol ogy: one can determine conditions on the par ameters for which the epidemics will arise or not.For exam ple, the basic reprod uction number R 0 can be computed with the par ameters of the model, based gener all y on transmission and remission rates.Val ues grea ter than one mean tha t an epidemics outbreak will occur , such an ev ent can be then predicted without sim ula tions.

Agent-based model
Agent-based models [7] are used to represen t the attributes and beha vior at the individ ual lev el, and theref ore to provide a grea ter lev el of detail.They can describe strong individ ual variability , not onl y for the attributes of the individ uals of a same popula tion, but also for their beha vior .They are often associa ted to small time scales, which correspond to the individ ual processes time scales.In return, these systems may be more di fficul t to anal yze and prediction almost rel y on sim ula tions (apart from some ABMs which are actuall y probabilistic ma thema tical models tha t can be anal ysed with ma thema tical tools).Beca use of the larg e number of par ameters, it can be di fficul t to test the model sensitivity to one of them.A larg e amoun t of anal ysis, dependen t on sim ula tions and on the assumed prior distribution of par ameters has to be perf ormed in order to provide syn thetic resul ts.ABM use a specifi languag e to describe in detail the aspects of ag ents: perception, action, belief , knowledg e, goals, motiv ation, inten tion, reflexion etc. Processes can be written as al gorithms, offering more freedom to the modeler , as complex decision structures can be used (e.g. if the beha viour of individ uals depends on some condition, an if-then-else construct can be used).The ABM approach also proposes a more intuitiv e way to buil d the model: processes can be represen ted as close to the perception of the modeler .As a summary , such approach proposes an easy and intuitiv e work upstreams, but requires a larg e amoun t of work downstream to provide relev ant resul ts.In addition, the larg e number of par ameters combined with the often larg e size of popula tion considered means tha t such a model may need a very importan t amoun t of resources to run sim ula tions.
Interest of epidemiol ogists in ABMs relies on the ability to giv e a detailed description of the netw ork of transmission, and such models have been dev el oped al ongside graph theory .Such models are useful to represen t singular ev ents (one inf ected individ ual entering a larg e susceptible popula tion) and the stochasticity associa ted to such ev ents.Such models are used to represen t the worldwide propag ation of inf ection due to air travel.Depending on the disease, a detailed beha vior of the inf ection vector can be giv en.

Coupling EBM and ABM
In [19 ], the authors study the di fference betw een ag entbased modeling and equa tion-based modeling in a ind ustrial suppl y netw ork project in which netw ork's domain suppl y are modeled with both ag ents and equa tions.They also summarize the resemblance and variety of tw o approaches with a sug gestion to use one or another .Their study is part of the DASCh project (Dynamical Anal ysis of Suppl y Chains).DASCh incl udes three species of ag ents: Compan y ag ents, PPIC ag ents and Shipping ag ents.It also integr ates a fixe set of ordinary di fferen tial equa tions (ODE).They compare and valida te an ABM and EBM for epidemiol ogical disease-spread models, as well as in [18 ] in which an ABM and an EBM of the 1918 Spanish f u are compared.In this publica tion, a model valida tion framew ork for choosing ABM or EBM i proposed.
In [13 ], it is proposed to use onl y one appropria te modeling formalism instead of tw o approaches, and inf er an EBM from an ABM SIR model by expl oring the ded ucible par ameters like number of individ ual in popula tion, rates of inter actions base on dimension of environmen t.They have done a study with the measure based on disk graph theories [12 ] to link ABM with EBM dynamical systems applied to theoretical popula tion ecol ogy.
Another coupling approach is proposed in [14 ], [1] or [4].In the sim ula tion of emerg ency ev acua tion of pedestrians in case of a tsunami in Nha trang City, Vietnam, people mov e al ong the road netw orks as ag ents.The ag ent based model of individ uals mov emen ts are replaced by equa tion models for the roads with higher traffic.This transf orma tion giv e the model an addition of time and resource for such ev acua tion model which usuall y take into accoun t hug e popula tions.
All these approaches provide mechanisms tha t all ow inter action betw een sev eral models but they still have the foll owing disadv antag es: -In gener al, these approaches are not generic and are di fficul t to be re-im plemen ted in di fferen t domains and contexts.
-There are no consider ation of the di fferences in spa tial and tem por al scales.
-There are no framew ork tha t support coupling of heterog eneous models betw een equa tion-based modeling and ag ent-based modeling par adigm.

Description of the epidemiology model
In the presen t paper , we discuss the concept of integr ating EBM inside ABM.We buil d a model composed of sev eral sub-models.Each sub-model ref ers to an EBM or ABM.Instead of choosing betw een an ABM or EBM approach as in previous works for the gl obal models, sub-models are integr ated in a framew ork tha t all ows using both par adigms at the same time.
As a demonstr ation, we introd uce a ma thema tical epidemiol ogy model with dynamical chang e of the number of str ains.The epidemiol ogy dynamics for a giv en str ain is described by a classical EBM, while the str ain ev olution dynamics is described by an ABM.
The equa tions of the ma thema tical model will be embedded into ag ents, each ag ent represen ting a di fferen t str ain.Each str ain is char acterized by di fferen t val ues of the par ameters.In order to ill ustr ate the benefit of the hybrid approach, the mono-str ain ma thema tical epidemiol ogy model has to verify tw o conditions: • the model must be as sim ple as possible, with very few par ameters.This condition all ows a good tractability of the model.Beca use each str ain corresponds to particular val ues, it is easier to monitor the dynamics of ev olution of str ains with a low number of par ameters; • epidemics outbreak does not fade away with time.This condition ensures tha t the ev olution of str ains can be monitored over an infinit period of time.Such a condition is not met with the classical SIR model [9] and thus a slightl y di fferen t class of compartmen t models must be chosen.

Mono-strain models
We base our study on a common mono-str ain SIS model, which is a compartmen t model with tw o compartmen ts S, I which are respectiv el y the number of susceptible and inf ected individ uals at a giv en time.The ev olution of the S and I popula tions is governed by a system of di fferen tial equa tions, which reads: where the total popula tion I + S is constan t over time and normalized to 1.In presence of inf ected individ uals, the number of susceptible individ uals inf ected per unit of time is proportional to the to size of the inf ected popula tion and the proportion of susceptible individ uals in the total popula tion.The coefficien t of proportionality is written β and is called the infection transmission rate.Finall y, constan t γ corresponds to the recov ery rate, the rate at which inf ected individ uals recov er from the disease and become susceptible ag ain.Such a model corresponds to diseases for which there is no long term imm unity , such as common cold and inf uenza.The SIS model has an explicit anal ytic sol ution and its dynamics is well known.Let us introd uce the basic reproduction number R 0 = β/γ.A well know resul t is tha t if R 0 < 1, the epidemic dies out , while if R 0 >, the epidemics spreads and the system tends tow ard an equilibrium with a inf ected popula tion of size 1 − 1/R 0 .Theref ore, such a model verifie the tw o previous conditions: there are onl y tw o par ameters (β and γ), and the dynamics tends tow ard a steady sta te with a persisten t inf ected popula tion.
A SIR model modify so as incorpor ate vital dynamics can be used.Such a model use a third compartmen t R which represen ts the recov ered individ uals, who are free from the disease and who cannot be inf ected ag ain.The model reads: Constan t µ is the popula tion renew al rate, which means tha t popula tions S, I ad R su ffer from a natur al mortality rate of µ, while new individ uals are prod uced with the same fertility rate µ.The basic reprod uction number is β/(µ + γ).If R 0 > 1, the dynamics tends tow ard a steady sta te with a inf ected popula tion density of µ/β(R 0 − 1).This model also verifie the tw o conditions.The model has three par ameters, how ev er par ameter µ is not rela ted to the disease and won't affect the str ains monitoring.

Multi-strains models, with a constant number of strains
Usuall y, mul ti-str ains models are sta tic, meaning tha t N is constan t over time and there is no new str ain tha t was not presen t at time t=0.Such approach is consisten t with the ma thema tical approach of dynamical systems: the number of equa tions is the same once and for all.We propose a dynamics approach where str ains can be crea ted or remov ed.The previous models are modifie in order to consider n di fferen t str ains, the str ain i being char acterized by a couple of par ameters (β i , γ i ), n being constan t.The inf ected popula tion density is denoted I i .
The modifie SIS models reads: A str aightf orw ard anal ysis of the system shows tha t appart from the disease free equilibrium (DFE) (1, 0, . . ., 0), there exist n equilibria E i = (1 − γ i /β i , 0, . . ., 0, γ i /β i , 0, . . ., 0) where the non-zero elemen t corresponds to the popula tion inf ected by str ain i.If R 0 > 1, all those equilibria are unstable but the one tha t maximizes γ i /β i .Let us denote i * the number of the str ain corresponding to the stable equilibrium.The systems tends tow ards this equilibrium, with a non-n ull inf ected popula tion density , with individ uals inf ected onl y by the str ain i * .Theref ore this model ill ustr ates the competitiv e excl usion among the str ains: onl y the str ain with the highest fitnes surviv es.
Similar ly, the SIR model with vital dynamics and n di fferen t str ains reads: Similar resul ts can be obtained, with onl y one str ain surviving in the long term.One shoul d notice tha t such a model introd uces sim ple competition betw een the str ains as cross-imm unity is not considered.Theref ore there is onl y one gl obal compartmen t for recov ered individ uals, which is common to all str ains.In this model, we onl y take into accoun t virus str ains muta tions.Host ecosystem, ev olutionary processes and host variability impose selection on virulence [6].Ev olutionary ecol ogy epidemics models coul d benefi for such approach, mixing ag ents and equa tions.

Multi-strain models, with varying number of strains
We now consider models in which the number of str ains varies with time: str ains are remov ed when the corresponding popula tion is too low, and a new str ain is crea ted when a random muta tion occur in an existing str ain.Formall y, the models can be described by the systems of equa tions 3 and 4, except tha t tw o rules are added: • when the popula tion of str ain i drops bel ow a threshol d σ , str ain i is remov ed from the system.
• for each str ain i, a muta tion can occur with a probability p.When the muta tion occurs, a density m of individ uals is remov ed from the popula tion inf ected by str ain i.A new str ain n + 1 is crea ted, with an initial inf ected popula tion density I n+1 = m.New par ameters β n+1 and γ n+1 are randoml y chosen with reg ard to old val ues β i and γ i .In our study , we decide to chose the val ues β n+1 and γ n+1 according to a unif orm distribution on the respectiv e interv als [0.7β i , 1.3β i ] and [0.7γ i , 1.3γ i ].

Hybrid concept and implementation
Mathema tical models often do not consider systems of equa tions with a varying number of equa tions.
Here we propose to use ABM with ag ents embedding equa tions in order to buil d a system of equa tions tha t can ev olve with time.Strains are represen ted by ag ents which can comm unica te with each other .For each str ain, there is one equa tion describing the ev olution of inf ected individ uals corresponding to tha t str ain.Such a system is an ABM and an EBM in the same time: each str ain is considered as an individ ual, but the popula tion of susceptible and inf ected is considered at the gl obal lev el.Each str ain is an entity tha t embeds an equa tion.The inter action betw een individ uals form a larg e dynamics set of equa tions.It can be seen either as: -an ABM composed of str ains, each individ ual embedding an equa tion.Inter actions betw een the individ uals giv e rise to a non-sta tic system of equa tions, and so to an EBM tha t ev olves with time.
-an EBM, in which each equa tion is represen ted by an ag ent corresponding to a str ain which is dynamicall y linked to the others.The EBM is a non-classical one, in the sense tha t it can be dynamicall y be chang ed.
The model has been implemen ted on the Gama pla tf orm [8], which all ows embedding equa tions.In an equa tion associa ted to an ag ent, it is possible to ref er to the variable and equa tions embedded in other ag ents, in order to buil d dynamicall y a set of equa tions.
The str ains are susceptible to muta tions, and so to ev olution through competition for resources (popula tion susceptible to the disease).From time to time, a str ain is randoml y selected for muta tion, a new str ain of one individ ual being crea ted, and the par ameters beta and gamma for the new str ains being chosen randoml y with val ues close to the ones of the old one.The set of equa tions is upda ted dynamicall y, and the new str ain joins competition for resources.

Dynamics of the model
The model we buil t ill ustr ates a phenomenon of genetic drifts.According to excl usiv e competition principle, the str ains with the smaller fitnes final y get discarded from the pool.Depending on the frequency of the muta tion ev ents and on random aspects, it happens tha t sev eral str ains coexist for a short period (up to 20 in our sim ula tion with par ameters ...) According to expecta tion, the drift tends tow ards par ameter rang e where beta is larg e and gamma is small.We ill ustr ate our coupling methodol ogy by implemen ting a hybrid model, called Switch, combining equa tions and ag ents on the modeling pla tf orm Gama.We buil d a class of SIR model based in both ABM and EBM (figur 2), in which people are represqen ted by ag ents when the density is low, and by equa tions if the density is higher , a til ting mechanism for moving from an approach to another .
Both models are based on the same assum ptions.They involve tw o processes: contamina tion and recovery.The ABM model also adds spa tial inter actions and dispersal.The ma thema tical model is indeed a mean fie d approxima tion of the ABM and represen ts the dynamics at the gl obal scale, while ABM shows the dynamics at local scale.The contamina tion and recov ery processes happen frequen tl y with a "unif orm distribution " over time.
-Assum ption i) implies tha t processes can be represen ted at a contin uous time; -Assum ption ii) all ows to replace probabilities of processes occurrences by expectancies; final y assum ption iii) all ows to consider tha t all individ ual have the same number of neighbors.
-Assum ption iii) popula tions are considered to be at su fficien tl y high density; popula tions are considered as homog eneous for spa tial distribution of individ uals, as well as for the distribution of each type of individ uals (S, I and R).
Considering tha t assum ption i) hol ds is rather natural, as processes occur al ong constan t time steps.Epidemiol ogical models usuall y assume tha t popula tion densities are high, thus condition for assum ption ii) seems to be natur all y fulfilled How ev er, in a larg e popula tion, the density of inf ected (or ev en susceptible) individ uals may be very low.Indeed, a usual condition for such kind of model is the introd uction of a small group of inf ected inside a disease free popula tion.Mathema tical model are deterministic and ignore the variability due to stochasticity which al ter the dynamics: if one inf ected individ ual is introd uced in the popula tion, if basic reprod uction rate R0>1, and epidemic outbreak will be predicted by the ma thema tical model.How ev er, in real cases or for ABM, there is a chance to avoid epidemic outbreak as contamina tion may not occur thanks to the stochasticity of inf ection process.Assum ption iii) may not be possible for spatiall y explicit ABM, as spa tial distribution does not remain constan t and spa tial pa tterns coul d appear , like contamina tion waves.Assum ption iii) makes tha t the EBM, as mean-fie d approxima tion of ABM, is also the the "limit " (in the ma thema tical sense) of the EBM when spa tial process tends to spa tial homog eneity , which is achiev ed by letting the neighborhood of an individ ual tend to cov er the whole environmen t, or by increasing the speed of mov emen t of individ uals (well mixed popula tions).
Comparing both EBM and ABM is exhibiting the di fferences due to approxima tions done for the ABM model due to assum ptions ii) and iii).Assum ption ii) is at the heart of the model switch problema tic: EBM shoul d not be used when the conditions for this assum ption are not fulfilled Assum ption iii) also add a challeng e to model switching, as corrections have to be made in order to represen t into the ABM the effects of spa tial structures tha t have been hidden by the approxima tion made with this assum ption.Furthermore, switching from EBM to ABM introd uces an explicit spa tial distribution of individ uals, for which assum ption iii) doesn 't have to be made.The spa tial distribution, hidden in the EBM, may have to be gener ated.
The tw o models are based on SIR models assum ptions.Individ uals can be in three differen t sta tes: susceptible individ uals (S): the individ ual is disease-free and can be contamina ted by contact with an inf ected individ ual (I).After some time, inf ected individ uals recov er from the disease (or die).They are assumed to be in a recov ered sta te (R): they are imm une to the disease and do not take part anymore in the inf ection dynamics.The models involve the foll owing processes: -inf ection: transmission of the disease from inf ected individ uals.This depends on the contact rate betw een susceptible individ uals and inf ected individ uals; -recov ery: inf ected individ uals heal and recov er from inf ection; -mov emen ts: individ uals are assumed to mov e within the considered environmen t.There are tw o type of mov emen t, one is random walking and other is not random, (figur 3).
Hypothesis found in both models: -Recov ery rate: the remission rate is very similar in the ag ent-based model and the equa tion-based model.In the ABM, par ameter gamma is the probability to recov er per time unit.In the EBM model, the par ameter gamma is a mean-fie d approxima tion, which means We compare this model with existing models and presen t a method to determine the par ameters for transitions betw een models.In particular , we establish a link betw een the par ameters of the ma thema tical model, and the represen tation of contacts and travel ag ents in a spa tial environmen t.
We are also interested in how to compensa te for the loss of inf orma tion on spa tial structures when we mov e an ag ent model to a ma thema tical model.Curren tl y, we save the attributes, especiall y the location and the sta tus, of all ag ents and re-assign to ag ents when they need.We are also interested in how to compensa te for the loss of inf orma tion on spa tial structures when we mov e an ag ent model to a ma thema tical model.Curren tl y we have implemen ted tw o foll owing method of crea tion new distribution after the switch from EBM to ABM.

Objective, Data and tools used
In this part , we do experimen t to prov e the capabilities of coupling framew ork tha t we have proposed to compose the ABM and EBM.The experimen ts will have three scenarios, each scenario The da ta used in the "Switch " model is bring in the real da ta of SIR model.The epidemiol ogy' s par ameters are the spread of the f u and measles.We have introd uced in GAMA the possibility to describe the dynamics of ag ents using a di fferen tial equa tion system and to integr ate this system at each sim ula tion step.With the enhancemen t of GAMA modeling languag e (GAML), modelers have possibility to write equa tions linking ag entsâ ĂŹ attributes and to integr ate equa tion-based system with ag ent-based system.The GAML syn tax permit to write an system of equa tions of most EBM based on the implemen tation with Commons Mathema tics Libr ary.
To figur out the coupling problem of di fferen t tempor al scale, we introd uce the controller of integr ation steps and sim ula tion steps beside the tw o curren t integration method Rung e-Kutta 4 and Dormand-Prince 8 (5,3).This controller is main tain in the sol ve sta temen t of GAML and woul d be call at each sim ula tion step.In the figur 4, an equa tion-based model in form of al gebrics is represen ted into GAML syn tax tha t are called Equa tion.Set of equa tions make a System of equa tions.This type of entity will be integr ated by our GAMA ODE (Ordinary Differen tial Equa tion) Sol ver packag e.

Represent classical SIR model in EBM and ABM formalism.
The firs experimen t show tha t we can easil y modeling the classical SIR in form of equa tion-based and also ag ent-based.As in the figur 5, an di fferen tial equa tion can be declare with tw o expression.The firs one on the left of "=" is the keyw ord di ff foll owed by the name of integr ated variable and the time variable t: d i f f ( < i n t e g r a t e d v a r i a b l e > , t ) = < c a l c u l a t i n g e x p r e s s i o n > ; An EBM is then represen ted as a attributes of ag ent with a bl ock of equa tions: e q u a t i o n < n a m e _ i d e n t i f i e r > { d i f f ( . . . ) = . . .; d i f f ( . . . ) = . . .; . . .}

Discussion on the methodology
The EBM submodel describes the dynamics of the epidemic at the gl obal scale: host popula tion is considered at gl obal popula tion through density measuremen ts.The ABM submodel describes the dynamics of str ain ev olution at the individ ual lev el: at each momen t, one can describe which str ains are activ e and which have been remov ed.One shoul d notice tha t the gl obal lev el for EBM is indeed embedded in the individ ual lev el for str ains: to each individ ual str ains corresponds a density of inf ected popula tion.

Adjust the parameters to calibrate EBM and ABM
The ABM sim ula tion resul t is a stochastic resul t, instead of EBM'resul ts are deterministic.Our proposition all ow modeler to calibr ate the SIR model in ABM fi with EBM.We la unch the sim ula tion with foll owing par ameter: N = 500; I = 1.0; S = N -I; R = 0.0; beta = 1/2.0;gamma = 1/3.0.After 100 sim ula tions, the SIR model and ag ent model presen t significa t di fferences from (figur 6): -popula tion initial (N) -effect of size grid (grid size) -effect of topol ogies (neighborhood size) The transition beta from EBM to ABM is then adjust an amoun t alpha.We rela unch the sim ula tion 100 times to expl ore the val ue of alpha.We found the fixes alpha = 0,45 (figur 7).We have also found sev eral criterias tha t woul d be effect the fitnes betw een SIR EBM and ABM are: di fference of synchronous/asynchronous   (inf ect others vs is inf ected); random walk; effect of beta; dispersion; effect of mov emen t speed.

Study of the dynamics of multi-strains epidemiological model
with our proposed coupling methodol ogy, modeler can easil y study the mul ti str ain epidemiol ogical model by the implemen tation like in the figur 8. ag ent str ain can be crea ted an remov ed dynamicall y in time of sim ula tion.
As in the case of a constan t number of str ains, competitiv e excl usion prev ails: the str ains with lowest fitnes ev entuall y disappear , while the one with the highest remains.As muta tions all ow the appear ance of new str ains, str ains with higher fitnes appear (higher R 0 = β/γ ratio), and it is possible to exhibit a genetic drift.In figur 9, it is shown tha t ev olution favours an increase of β (better contamina tion ability) and a decrease of γ (long er inf ection duration).In this experimen t (figur 10 ), we save the attributes, especiall y the location and the contamina tion sta tus of all ag ents when we do a switch from ABM to EBM model.Then when re-assign to ag ents.The imag e represen t the reg ener ation al gorithm in figur 10 is tw o exam ple resul ts.With the same manner , we have do 100 times of sim ula tion and compare the sta te of popula tion with and without a switch in the table 11 to see the efficien t of al gorithm.

Conclusion
This paper has proposed a hybrid approach combining modeling equa tions and ag ents, as well as its implementation on the modeling pla tf orm Gama.We are interested in the represen tation of this approach theoretical epidemiol ogical models.We ill ustr ate the construction of a class of models based on a SIR model in which people are represen ted by ag ents when their density  is low, and equa tions with higher density , a til t mechanism for moving from an approach to the other .We compare this model with existing models and presen t a method to determine the par ameters during transitions betw een models.In particular , we seek to establish a link betw een the par ameters of the ma thema tical model and represen tation of contacts and travel ag ents in a spa tial environmen t.We are also interested in how to compensa te the loss of inf orma tion on spa tial structures when moving an ag ent model to a ma thema tical model.

Figure 1 .
Figure 1.Coupling approach example: people moving on the road are represented in the form of equation, and in form agents at the crossroads

Figure 2 .
Figure 2. Representation the dynamic of "Switch" model

Figure 3 .
Figure 3. Two type of deplacement of agent in an environment

Figure 4 .
Figure 4. an ODE solver structure inside a modeling and simulation platform

Figure 5 .
Figure 5. Representation of an equation-based model in an simulation platform.

Figure 6 .
Figure 6.Adjust the beta parameter of SIR model to calibrate EBM with ABM result.

Figure 7 .
Figure 7. Adjust the beta parameter of SIR model to calibrate EBM with ABM result.

Figure 10 .Figure 11 .
Figure 10.Regeneration of spatial information algorithm, the example result: (a),(d) population before the switch, (b)(e) population at threshold without a switch, (c)(f) population regenerated from (a)(d) after a switch