Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDisease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/754862/#msg_754862
I have a question regarding how I could use the available multipopulation disease models for a population model where two different populations are assigned to seperate graphs (in opposition to the Multipopulation example). Background is still our food mediated disease transmission issue where I have distinct graphs for e.g. the cattle population (farms) and the human population (districts).
Would the MultiPopulationDiseaseModels work if I would create containment edges between the corresponding farm and human district node?
Thanks,
Matthias]]>Matthias Filter2011-11-04T16:53:01-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/754887/#msg_754887
good questions. First of all, we'd like to offer to work with you if there is any new functionality needed to handle your cattle farm scenario. I was discussing with Jamie and here are the options we can think of right now:
Let's say we want to model Germany where we right now only have data for admin level 1 (states)
1. Create containment edges from the existing admin 1 regions (states) to the nodes in your new graph containing cattle farms. This is intuitive since the cattle farms are located inside states. A node in your cattle farm graph (a farm) would be admin level 2 and would contain both cattle and humans (farmers) and migration edges could be used between farms to transport cattle around. Here is the tricky part though. You would also need to create another graph of human population at admin level 2 for regions where there are no farms and break down the human population in the states into those regions. The reason is that for any given country, we only do modeling at the highest resolution available and if you add admin level 2 farms via contentment edges the multi-population disease would not do any modeling in the admin level 1 states. STEM always assumes you have the complete picture so if you have some admin level 2 nodes, it thinks you have all of them.
2. Model your cattle farms just like we do states, i.e. add containment edges to the Germany node from your farms, then add edges to the states to indicate "physical adjacency" to those states.
3. (Simplest). Don't create any new nodes at all for your cattle farms. For each state in Germany, determine how many cattle there are and create a graph that contains labels only with cattle population data and attach to the states. Migration edges would still be used to move cattle around between states. Maybe this is not the most realistic scenario since I believe you would want to model direct transportation between farms, so if this is the case you would need to model the farms explicitly like in option 1.
Regards,
/ Stefan
]]>Stefan Edlund2011-11-04T19:14:49-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/754904/#msg_754904
Still have some questions:
Is it right, that containment edges are only used to identify the highest resolution level of nodes?
In option 2: is a physical adjacency edge equivalent to a common border edge?]]>Matthias Filter2011-11-04T20:43:25-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/754916/#msg_754916
Yes, physical adjacency and common border are the same thing.
Thx
]]>Stefan Edlund2011-11-04T23:17:32-00:00Re: Disease model adaption (Food borne Disease)
https://www.eclipse.org/forums/index.php/mv/msg/261564/756268/#msg_756268
Stefan and I are looking at this along with the document sent to us by Jan. I think this is a very exciting and fun problem and we are enthusiastic to help. We want to think fairly generally about how we implement food borne disease to see if we can come up with a very flexible framework. Right now it looks like a simple extension to demographic population models will do everything we want.
1) Modeling cattle => meat could be a transition between two compartments in a demographic food (cattle) population model. The transition rate, however is a mass action term very much like the infection process (SI) term in a disease. The transition rate at which meat is produced is a function of both the 'S'ource cattle population (locally) and the 'I'slaughter house capacity. There would also be a rate factor beta (production rate) which could be shut off in an intervention. A slaughter house could be a new type of region node with a label for capacity, or it could be a label on any region node. The former might be better because if we want to model e-coli then a slaughter house itself could become infected.
2) Consumption of meat is like a death rate for the meat population. Again there is a mass action term where meet is consumed by a product of 'S'upply of meat and 'I'human population with a rate term. We probably want another rate for expiration of uneaten meat. Doing it this way the rate of consumption (like beta) could change. For example if an outbreak occurs people might stop eating the meat but it could get thrown away when it expires. We want to be able to model interventions.
3) Eventually we should think also about a cattle feed model. Ideally our model for cattle should also support modeling their food.]]>James Kaufman2011-11-11T17:53:24-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/756269/#msg_756269
James Kaufman2011-11-11T17:54:22-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/756294/#msg_756294
Sondra]]>Sondra Renly2011-11-11T19:43:36-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/756928/#msg_756928
Jan and I discussed the proposed solution again and we think that it is already close to what is needed. So here is what we think:
1) Modeling cattle => meat: we agree that it might be necessary to create a new type of population model which extends the demographic one (let's call it "generic population model"). To keep it as generic as possible (see Sondra's comment) we would propose that the "generic population model" generator should allow:
- to create "subgroups" within a population (as in the demographic one)
- specify subgroup-specific birth and death-rates
- specify transition factors between subgroup, i.e. a rate at which a member of one subgroup will become a member of the others (somehow similiar to the "aging" effect)
(those factors related to "slaughter house capacity" and "production rate" are in our opinion a bit too specific and it seems for us also possible to describe those aspects also with just the generic transition factors)
2) Consumption of meat / interventions: the subgroup specific death rates could be sufficient to model that
3) cattle feed model: good idea, but currently not top priority for us
BUT, we see one other obstacle:
We think we need a new "generic" multipopulation disease model as well:
Currently both subgroups of our animal/meat population model would be assigned to the same disease model type, if we would use the available multi-population disease models that are implemented. But for meat we can only think of using a SI-model. So we think it would be helpful to create a truely generic multipopulation disease model as well, where you can assign e.g. a SIR-model to the animal subgroup and a SI model to the meat subgroup. Ideally within such a disease model it would be possible to specify each single possible disease transmission rate explicitely, e.g. S_animal to S_meat, S_animal to I_meat (relevant as you have cross-contamination during the slaughtering process), I_animal to S_meat (relevant as you have disinfection or heating steps during slaughtering and processing), I_animal to I_meat (the most likely case) etc.. This type of "generic" multipopulation disease model would also be necessary to describe the disease transmission via eating of meat. E.g. there will be nodes that contain the animal population (with subgroup animals (equals to 0) and meat) and the human population with demographic subgroups. Here again you have the situation that the disease model of the meat subgroup is not necessarily the same as the one in the human population.
What do you think, does that make sense to you?
Matthias
]]>Matthias Filter2011-11-15T15:04:52-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757010/#msg_757010
1) Modeling cattle => meat: we agree on a new type of generic population model:
- to create "subgroups" within a population
- specify subgroup-specific birth and death-rates (should be no problem)
- specify transition factors between subgroup, I agree that to begin with this can be a constant generic rate. In the future I think we will want to add the option of an algorithm so this generic transition rate can depend on other things. For example, the type of node as you originally suggested.
2) Consumption of meat / interventions: the subgroup specific death rates could be sufficient to model that Yes indeed.
3) cattle feed model: good idea, but currently not top priority for us OK
BUT, we see one other obstacle:
We think we need a new "generic" multi-population disease model as well:
Currently both subgroups of our animal/meat population model would be assigned to the same disease model type, if we would use the available multi-population disease models that are implemented. But for meat we can only think of using a SI-model. So we think it would be helpful to create a truly generic multi-population disease model as well, ... This is not problem but I think there may be a way to do everything you want with the existing multi-population disease model. For example, even if you pick the SIR Multi-population disease model, you could always set Recovery rate to precisely zero to get SI for just one compartment (it already allows you to specify rates as vectors and matrices. However, we can certainly extend to a new class if necessary.
]]>James Kaufman2011-11-16T00:42:30-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757157/#msg_757157
Concerning the "generic" multipopulation disease model: in my opinion the problem arises when you apply the transition factor of the generic population model to the "standard" multipopulation disease model. This would lead to a conversion from e.g. I_animal to I_meat AND R_animal to R_meat (or E_animal to E_meat in case of SEIR). Then we would have the problem how to deal with E_meat and R_meat in the disease model part of the meat subgroup, even though the corresponding rates were set to 0. Concerning the implementation of the new generic population model: Should I create a feature request for that in bugzilla?
MAtthias]]>Matthias Filter2011-11-16T20:04:33-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757161/#msg_757161
Let's do one bugzilla entry for everything (new population and new disease)
perhaps call it Foodborn Disease/Population model framework or something generic as we may want to add other requirements.
Please let me know if the following describes what you want. We implement two new disease models (DMD). In this example, DMD1 applies to the living cattle demographic group. Let's call it an SEIR E-coli for sake of argument. It knows about cattle and meat but the compartments only include living cattle.
DMD2, a separate instance, would be an SI E-coli that infects only meat.
The ONLY difference between these two new models and our existing multi-population models would be in the transition code. When cattle are converted to meat, S and R states map to S state meat. I states map to I state meat with some probability. What would happen to the E state cattle (if we use that)? Would it map to I or to S (or split with some other probability)?
One other question. Is there a dosage effect with E-Coli. If, for example, meat is has only a trace of E-Coli does that make it less likely to infect humans? Would the contamination grow with time as the meat ages? The reason I ask is that the 'I' state really means 'Infectious' as in shedding microparasites so others can be exposed on some type of contact. 'E' could be treated as 'Infected' but not yet 'Infectious'. If there is a threshold or dosage effect with a food borne disease then we might be able to use the E state in the food as well. Does this happen?
]]>James Kaufman2011-11-16T20:36:49-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757233/#msg_757233
Matthias Filter2011-11-17T09:32:13-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757320/#msg_757320
perhaps we could call it something like a "Food Harvesting" decorator. I think it could exist either on a region node or on an edge. It's an operator that operates on populations (including plants). Cattle-meat, Wheat-Flour, etc.]]>James Kaufman2011-11-17T16:52:20-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757330/#msg_757330
]]>Matthias Filter2011-11-17T18:22:21-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757360/#msg_757360
How about something like this:
1. We create a new "Cattle Population Model" (or replace Cattle with a generic word for animals turned into food). It is just like the standard population model with the addition of one parameter "slaughter rate". It's similar to the background death rate, the distinction being animals being slaughtered versus dying from other reasons. In slaughterhouse regions slaughter rate would typically be much higher than background death rate (seems like a waste otherwise).
2. We create a new "Meat Population Model". It would have three parameters: Population identifier for the animal turned into meat, consumption rate (similar to death rate) and scaling factor. The scaling factor is used to determine how many products of meat to create from a single cattle being slaughtered.
3. There is no need to create a new disease model for cattle, we can use the existing SI, SIR or SEIR models.
4. We create a new "Meat disease model" extending the SI model. The already existing parameter "Population Identifier" is the identifier of the meat. We also need to know the population identifier of the animal. To calculate how the S and I compartment changes, we locate the disease label for the animal. If it's of type SI, it's trivial. If the meat population model says that X units of meat was produced in this time step we divide up X into the S and I compartment in equal proportions to the current animal population state. I understand there might be some adjustment to the I compartment here since not all sick animals are turned into infected meat, but that can be adjusted for either via a parameter or (as suggested) a fixed value. If the animal is of type SIR it's also trivial, S+R goes into S, I goes into I. For SEIR animal models, we might need more expert help.
Implementation wise, the "communication" mechanism between population models and disease models is via an EMF object called Exchange and an EMF enumerator ExchangeType. It is attached to any delta value that is created and it essentially breaks down the components that went into calculation of the delta. We would need to extend this object with a new type "SLAUGHTERED" to make sure the meat population model can figure how how to add new meat product.
Is this powerful enough to handle the modeling we want to do?
/ Stefan
]]>Stefan Edlund2011-11-17T22:54:01-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757579/#msg_757579
i) Transition Cattle to Beef
ii) Appropriately map the disease state
This gives us the maximum ability to generalize the food production, combining different types of production within a region (eg a diary, a farm, and a feeding site) or allows us to created individual nodes for particular sites if we need to. I do not think this requires new types of nodes or edges.
So as Stefan points out we use:
1) Our existing Disease Models as Stefan suggests
2) Existing Population Models to model Cattle and meat (no slaughter rate in the population model but different death rates (food death rate == expiration rate)
3) A new exchange decorator that defines slaughter rate. This rate can then be location specific.
Only Item (3) is new code.
Does this make sense?]]>James Kaufman2011-11-19T20:17:19-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757593/#msg_757593
]]>Stefan Edlund2011-11-20T00:00:15-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/757670/#msg_757670
In this case, this decorator idea seems to be a good approach. Easy and a smaller number of construction sets in the code, I hope.
Still, Stefan's item 4) is a tricky one, I guess.
Is it actually possible/reasonable to have two different disease models running?
]]>Jan-Frederik Wigger2011-11-21T08:45:48-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758114/#msg_758114
to be honest I have some problems to get it all sorted out. So I try to test it on a different scenario:
Brucellosis in cows, disease transmission via milk to humans:
node 1: farm with 100 cows, milk production per day: 1000 l
node 2: cheese producing company: 50000 l milk comes in per day, 1000 kg cheese out per day
node 3: area node: 1000 human, 200 kg cheese in per day, 200 kg cheese out (eaten)
Disease model cows: SIR
Disease model milk: SI (rate set to 0)
Disease model cheese: SI (rate set to 0)
Disease model human: SIR
So how do we proceed?
1: Create three nodes (1= farm, 2= cheese producer, 3=area node)
2: Create four separate populations (cows, milk, cheese, human) each with standard population model, each with "birth" and "death" rate
3: Create migration edges for milk from node 1 to node 2 and for cheese from node 2 to node 3
4. Assign specific disease models to each population
5. Assign a specific "exchange decorator" on nodes 1 that deal with the disease transmission from infected animals into the milk (SIR to SI) and the milk production
6. Assign a specific "exchange decorator" on nodes 2 that deal with the transformation of milk into cheese (and SI to SI transition considering effects of processing)
7. Assign a specific "exchange decorator" on nodes 3 that deal with consumption of contaminated cheese (= SI to SIR transition)
So in the sample above the "exchange" between the populations happened within a node. If the "exchange decorator" could be applied on an edge as well then one could describe also the transformation of population members in one node into a different population in a different node, which could be useful for certain scenarios as well.
So with respect to that exercise above, I think the decorator idea could work out perfectly fine. What this means with respect to implementation efforts I can not judge. Did I miss anything?
]]>Matthias Filter2011-11-21T22:11:27-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758124/#msg_758124
org.eclipse.stem.foodproduction (contains emf model)
org.eclipse.stem.ui.foodproduction (contains any associated ui components)
Just bare bone skeleton stuff is in there right now.
/ Stefan
]]>Stefan Edlund2011-11-22T00:47:43-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758194/#msg_758194
So for us it would be sufficient (as the example showed) if the "exchange decorator" is only "allowed" to be attached to nodes.
Matthias ]]>Matthias Filter2011-11-22T09:55:51-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758381/#msg_758381
I think the "Exchange decorator" is similar to the new disease model I described in step 4. Generalized, it could also be used in step 2 to turn cattle into meat. However, there are technical obstacles that needs to be overcome if we were to go down this path. Most importantly, there can only be one instance of a decorator determining how the state of a disease changes (the delta calculation) in a single time step for a given population. So in Matthias scenario above where first a disease model is assigned to each population (cow,milk,cheese,human), then a set of exchange decorators determine the transitions of the disease between populations, we'd end up calculating the delta twice for a population and one of the results would be overwritten and thrown away.
Let me be clear on how things work in STEM now so we are all on the same page and so we can also see what we have to work with. There are essentially two calls that happens for each decorator in each time step:
1. For each decorator (i.e. population model, disease model, or perhaps a new exchange decorator), call calculateDelta()
2. For each decorator, call applyExternalDeltas()
In the first step, the calculateDelta method does the math to figure out how the state of a disease (or population) changes for a single time step in each node. It puts this information into a deltaValue variable attached to the node (actually attached to a label on the node). Also attached to the deltaValue is a list that breaks down the components that went into calculation of the delta value. So for instance, a disease model would put information into the list that in this time step, X number of people died as a result of being infected by the disease. A population model would put information into the list that in this time step, X number of people were born, Y number of people died, Z number of people migrated to Scotland and K number of people arrived from Norway .
In the second step, each decorator adjust its own calculated delta value on each node to take into consideration external events. This is where the list is being used. A disease model for instance would read the list attached to a (matching) population model delta value and determine that in this time step, X people were born so it adds X people into the S compartment (typically if children are born susceptible). A population model reads the associated list from a (matching) disease model delta value and determines that Y people died from the infection, so it adjust its delta to reduce the total count of the population. In the end things balance out and all numbers should agree (which is important, a disease model and a population model cannot disagree on the total number of people around!).
So when I said that that a single decorator can only be used to determine what the delta value is, it doesn't mean that it cannot take into consideration other external events. External events currently handled are births, deaths, migration and aging.
So if we want to use the existing algorithms for food mediated diseases (and I think we should to the extend possible) perhaps something like this would work:
1. We create a new type of exchange decorator. The exchange decorator simply says from population P1 and compartment X, create new population members for population P2 in compartment Y using some scaling factor Z. This is generic enough to handle the production of meat from cattle, and the production of infected meat from infected cattle.
2. We extend the list of external events to include a new type, maybe calling it PRODUCTION perhaps. The exchange decorator adds to the list of the delta value calculated for the source (e.g. cattle) an instance of PRODUCTION.
3. In the applyExternalDeltas method, we recognize the PRODUCTION type event, determines (from the exchange decorator itself) how to modify the calculated delta. So a population model for meat would recognize the PRODUCTION external event and so would a disease model for meat.
This is generic enough to handle all kinds of food production, meat, harvesting or chickens laying eggs.
The only thing we can't model is varying the production rates or infectivity (e.g. an infected factory) in each region. The exchange decorator doesn't have any memory (e.g. own labels) to store this information in each node. But there's nothing preventing us from creating labels if needed.
Cheers,
/ Stefan
]]>Stefan Edlund2011-11-22T23:18:17-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758609/#msg_758609
Why don't you call the new type of external events EXCHANGE (in resemblance to the exchange decorator)?
And just to verify that I understood the concept right: Shouldn't the exchange decorator adds an instance of PRODUCTION / EXCHANGE to the list of both delta values (source and target)?
With respect to my Brucellosis scenario above: what would be the difference in the scenario setup procedure with the exchange decorator you suggested?
Concerning the "varying the production rates or infectivity" issue: couldn't one use a trigger for that?
Once more: thanks a lot for your support!
Matthias]]>Matthias Filter2011-11-23T21:08:02-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758625/#msg_758625
. Perhaps there's an even better term, I was thinking production but I'm open to other suggestions.
Actually, now that I think some more about it I believe we only need to add the EXCHANGE to the list in the target, since the target is the only one where the delta is changed (the source is never touched). So when an exchange is detected in the target, we consult the exchange decorator to determine the source to use and create new meat/crop/egg/milk instances from it.
Yes, a trigger could modify the exchange decorator but it would do so globally and not at a regional level. Globally there would always be the same number of products of meat produced from a cow for instance, and the only thing that varies regionally are the number of cows processed / day in a factory.
There's not much changes in your scenario, except I wouldn't assign a location for each exchange decorator. If you have 1000 milk farms in your scenario you wouldn't want to create 1000 exchange decorators cow->milk! But feel free to disagree if you want. I also think the infection from cheese to human could be modeled using a multi-population disease model. Here's how I would try to flesh out more detail to your description with some example numbers:
2: Create four separate populations (cows, milk, cheese, human) each with standard population model, each with "birth" and "death" rate. Initially put 100 cows and 1000 milk in node 1, 1000 milk and 10,000 cheese in node 2 and 10,000 cheese and 100 human in node 3. Set birth/death rate for cows/humans to realistic numbers in your scenario. Set death rate for milk to 1 (the "life expectancy" of milk is one day in the cheese factory), birth rate to 0 in node 2. Similarly set the death rate for cheese to 1 in node 3, birth rate to 0 (all cheese is consumed daily).
3: Create migration edges for milk from node 1 to node 2 and for cheese from node 2 to node 3. The migration rate is 1, ensuring all milk and cheese are transported and consumed daily.
4. Assign specific disease models to each population. SIR for cow, SI for milk. I believe the disease model for human/cheese would be a multi-population SIR, so cheese would be SIR but with 0 recovery rate.
5. Create a specific "exchange decorator" that moves 10 times the count of cows into the count of milk. Create another specific "exchange decorator" that moves 10 times (S+R) of cows into S of milk, and 10 times I of cows into I of milk.
6. Create a specific "exchange decorator" that moves 10 times the count of milk into the count of cheese. Create another specific "exchange decorator" that moves 10 times S of milk into S of cheese, and 10 times I of milk into I of cheese.
7. I believe consumption of contaminated cheese could be modeled using multi-population SIR disease model. There's a mass-action term like the transmission rate becomes consumption rate then the new number of sick cases depends on the number of bad cheese times the number of susceptible humans times the consumption rate. I'm sure this is an oversimplification, but for sure there's no "exchange" going on between cheese and humans as in the other cases.
This is getting pretty complex
Stefan
]]>Stefan Edlund2011-11-23T23:07:41-00:00Re: Disease model adaption
https://www.eclipse.org/forums/index.php/mv/msg/261564/758627/#msg_758627
Stefan Edlund2011-11-23T23:33:50-00:00