Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [stem-dev] Food Production


sure, go ahead and commit your changes for the FoodConsumer. Also, Matt put together a cattle scenario but it doesn't have consumption in it yet, maybe you can try adding it to it.

/ Stefan

Stefan Edlund
Public Health and Computer Science Research
IBM Almaden Research Center
(408) 927-1766   edlund@xxxxxxxxxxxxxxx

Inactive hide details for "Thoens Christian" ---01/14/2012 10:33:29 AM---Thanks Stefan, I see that integration for transformati"Thoens Christian" ---01/14/2012 10:33:29 AM---Thanks Stefan, I see that integration for transformation decorators won't work, but I


"Thoens Christian" <Christian.Thoens@xxxxxxxxxxx>




01/14/2012 10:33 AM


Re: [stem-dev] Food Production

    Sent by:


Thanks Stefan,

I see that integration for transformation decorators won't work, but I
need to model consumption with transformation decorators for some of the
scenarios I want to create. Is it ok if I commit changes to the
foodproduction plugin? I don't change FoodProducer and Slaughterhouse.
The only change for the user would an additional FoodConsumer component.

One example that is difficult to model with the FoodPopulationModel is
when I want to use regional variations for consumption. I noticed that
population models have a location ISO key parameter. So it would be
possible, but I would have to create a new population model for all the
regions. That means the same parameters for the human population like
birth and death rate have to be entered multiple times. So the the same
information exists at different places. To change the birth rate it has
to be changed in each model. If the human population consists of
multiple population groups, this is even a bigger problem, cause there
are more parameters to define. That's why I would like to seperate the
population model and food consumption.

Of course, the food population model can also be implemented, in case
somebody wants to model integrable food consumption.


>>> Stefan Edlund  01/14/12 1:22 AM >>>

Thanks Chris,

there is a problem having transformation decorators being integratable.
limitation in STEM right now is that only one disease model is allowed
calculate the next value of the disease state in a population. Let's
the slaughter house example.  So say we have a regular SIR disease model
for modeling infections in cattle and an SI model D2 for the beef. What
slaughter house transformation decorator is doing is really updating
of disease labels that in some sense does not belong to it. It touches
labels for D1 and D2, but it only does that at the beginning of a time
step. After this, D1 and D2 are free to go on integrating the solution
the next value.

If the transformation decorator was also integrating, it would calculate
its own delta value for the labels of D1 and D2, which surely would be
overwritten by the delta value calculated by D1 and D2 themselves.

I'm still leaning towards having food consumption being integratable
some extended multi-population disease model. Removal of consumed meat
could be represented using the BIRTHS_AND_DEATHS ExchangeType attached
the delta value of the disease state. I think you remember how this was
done from last summer :)

/ Stefan

Stefan Edlund
Public Health and Computer Science Research
IBM Almaden Research Center
(408) 927-1766   edlund@xxxxxxxxxxxxxxx

 From:       "Thoens Christian"                                        
 To:         ,                                                        
 Date:       01/13/2012 01:24 PM                                      
 Subject:    Re: [stem-dev] Food Production                            
 Sent by:    stem-dev-bounces@xxxxxxxxxxx                              

Thanks for all the suggestions.

First I would like to explain why I prefer to model consumption with a
TransformationDecorator. For the scenarios Matthias and I want to create
integration is not a priority. The most important thing is to able to
model the food consumption in any way you want. And with the
FoodConsumer class it's easy to model many different things. Let's say
we have data that a certain amount of beef is consumed daily in a
certain region. In that case I can just set the daily consumption to a
fixed number. I can also set consumption to a fraction (such as 20% of
the whole beef is consumed daily) or I make it dependent on the size of
the human population in the region. Stefan's idea of a
FoodPopulationModel is great for modeling a consumption, that is uniform
in the whole world. FoodConsumers can be different in different regions.
I don't know yet if we will use this feature in our scenarios, but it's
an advantage, that a FoodConsumer can be used to model many different

Nevertheless, making consumption and other TransformationDecorators
integrable is of course desirable. I like the idea with the
integrable-flag and I think the extra-complexity for the user is not
such a big deal. We could put a warning next to the checkbox, "Only use
this if you know what you are doing". Of course performance is a
downside and it might be difficult to implement, especially in Stefan's

Best Regards,

>>> James Kaufman  01/13/12 7:28 PM >>>
I think the only question issue arrises if you need the FoodConsumer to
The transformation decorator was designed to handle transformations that

are by definition not integrable
but food consumption might be.

Here is one other thought (but one with big downsides).
Stefan suggested you use multipopulation model to handle consumption.
A food consumption decorator could store a MAP which knows at what rate
different populations consume different foods.
We probably want to handle consumption of feed by farm animals as well
consumption of food by humans.
If the foodconsumption decorator does not do the but simply stores the
rates, then the population models could handle the decay
in an integrable way (because population models are integration
decorators). The thing I do not like about this idea is it then makes
population models more complex and I wanted to hide the complexity of
transformation in a separate transformation decorator.

A second thought (also with downsides) is to give the transformation
decorator a flag to indicate whether or not the transformation is
an integrable transformation. We would then have to group any
transformation decorators by integrability and so we call transform at

right point in the iteration cycle. This also has bid disadvantages
(performance hit as a well as a lot of complexity for the users - they
need to
understand if the transformer can be integrable).

The best approach may be Stefans suggestion. What if we extend multi
population model to a new class called "Food" or "Food Population".
This could have different states, death=expiration, and it could store
map=Consumers with their consumption rate. This might also be
better representation of reality since consumption is not really
transformation. Consumption is integrable. Food production is not.

Best Regards,

IBM Almaden Research Center, 650 Harry Rd.
San Jose, CA 95120-6099
email: kaufman@xxxxxxxxxxxxxxx
phone: (408) 927-2477  (tie 457-2477)

"Thoens Christian"
01/13/2012 03:04 AM
[stem-dev] Hi all,
Sent by:

Hi all,

I would like to make some changes to the foodproduction plugin. A class
that allows consumption of food and disease transmission by consumption
should be created. My proposal for this is as follows.

abstract base class "FoodTransformer" (or maybe "FoodProcessor", since
consumption does not transform food?)

a child of "FoodTransformer" called "FoodProducer" (maybe abstract?):
same functionality as the old class "FoodProducer"

a child of "FoodProducer" called "DiseaseCarryingFoodProducer" (or
maybe "Slaughterhouse"?): same functionality as the old class

a child of "FoodTransformer" called "FoodConsumer": provides
consumption of food and disease transmission by consumption

Does anyone have any suggestions for improvements?

stem-dev mailing list

stem-dev mailing list

stem-dev mailing list

GIF image

GIF image

Back to the top